MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

Ambika motherboard problem
MUFF WIGGLER Forum Index -> Music Tech DIY  
Author Ambika motherboard problem
messerschmitttwin
when I power up I get the screen working and the variable resistors alter the filter parameters but none of the buttons work to change pages, using an oscilloscope i can see they work by pulling the 74165 pins low? I'm inexperienced in programming atmegas, great-full of any suggestion?
Altitude909
is your resistor network upside down?
messerschmitttwin
Unfortunatly no, I checked that and also out an oscilloscope on the pins of the 74hc165, they are all being held high by the resistor network but go low when the corresponding buttons are pressed.
thanks for your reply
still scratching my head
Starspawn
Have you by any chance used a 5V Cmos part instead of one rated for 12V+?
messerschmitttwin
all 74hc, swapped the two 74hc595, the 74hc164, 74hc4050 and 74hc138, swapped the xtal and caps, reprogrammed another 644p, used a different power supply, still same results. I'm starting to think the pcb may be at fault, track break or hole not platted.
incidentally the screen takes about 30secs to get the page shown, seems a bit excessive.
flts
messerschmitttwin wrote:
incidentally the screen takes about 30secs to get the page shown, seems a bit excessive.


That sounds you've programmed Atmega's clock fuses to way too low clock speed and the whole system is working at a snail's pace. That would probably explain why buttons feel unresponsive too.

Or maybe not, that was just my initial intuition. Does turning the potentiometer show a quick change in the on screen parameter values?
messerschmitttwin
no, the pots seem slow as does the screen, you can see it update left to right.
I'm not sure if I've programmed the fuses, I burnt the hex file with avdude. how can I check the fuses? this is the first time I used an atmega644p.
thanks for your reply.
flts
messerschmitttwin wrote:
no, the pots seem slow as does the screen, you can see it update left to right.
I'm not sure if I've programmed the fuses, I burnt the hex file with avdude. how can I check the fuses? this is the first time I used an atmega644p.
thanks for your reply.


https://mutable-instruments.net/archive/ambika/build/firmware/

If you've done it according to those instructions (either from source via makefile, or those specific avrdude commands) then it should've handled burning the fuses for you as well (the efuse / hfuse / lfuse / lock part in the commands). If not, you can try reprogramming with those commands so the fuse bits will be set, and see if that helps.
messerschmitttwin
I didn't understand how to compile the code I tried but got lost so I downloaded the hex and used
avrdude –c usbasp –p m644p –U flash:w:ambika_controller.hex
I couldn't get the other burning instructions to work, it said the commands was not found. I thought I had programmed it when it got to the page above but I think I've not programmed them correctly, I come from an electronic construction background an the programming side seems unfathomable to me, I'm trying to buy a preprogrammed 644p from modular addict but they are out of stock.
Thanks for your help, I think its the 644p programming thats the problem
Altitude909
flts is right, if you dont program the fuses the processor will run at a default slow rate and this is likely your issue

Connect the programmer to the motherboard. Type the following commands in a terminal/command line:

avrdude -B 100 -V -p m644p -c avrispmkII -P usb -e -u -U efuse:w:0xfd:m -U hfuse:w:0xd2:m -U lfuse:w:0xff:m -U lock:w:0x2f:m
avrdude -B 1 -V -p m644p -c avrispmkII -P usb -U flash:w:ambika_controller.hex:i -U flash:w:ambika_controller_boot.hex:i -U lock:w:0x2f:m

https://mutable-instruments.net/archive/ambika/build/firmware/
messerschmitttwin
Do you do each line separately or type the whole lot in at once?
messerschmitttwin
running the first line i get[/img]
messerschmitttwin
running the second part gives me "option requires an argument --U"

Lars71
messerschmitttwin wrote:
Do you do each line separately or type the whole lot in at once?


You type in everything after each "avrdude" at once.
The first avrdude command and all it's parameters will set the fuses in the chip, the second avrdude command will program the flash memory and install the bootloader (so you need two files - the bootloader file and the actual Ambika firmware).

/Lars
messerschmitttwin
Thanks Lars, did that but hit problem
If I copy and paste the command efuse gets written but I then get the message
C:\Users\gra>-U hfuse:w:0xd2:m –U lfuse:w:0xff:m –U lock:w:0x2f:m
“-U” is not a recognised as an inernal or external command
I've read that -U is a commend to perform a memory operation so I don't understand.
Thanks for your help
Gra
flts
The rows in the Ambika web page have a line break due to layout reasons, but each grey box is one command with no line break. If you copy and paste them directly it means command prompt will think user wants to run first half of the command and then does not recognize the second because it is supposed to be a part of the first command.

A bit like if you typed

avrdude –c usbasp –p m644p
–U flash:w:ambika_controller.hex

It doesn't work, because command prompt interprets it as two different commands ("avrdude -c usbasp -p m644p" and "-U flash:w:ambika_controller.hex") instead of one long command (""avrdude -c usbasp -p m644p -U flash:w:ambika_controller.hex")

So hese are the two commands you have to run as Altitude909 has written above:

avrdude -B 100 -V -p m644p -c avrispmkII -P usb -e -u -U efuse:w:0xfd:m -U hfuse:w:0xd2:m -U lfuse:w:0xff:m -U lock:w:0x2f:m

AND

avrdude -B 1 -V -p m644p -c avrispmkII -P usb -U flash:w:ambika_controller.hex:i -U flash:w:ambika_controller_boot.hex:i -U lock:w:0x2f:m

Both commands are their own rows with no line breaks anywhere. If in doubt, type them yourself instead of copy-pasting. First one starts with "avrdude" and ends with "-U lock:w:0x2f:m". Second one also. The middle part is different because the first command programs the fuses, the second programs the code to the Atmega. NO return key / middle break in the middle of either command.

I hope this clears it up. Lars and Altitude909 tried to explain essentially the same thing (eg. there are only two separate commands, not four, and each one is written on its own single row), maybe third time's the charm!
messerschmitttwin
Brilliant, thanks, this is pretty new to me, so using the two commands all the fuses are now written and the main "ambika controller hex" but for some reason I get "can't open input file ambika_controller_boot.hex : no such file or directory
If i go to my C drive both
ambika_controller.hex
ambika_contoller_boot.hex
are both there so I'm puzzled
however the ambika board is now working so I'm really happy and thankful for everyone's help. Do I need the bootloader on the atmega644p?
messerschmitttwin
This is the command screen
flts
messerschmitttwin wrote:
Brilliant, thanks, this is pretty new to me, so using the two commands all the fuses are now written and the main "ambika controller hex" but for some reason I get "can't open input file ambika_controller_boot.hex : no such file or directory
If i go to my C drive both
ambika_controller.hex
ambika_contoller_boot.hex
are both there so I'm puzzled
however the ambika board is now working so I'm really happy and thankful for everyone's help. Do I need the bootloader on the atmega644p?


At least above you mention having "ambika_contoller_boot.hex" on your drive, it's missing the "r" (contRoller).
messerschmitttwin
Sorry thats me typing, it is ambika_controller_boot.hex on C drive
messerschmitttwin
just downloaded the hex files again and used

avrdude –c usbasp –p m644p –U flash:w:ambika_controller.hex
avrdude –c usbasp –p m644p –U flash:w:ambika_controller_boot.hex

ambika_controller.hex burns correctly but the boot one returns
ambika_controller_boot.hex auto detected as invalid format
limpmeat
Did you end up getting this sorted?

I'm having very similar issues with my build.
limpmeat
After some more fiddling today, I am at a loss with my Ambika. My issue seems similar to above, but in some ways worse. It is very slow to boot and the screen has sluggish response to knob parameter changes. Switches and LEDs don't work, and my encoder doesn't register left or right turns, only button presses. Navigation is stuck on the filter page.

Have tried:

Checking continuity between MCU and 165, 595s and also to encoder. All seems good.
Reflowed all the relevant joints.
Checked Resistor network orientation.
Replaced 74HC165, 74HC595s, xtal and caps.
Loaded firmware and set fuses again, seems to go smoothly with no issues.
All voice cards light up and seem to be receiving data from the MCU.

Not sure what to do now, any hints?
flts
I would think the symptoms hint that the fuses are incorrectly set or the xtal is a wrong one. It sounds that the root cause is that CPU is executing code at a much, much slower clock rate than intended - which would explain both the general slowness, and the fact that the MCU would miss reading the left/right pulses from the encoder.

Did you use the exact command specified on the Ambika DIY / firmware page to set the fuses - and if so, did it return an OK? And is the xtal the exact part on the BOM?
limpmeat
You were right.

I was using a graphical UI for AVRdude called Bitburner and it was doing something weird with the fuses.

All working now!
MUFF WIGGLER Forum Index -> Music Tech DIY  
Page 1 of 1
Powered by phpBB © phpBB Group