Page 1 of 1

ATMEGA1284P not working (TP1, TM2, LCD problems)

Posted: Dec 6th, '19, 22:20
by mnti
Hi everyone!
I decided it's time for me to stop bothering klang with PMs and ask a question to this forum.

tl;dr: My sequencer works and I think my 1284 microcontroller is not working but I'm not sure.

with details:

What I'm doing
I'm building the nava909 with the extra9 mods. I have built all the instruments and left out any components that need to be replaced. I don't think this affects the digital circuitry of the sequencer at all because the sequencer triggers the analog circuits- leaving these components out just means I won't have sound.

What doesn't work
I have the same problem as in these posts:
- viewtopic.php?f=24&t=1563&hilit=TP1
- viewtopic.php?f=24&t=1093&hilit=TP1
- more results here search.php?keywords=TP1+%7C+LCD+%7C+TM2 ... mit=Search
My LEDs are fine so my 74hc595 chips are all good.
I get only millivolts at TP1, turning TM2 does nothing, and my LCD screen only shows a top line of blocks.

What I have tried
- I've tried the things mentioned in the posts lifted above
- All the pads with power (labelled on the PCB) have the right values.
- IC chips are in the correct orientation.
- I haven't tested EVERY single connection, but I've tested all relevant connections to TP1, TM2, and the LCD from component leg to component leg (so it's not like only the socket is connected or only the bottom or top pad is connected. The signal goes through all the way through)
- interestingly the board behaves the same with or without the microcontroller plugged in (LCD top bar, all LEDs on)

The latest thing I've been trying is seeing if I can read the microcontroller from the ICSP header. I'm using a usbtiny AVR programmer and AVRDude.
If AVRDude can read the chip this tells me
- the 16 MHz oscillator is working
- the connections from ICSP to the m1284p are correct (MOSI, MISO, SCK, RESET)
- the chip can be reprogrammed (this means the fuses are not set so you can't reprogram the chip. Not sure what the case is. maybe Vincent can say?)

But in my case, AVRDude cannot read the chip:

Code: Select all

>avrdude -c usbtiny -p m1284p

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.
- I tried replacing the crystal and checking the connections to the chip. no bueno.
- I put the chip and crystal on a breadboard so no other circuitry can muck with the ICSP connections. no bueno.
- I tried swapping MOSI and MISO in case that was wrong. no bueno.

Conclusion and questions
I'm coming to the conclusion that my m1284p microcontroller is shot. I assume I'm supposed to be able to read it because an ICSP header is provided on the circuit board. It seems bricked, meaning it can't be communicated with so it can't be reprogrammed, or the microntroller is totally broken. If the microcontroller is broken this would explain the LCD top bar and the TP1 and TM2 not working.
Am I supposed to be able to read this chip?
If yes, can I obtain the hex file and fuse settings to program this chip? (If the chip is bricked and not broken, it can be reprogrammed using a 12v programming setup)
Do I need to buy another microcontroller from e-licktronic?

Please let me know if there's something else I should be trying, or something I am missing! I really want to get this drum machine done before I leave for break!

Thanks,
mnti

Re: ATMEGA1284P not working (TP1, TM2, LCD problems)

Posted: Dec 8th, '19, 00:57
by mnti
Sorry for my ignorance.

I found the firmware here. viewtopic.php?f=25&t=864

I will be trying to unbrick or program my chip and will update with details

UPDATE: You can use 12v High voltage to change fuses on the m1248p, but you need to have a parallel port programmer: a serial programmer (ICSP) won't work for this Atmel chip.

I measured the voltage at the chip in the programmer and it measures ~3.8V... in the nava board the voltage measured ~4.8 volts. I believe since the nava power supply can source more current I didn't see much of a voltage drop, but a voltage drop is obvious when powering the chip from my USB powered ICSP programmer...

I conclude that this chip must be damaged. I have ordered new chips and will be programming it with the information provided in these posts:

avrdude fuses and bootloader:
viewtopic.php?f=25&t=1141&p=7130&hilit=tools#p7130

newest firmware:
viewtopic.php?f=25&t=864

Re: ATMEGA1284P not working (TP1, TM2, LCD problems)

Posted: Dec 11th, '19, 20:01
by mnti
Hey guys.

I bought new chips and I've learned a few things...

- you CANNOT use a usbtinyISP programmer to program the m1284p microcontrollers. USBTinyISP only supports up to 64k flash devices. the m1284p is 128k flash. Thought avrdude says it's supported it's NOT.
so you have to use ArduinoISP (no big deal)

- the MOSI and MISO lines on the NAVA v1.02 boards are SWAPPED - if you try to use a standard ISP programmer header it will NOT work. This is a common mistake but I'm surprised they didn't test this out before shipping these out...


So now with the correct setup I read my original m1284p: device signature reads 0xffffff - it's dead. cool.

Here are the commands I used to program the new m1284p. Note you'll have to change COM on your PC (or to /dev... on linux or mac).

Code: Select all

avrdude -c avrisp -P COM5 -b 19200 -p m1284p -U efuse:w:0xFD:m -v 

avrdude -c avrisp -P COM5 -b 19200 -p m1284p -U hfuse:w:0xDC:m -v 

avrdude -c avrisp -P COM5 -b 19200 -p m1284p -U lfuse:w:0xD6:m -v 

avrdude -c avrisp -P COM5 -b 19200 -p m1284p -U flash:w:Nava_v1_028beta.hex:i -v 
Run the commands in that order


My sequencer works now.
the problem was indeed a faulty microcontroller. Hopefully this helps someone else.