I am trying to generate a composite video black and white test card with text for Amateur Television.
I know this has been done on the Mega8 and is available as a stand alone or a shield to enable video out on an existing board.
I would however like to dedicate my Arduino Duemilanove board with and ATMEGA328 to the task.
The original was written in C and not using processing/arduino enviroment. I can upload to my board in processing/arduino but I cannot compile the C files supplied.(I dont know how) I also have not found a way to download the completed hex file provided to my board using the USB lead that comes with the duemilanove unit.
I spent ages trying different things. The closest I got is to
The original batch file provided did not use the stk500 so I changed that. I also set my usb driver to com9 and put com9 in the settings.
The error I now get is stk500_getsync() : not in sync: resp=00x00
When I run avrdude the rx light flashed 3 times and the original program (blink) continues to run.
The main questions I have are:
What is the easiest/best way to upload a hex file to an ATMEGA328 on a Arduino Duemilanove? (I tryed some GUI avrdude programs to no avail) (I tryed overwritting the Arduino hex file but it re-writes it just before upload)
Is STK500 correct above?
Is COM9 correct above or should I used USBxx? (I am running WinXP)
Note:programming the chip with arduino/processing works OK
Thanks in advance for your time and help. Dan from Ireland :-/
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f => ATmega328P (m328p)
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "TellyMate_M328p.hex"
avrdude: input file TellyMate_M328p.hex auto detected as Intel Hex
avrdude: writing flash (32716 bytes):
Writing | ################################################## | 100% 15.36s
avrdude: 32716 bytes of flash written
avrdude: verifying flash memory against TellyMate_M328p.hex:
avrdude: load data flash data from input file TellyMate_M328p.hex:
avrdude: input file TellyMate_M328p.hex auto detected as Intel Hex
avrdude: input file TellyMate_M328p.hex contains 32716 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 13.92s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x7800
0x00 != 0x0c
avrdude: verification error; content mismatch
avrdude: Check to make sure Fuses are still correct.
avrdude: safemode: Fuses OK
avrdude done. Thank you.
So I am getting a verification error. When I reset the board afterwards the old program (blink) is gone so something must now be in the flash. I can still download blink using the arduino program. As I am using the onboard USB and the chip has a bootloader installed should I be using the ICSP instead? (I dont have an ICSP lead).
Has the program gone in ok? The bootloader is still there. Is that a problem?
The original hex file was designed without a bootloader in mind. It is 86KB in size. Can a bookload and the hex file fit?
For those making their own version of a TellyMate, the default compiled version of v.1.0.14 of the TellyMate code will no longer upload onto a chip with a bootloader - v1.0.14 introduced re-flashable fontbanks which necessitated use of the bootloader memory space.
To get V1.0.14 onto a 328 with a bootloader, a couple of small changes are needed to the makefile (documented therein) before recompiling...
remove the 'reprogrammable fonts' functionality
reduce the number of fontbanks to 10
Dan, since you're not au-fait with makefiles and the likes, PM me, and I'll send you a bootloader friendly M328p version of 1.0.14.
In the mean time, the .hex file in release v.1.0.11 should work fine on a M328p with a bootloader.
Using an arduino duemilanove this enabled me to insert a few jumpers and covert the USB port to do ICSP!
This enabled me to remove the bootloader and get it working (I think it is working but I dont have resistors and diodes to hand to check it!
I also think I figuired out what connections I need to set the mode to PAL and where to connect the diodes etc:
Grounding enables option
PC0 ADC0 J1 Baud rate selection
PC1 ADC1 J2
PC2 ADC2 J3
PC3 ADC3 J4 Auto Line Overflow
PC4 ADC4/SDA J5 Auto LF on CR
PCS ADC5/SCL J6 PAL/NTSC selection
So PCS MUST be held low for NTSC
J3 J2 J1 Baud Rate
Off Off Off Autobauding
Off Off On 300
Off On Off 1200
Off On On 4800
On Off Off 9k6
On Off On 19k2
On On Off 38k4
On On On 57k6
So for Arduino Duemilanove connected analogue in 5 to ground (pal enable)
Connect RX (0) to Digital 8 (serial data in)
Digital 9 goes to 1N4148 and 1K resistor then to video out
Digital 11 goes to 1N4148 and 330R resistor then to video
Data is then set from PC hyperterminal to Com9 (via USB) with autobauding
I am hoping to use this as an Amateur Television test card with callsign display so once I get it working I'll probably be back asking for more help!
I have ordered a shield from batsocks so they may get a few quid from me anyway!
From what I can gather looking at the scant documentation I made, I ended up resorting to running windows under parallels, and using the windows version of the avrdude distributed with Luminet like this:
The first one sets the fuses, while the second one burns the hex file. I got the fuse values from the batch file M168_program_all.bat on the batsocks website. I guess you can do something similar for non-168 based arduinos.