USB host shield on Arduino Uno - arduino

I downloaded USB host shield code from the following website:
https://github.com/felis/USB_Host_Shield_2.0/archive/master.zip.
This contains too many files to which one I have to include for my application.
I want to know if USB host shield can be mounted to work in Arduino Uno. If yes can anybody provide me sample code to read SD card text file using USB host shield for Arduino Uno ?

I suppose that by "reading a SD card text file" you mean plug a SD card in a SD-USB adapter and then reading the file from it.
If so, there should be an example in the library called testusbhostFAT (here you will find the online version) where they read files stored in a FAT HDD (and I think that SD-USB adapters are seen as HDDs or FDDs).
Anyway they explicitly say that
This will not run a Arduino Uno due to the limited ram available in the ATmega328p.
By looking at the code maybe you will manage to slim it enough to run it on a Uno, but... Well, probably it's a bit hard.
Bye

Related

Is it possible to factory reset an arduino from hardware to remove bad user code?

I was troubleshooting why Serial1 was always throwing undefined errors in sketches I was trying to run when I found a solution posted online for a slightly different board that suggested this line:
HardwareSerial Serial1(2);
I uploaded it and now the Arduino doesn't show up in the IDE, did I remap it's serial communications? Why is this possible!
Is there any hardware factory reset option available on these boards? Did I just brick my device?
edit: It seems the STM32Cube programmer app can be used to communicate with the device but I'm not sure where to get the original firmware to flash. https://imgur.com/a/LbiHenf
Assuming from the tag in your question, I guess you have an STM32 – (BluePill) Development Board (STM32F103C8).
If you think that your board is not handling serial communication properly then you might consider burning bootloader to your board. This will reset the complete configuration of your board.
There are many ways in which you can burn bootloader to your board.
Using another Arduino board like Uno / Nano / Mega
Using an FTDI USB to TTL Serial Adapter.
You might want to go through tutorials list below:
Getting Started with STM32 using Arduino IDE: Blinking LED
Programming STM32F103C8 Board using USB Port

Arduino - Sparkfun USB host

I am building a device and need to use a USB Nordic ID rfid reader. I have a Spark-fun USB host card (V9947), and now need the firmware to allow be bi directional chat in a 'rs232' style serial... just as if it were a hardware or software serial port on the Arduino.
Nordic support have reassured me that their library and examples for the Arduino are normally used with readers with RS232 ports, however the same code will work with their smaller USB device if I can overcome the USB/serial barrier.
I have the library and examples for the USB host board, but cannot determine which example code resembles my requirement requirement, I have looked through the library and found no answer there either.
This could be down to personal stupidity/ignorance... however never been this stumped before. the internet does not seem to have an answer, documentation and support for this board are at best meager.
I hope someone here has managed to solve what should be a simple mission, and I can get on with this project.
Thanks Ian
As not knowing what you already have done, I'll make a walk through the complete setup. Please check(do) each point evenif you think its done already:
Soldering and hardware have no shorts
pin headers of the shield are soldered with no shorts
USB Jack of Arduino is isolated on the top to prevent shorts
With the SparkFun board, it seems like you MUST supply external power on Vin or the barrel jack. 5V from the USB cable will not work reliable.
You must also run a jumper from pin D7 to RESET.
For the board (SparkFun DEV-09947) set up – these are mandatory pre-requirements.Now the software
The code/drivers you need to use for this board are on this GitHub page.
There is a diagnostic test which is extremely useful for checking wether your board is working correctly. Do as follows:
Upload this sketch to your Arduino, then open the Serial Monitor to see the diagnostic info.
To see the output set your Serial Monitor terminal speed to 115200
Plug in your hardware into the USB of the shield
Reset the Arduino to start the diagnostic
Step 1 – you’ll see it recognize the board and start a transfer test
Step 2 – you’ll see it attempt to test the GPIO pins – you’ll get “GPIO test failed” message. Type something in the box at the top of the Serial Monitor, then hit “Send” button and the diagnostic test will continue.
Step 3 – you should see it cycle through a bunch of resets, then it will attempt to detect an USB device – as we have a device plugged into the USB port on the shield you should then see some summary info with a final message of “All tests passed”
So NOW we know the hardware is working and basic software is running.
Next step driver installation/test program for the Nordic
Get the library from here
Import NurMicroApi_arduino.zip to IDE. From menu: Sketch->Include library->Add .ZIP library...
Open example. From menu: File->Examples->NurMicroApi->NurExample
Change baudrates and sw serial pins to match your arduino HW In this example NUR module is connected to arduino via software serial pin 10 (RX) and pin 11 (TX) with baudrate 38400. HW serial is used as print output.
You may have to change this to the USB card connections (see diag-SW)
As an easier option you can use the HID parser to check if your NUR is recognized If that works take a working exmple like:
Working HID example and try to read a tag then start coding with the NUR example from above if values are not correct interpreted
If you want to use the "pure" at-Terminal (RS-232) style you have to get rid of the usb shields functions (lib) and write your own Arduino firmware based (=overcome the USB/serial barrier) on the nordic-api (well documented) Hope this gets you started

Arduino Uno wifi Mqtt Connector setup

I'm using the Arduino UNO Wifi Developer edition and trying to get MQTT running on it. As per the documentation here http://www.arduino.org/learning/reference/ciao-mqtt it requires setting up the connector by change the mqtt conf file. The question is how do i do that? What are the steps to update this file and where does this file even reside?
It shows the path of the file but i'm not sure how to reach that file, does this file reside on the Arduino board or is it on the Arduino IDE file system?
If it is on the Arduino board how do it edit the file there, using what software?
The ciao-mqtt client is for use with the newer arduino boards that have a on board arm processor that runs a flavour of Linux. Boards like the Yun
The file it mentions is hosted in the Linux side of the board.
If you want to do MQTT on a "normal" arduino board look at this client
http://pubsubclient.knolleary.net/

arduino as isp and to burn atmega16 using avrdude compiler

I am trying to burn my atmega16 with arduino as ISP. So far the codes have been uploaded to my arduino flawlessly. I have uploaded arduino as ISP codes to my arduino, I have burnt bootloader of atmega16 using arduino IDE. As I sent the core working code from arduino IDE this went flawlessly. But the atmega is not showing the response, i.e. hardware is not working. And that is my (case I) issue. Case II: Furthermore, when I tried sending hex file (core working code) with avrdude compiler, it says ser_open() ... can't find lpt1. Is this the problem of avrdude's compiler? In case II there it didn't even uploaded the code, let alone the working of hardware. Please help.
The fact that it's trying to send it to the LPT1 parallel port suggests you haven't specified "Arduino as ISP" as your programmer. Also make sure you do a Control-Shift-U (upload via programmer) instead of Control-U (upload via the bootloader). Finally keep in mind that uploading code via an external programmer will overwrite the bootloader so you won't be able to upload via USB after that unless you reflash the bootloader or do it via the command line.

Cant upload a boot loader to arduino

Using arduino UNO(mac) i am trying to upload boot loader to the atmega328 where the chip is on a bread board, and connected to the UNO board tx-tx, rx-rx, vcc,gnd ,reset .
So i am trying to upload a boot loader by adding to the boards.txt file the atmega on a breadboard 8mhz , and choose it from boards menu.
than when i try to burn boot loader he says after 0 seconds :
did not find any USB device "usb"
than i change the programmer from - AVR ISP mkii to- AVR ISP
it starts then, and after 6-7 seconds of try he fails saying:
programmer is not responding
I dont know what am i doing wrong, i have also tried with a oscillator,or without it, nothing works.
maybe the fact that its a mac has todo with it ?
To access that portion of memory you need to use the arduino as an ISP (in-system programmer).
The use of USB to program an arduino chip is enabled by the bootloader you are trying to put on.
The usual way is to program a chip directly is using an ISP.
Have a look at the setup here:
http://arduino.cc/en/Tutorial/ArduinoISP
Another good resource for an advanced build is this:
How to Build an AVR Development Board: http://youtu.be/ncobWc61wL4
He explains what he is doing as he goes so it is really easy to follow and he talks about the programming process.

Resources