So ive got the MIDIpal soldered up. SMD is NOT that difficult. If youve successfully soldered a few projects together than you should be able to handle SMD. I watched a few videos and got right to it. Its not as easy as the videos make it look but its not as hard I thought it would be.
Sooooo, programming the AT.Mega328. I dont know anything about this stuff. I come from the world of stomp box building and circuit bending. I dont have an AVR programmer so I was going to try to make a serial port to ISP cable, seems pretty straight forward.
My questions are these…
(i) What is a good AVR programming software to use that will be compatible with serial port cable? Recommendations? That would get me started in the right direction.
(ii) Can I program the ATmega328 while the MIDIpal is powered up? Do I need to worry about powering the chip with the serial port or can I omit the power wires and use the on board MIDIpal power?
(iii) What is the actual pin out of the on board ISP connector on the MIDIPal??? I dont see this anywhere.
(iv) How do I actually program the chip once everything is hooked up? The few directions make no sense to me, I know NOTHING about running code or make files etc…
Thanks guys, If I get this figured out I can post a pretty detail tutorial for anyone else that once to try this method.
I say just get a programmer and be done with it. I’ll sell you my USBtiny for $10 + shipping if your interested, it wont do the big megas and is not the zippiest thing on the planet but it works and is widely supported.
Generally, you want to use AVRdude to program everything (thats what Olver uses in the manual) and that is bundled with WinAVR if you’re on windows. You wont need to MAKE files, the binaries (aka hex files) are supplied. To program the chip you need to: Set fuses, program flash, program eeprom
Thanks for the fast response altitude. I would be very interested in your USBtiny. I dont know if I can PM you here or how you would like to exchange info, let me know.
That being said I would like a bit more insight if anyone has any thing to add to this discussion.
1. avrdude is pretty much the standard.
2. it depends on your programmer. The AVR ISP mkII I use does not attempt to power the board ; so the power supply must be hooked during programming. It kind of makes sense because the programmer has no way to know if the board should be powered at 3.3V or 5V.
3. First row : RESET SCK MISO. Second row : GND MOSI +3.3V
4. It depends on your OS. On Linux or Mac OS X, you can do it from a command line :
avrdude -V -p m328p -C path_to_avrdude.conf -c name_of_the_programmer -P usb -e -u -U efuse:w:0xfd:m -U hfuse:w:0xd4:m -U lfuse:w:0xff:m -U lock:w:0x2f:m
avrdude -V -p m328p -C path_to_avrdude.conf -c name_of_the_programmer -P usb -e -u -U flash:w:midipal.hex:i -U flash:w:midipal_muboot.hex:i -U eeprom:w:midipal_eeprom_golden.hex:i -U lock:w:0x2f:m
The files midipal.hex ; muboot.hex and midipal_eeprom_golden.hex can be downloaded from here
name_of_the_programmer is the path to avrdude config file. name_of_the_programmer is the name of the programmer (avrispmkII in my case). Note that my programmer is hooked to the usb port, so I use “-P usb”.
Just email me at altitude909 at gmail
Try Gromov’s programmer
add to avrdude.conf:
id = “gromov”;
desc = “serial port banging, reset=dtr sck=rts mosi=txd miso=cts”;
type = serbb;
reset = 4;
sck = 7;
mosi = 3;
miso = 8;
than use avrdude with following parameters:
avrdude -n -c gromov -P com1 -p m328p
where com1 is your com port, m328p is your MCU
Thanks Schrab this is very thorough! altitude sold me his USBtiny (thanks again!) but Im impatient so might give this a try anyhow. haha
Well crap hole! I had 3.3V at the bottom of the board two days ago. I made a serial port cable last night and was going to hook it up and now I have no power. I suspect either the diodes or the big caps are suspect? This is a set back. How can I test the LM1117? anybody know an easy way to test it to see if its passing voltage? Thanks. And no I havent done any sort on continuity testing yet, got frustrated and went to bed. Just putting out a feeler until i get home tonight to get back at it. My MIDItron is lonely…
Connect cellphone battery or any 3,7v accu to IN + GND of LM1117 than measure voltage between GND and OUT pins.
(Pinout, front view left to right)
1 - GND
2 - OUT
3 - IN
after that check D2 and D3 diodes.
thanks again man, life saver, ive got an adjustable PSU so Ill try that out!
Not sure if this is programming issue or not, but, I’ll start here: Got it built, and programmed, but only the MIDI Monitor app works. Pressing the Rotary encoder for 2 seconds does nothing. Turning the encoder does nothing. If I press the encoder quickly just once, it displays “chn[ 0]” and that’s it. Turning the knob at that point does nothing either. Help!
Does the user interface feel sluggish and is the MIDI reception broken? If so it looks like you have forgotten to set the fuses and the chip is clocked at 2Mhz instead of 20. This totally messes up with switch debouncing.
Both MIDI send and receive work fine. Plus, the LED lights blink correctly in conjunction with MIDI data that passing through. The display shows the note changes very quickly and everything appears to responding at a zippy rate. I’ve re-flashed it and paid special attention to the fuses, but it’s behaving the same way as above. What should I check for next?
Encoder : check that there is no short between the top right pin and ground ; or between the bottom left pin and ground ; or between the bottom right pin and ground
Identify the pins of the MCU connected to the 3 encoder pins (top right, bottom left, bottom right). Check that they are not shorted with adjacent pins.
Hello, i just recieved my MIDIpal this morning, and now its built i needed to program it.
I programmed mine with Winavr and an arduino (must be pre UNO apparently)
I followed this instruction except did not connect the power (connect the ground though) and powered the midipal by battery.
then CD to the folder where i downloaded the hex files. change the com port to whatever virtual com port it shows in arduino IDE when you load the avrisp sketch.
Either rename the midipal.hex file to get rid of the version number, or change it in the second line.
avrdude -V -p m328p -c avrisp -P com3 -b 19200 -e -u -U efuse:w:0xfd:m -U hfuse:w:0xd4:m -U lfuse:w:0xff:m -U lock:w:0x2f:m
avrdude -V -p m328p -c avrisp -P com3 -b 19200 -e -u -U flash:w:midipal.hex:i -U flash:w:midipal_muboot.hex:i -U eeprom:w:midipal_eeprom_golden.hex:i -U lock:w:0x2f:m
I thought it might not have worked because the second file copied very quickly, but everything seems fine,
looks like a useful gadget!
Congrats! The second file contains only 1k of data, written in the upper part of the flash.
Just to be absolutely sure; My old serial AVRISP MkI will do the trick as well, right?
Old Ponys know the best tricks, Lindeborg
If you can hook it up to a 6 pins ISP cable ; and if it is supported by avrdude, yes.