Appunti su OpenLog (e ArduLog)
Tempo fa ho acqustato un Openlog della Sparkfun, un logger seriale arduino-based.
Non sono mai riuscito a farlo funzionare, però nel frattempo tanta gente ci si è rotta la testa trovando un sacco di problemi, e risolvendoli alcuni; le soluzioni sono sparse nellalunghissima pagina dell’openlog, provo a riassumerle qui sotto; nel frattempo, ho ordinato invece un ARDUlog, che essendo un successore sembra un po’ migliore: ha dei fori per avvitarlo a un supporto, e ha vari pin analogici di ingresso, quindi è predisposto a livello hardware per diventare un logger standalone, anche se ancora non esiste un firmware adatto.
Ardulog 2.0 (notare l’inversione di TX e RX per coincidere con la board FTDI):
PROBLEMA 1 – Condensatori di disaccoppiamento sull’alimentazione:
I am using the open log to log weather and cosmic ray data once a minute. I have an Atmega 328 connected on the bread board to the open log for data logging, and to a FTDI header for programming. The open log log’s data fine when I have the FTDI adaptor (DEV-09716) attached, but doesn’t log anything when It isn’t attached. I assume I have a hardware failure, and I forgot to connect something to the open log that the FTDI is connecting for me, but I checked and the TX and RX pins are connected properly, and so are GND and VCC. Right now my only guess is that the FTDI is putting more capacitance on the power supply that causes it to start working, but I haven’t tested it yet. However when I measured the voltage W/ the FTDI adaptor both the TX and RX lines sat at 4.7 to 4.9V and W/O it was 3.3 for both of them. Can I please get some help?
I fixed the problem, there wasn’t enough capacitance and the bypass caps on the FTDI were making the open log work. Make sure you have bypass caps on your power supply, I added a 10uf about 10cm of wire away and a 0.1uf right on the header of the open log and it started working perfectly.
PROBLEMA 2 – Livelli a 5V o 3,3 V?
I’m getting a stream of 1s back from the data logger over serial.
I’m using a 5V Arduino, powering the OpenLog off of its 5V pin, and sending serial over to it and getting serial back. When the TX from the Arduino is not connected to the RX on the OpenLog, the OpenLog reports “12<”. However, when I connect the Arduino’s TX pin to the OpenLog’s RXI pin, I only getting “11111111….”
While the datasheet says that the RXI pin can take up to 6V, I notice that the schematic shows regulation of VCC down to 3.3V, while the RXI pin undergoes no translation and is connected directly to the ATMEGA. This makes me think that in fact a 5V TTL signal from the Arduino is too high and is causing the ATMEGA to result. Just a guess though.
Has anyone else seen this? The closest thing I found was unanswered (https://github.com/sparkfun/OpenLog/issues/138).
For reference, everything works correctly when I use a 3.3V FTDI.
I just soldered up a TTL logic level shifter (the Sparkfun one), taking my 5V TTL on the Arduino side down to 3.3V on the OpenLog side, and now it’s working. It looks like the 5V serial signal in fact is unacceptable to the ATMEGA, despite that the datasheet suggests it can accept 6V. Big debugging nightmare! Does anyone k
PROBLEMA 3 – Malfunzionamento a batterie
This is working when using USB power, but not battery power. Setup:
5V Arduino’s TX –> logic level shifter –> OpenLog’s RX
OpenLog’s TX –> resistor –> Arduino RX
Arduino’s reset pin –> logic level shifter –> OpenLog’s reset pin
I had a high-current device on the same bus. Interestingly, a separate mistake was drawing the 3.3V bus to 5V, but when the high-current device was on the line, it was pulling too much current and bringing the bus back down closer to 3.3V. When I used the battery, which delivered more current, this didn’t happen, and so the OpenLog would reset. Nasty problem. Fixed with a separate bus for that current-hungry component.
PROBLEMA 4 – flashing firmware con AVRDUDE:
I’m using a FTDI 3.3v (DEV-09717) cable connected to my OpenLog. Using teraterm on COM10 I can make a connection to the device. all is good.
to upgrade the firmware I’m using the follow cmd:
avrdude.exe -p atmega328p -P COM10 -c stk500v1 -b 57600 -Cavrdude.conf -U flash:w:main.hex
and get this response:
avrdude.exe: ser_open(): can’t open device “COM10”: The system cannot find the file specified.
I have put libusb0.dll in the system32 directory.
is the problem that arvdude can’t handle high number com ports?
I did a little hacking with regedt32 and changed the comport from 10 to 3. I can now update the firmware.
The registry remembers all FTDI converters that have been used. The driver does not reassign unused comport numbers. In some cases that a good thing. It would be nice to be able to “reserve” a set of comport numbers to be reused as devices are used and removed.
PROBLEMA 5 – flashing firmware
Anyone encountered this problem while flashing the firmware? Thanks!
C:\openlog>avrdude.exe -p atmega328p -P COM6 -c stk500v1 -b 57600 -Cavrdude.conf
avrdude.exe: stk500_getsync(): not in sync: resp=0x00
avrdude.exe: stk500_disable(): protocol error, expect=0x14, resp=0x51
ok..solved. you need to connect all pins of FTDI Basic board and openLog. Not just TX/RX/5V/GND won’t be able to download.
Under this topic
How do I attach a FTDI Basic board to OpenLog for configuring and bootloading?
PROBLEMA 6 – output 1, no prompt, no logging
I get an OpenLog with firmware v1.51 as I remmeber. I have a standard FTDI cable.
I downloaded newer firmware through the git repository. I can upgrade sucessfully to any firmware version. I Only have Rx-Tx wires with Vcc-GND. I power up openlog whild pressing enter with: avrdude -p atmega328p -P COM2 -c stk500v1 -b 57600 -Cavrdude.conf -U flash:w:main.hex
It’s programming without error. However, open log is only showint one 1 at hyperterm when starting. I do not have anymore 12>.
What’s going on ? any ideas ?
Find out : the computer corrupted the Sd card. reformating the card make its working with latet firmware.
Just got it working! Very nice.
Couple of hints for others.
—Default baud is 9600 8n1.
—Make sure your card is formated as fat16.
—If you hook it directly up to FTDI Basic don’t forget to cross the rx and tx lines.
to format FAT16 with dos in xp:
c:>format e: /fs:fat
STAT1 LED is the LED right of the word OpenLog and is sitting on PD5 (Arduino D5). This LED toggles on/off every time a new character is received. This LED helps troubleshoot and indicate serial communication is working.
STAT2 LED is the LED left of the word OpenLog and is sitting on PB5 (Arduino D13). This LED is attached to the SPI Serial Clock line. You will see this LED flash rarely. It only turns on when the SPI interface is active and this is rare as the OpenLog buffers 512 bytes at a time before recording to the SD card. Recording 512 bytes is very fast so the LED is on for very little.
OpenLog expects TTL voltage levels. RS232 will not work and could (maybe) harm the OpenLog (probably not though). You’ll need a MAX3232 or a shifter circuit.
UPLOAD FIRMWARE SENZA AVRDUDE:
If you want to upgrade the firmware on this board with the latest version, you don’t have to go through the hassle of installing a custom version of Arduino as suggested. The compiled hex file is included in the download. There is a great little program called XLoader (http://xloader.russemotto.com/) which you can use to download the firmware into the openlog. (No avrdude knowledge required)