-1

I have a board which there is an LCD on it and I want to show some lines in the LCD. I have a broken-pin Atmega32 which the broken pins didn't used for LCD, I have written a simple code which just shows on and off a text in LCD.

Since my Atmega32 is broken and the broken pins are needed for another part of circuit I had to buy a new Atmega32 but all I found is Atmega32A.

Since technically Atmega32A can be used instead of ordinary Atmega32, I have compiled and burnt the same code that I have written for Atmega32 into the newly bought Atmega32A. But the LCD does not work anymore and also I had a sample code which rotates a step-motor clockwise and counter-clockwise each with 1000ms delay. But it took almost 5000ms in Atmega32A in order to change the rotation direction.

I don't really know what is going on!!!

Can anybody help me on this?

here is a question about the same problem that I have but the accepted answer does not contain any useful detail on how to solve the problem(or atleast I don't get it!!).

More details

The LCD display on an ordinary Atmega32 Above picture is the the LCD display on an ordinary Atmega32. The LCD display with same code on an Atmega32A(no output) Above picture is the LCD display with same code on an Atmega32A(no output)

The codes to compile and burn the codes:

#!/bin/bash
avr-gcc -mmcu=atmega32 lcd-sample-main.c -o .makefiles/lcd-sample-main  -O1 && \
avr-objcopy -O ihex .makefiles/lcd-sample-main .makefiles/lcd-sample-main.hex && \
sudo avrdude -c usbasp -p m32 -U flash:w:.makefiles/lcd-sample-main.hex
dariush
  • 121
  • 4

1 Answers1

2

The problem was with the fuse bits setting in the new '32A controller.
Thanks to Ignacio for giving the idea, I read the current fuse bytes from the '32 and then wrote them to the '32A and everything is working now.

To reading the fuse bits:

sudo avrdude -c usbasp -p m32 -U lfuse:r:-:h -U hfuse:r:-:h

And for writing them(These are the values that i have read from the '32 fro lfuse and hfuse)

sudo avrdude -c usbasp -p m32 -U lfuse:w:0xf4:m -U hfuse:w:0xdf:m

Done!

dariush
  • 121
  • 4