o_0
Member level 3
I am trying to do a Proteus simulation of UART using ATmega32.
I'm using the sample code given here: winavr.scienceprog.com/example-avr-projects/running-tx433-and-rx433-rf-modules-with-avr-microcontrollers.html
My problem is the receiver micro seems to be dead, TXD remains low all the time even though something is coming into RXD. For input, I used the pattern generator, just had it count from 1 to 0x0F and back down, then alternate between 0 and 0x55 a few times.
The transmitter is transmitting, but I put a virtual terminal at the receiver input and it seems to be the same garbage all the time. As I said, nothing's coming out of the receiver.
I know it's probably the baudrate, because I get different garbage depending on the clock frequency. The sample code has the transmitter at 8 MHz and the receiver at 4 MHz, can someone please tell me why they are not the same? All I know is that for the ATmega32 the maximum recommended clock frequency is 16 MHz. I would like the baudrate to be 1200 but as far as the clock frequency I will use whatever works.
I even tried using itoa(); but it didn't help, and I didn't really expect it to because if the problem was the character display, at least I would be seeing different nonsense chars not just the same sequence repeated. I didn't test it very thoroughly though, so if someone thinks that's the problem I'll try that again.
I've attached all my files, as well as these pictures:
"regular settings.jpg" shows output when transmitter=8MHz, receiver=4MHz.
I've tried various frequencies and this is what I get for most of them.
"12mhz.jpg" shows that I get different garbage for both micros set to 12MHz.
Can someone please help me get this to work? Thanks in advance.
If it's that the baudrate/frequency is mismatched, please explain how to fix it because I have tried many different settings.
(The proteus is inside simulation.zip)
I'm using the sample code given here: winavr.scienceprog.com/example-avr-projects/running-tx433-and-rx433-rf-modules-with-avr-microcontrollers.html
My problem is the receiver micro seems to be dead, TXD remains low all the time even though something is coming into RXD. For input, I used the pattern generator, just had it count from 1 to 0x0F and back down, then alternate between 0 and 0x55 a few times.
The transmitter is transmitting, but I put a virtual terminal at the receiver input and it seems to be the same garbage all the time. As I said, nothing's coming out of the receiver.
I know it's probably the baudrate, because I get different garbage depending on the clock frequency. The sample code has the transmitter at 8 MHz and the receiver at 4 MHz, can someone please tell me why they are not the same? All I know is that for the ATmega32 the maximum recommended clock frequency is 16 MHz. I would like the baudrate to be 1200 but as far as the clock frequency I will use whatever works.
I even tried using itoa(); but it didn't help, and I didn't really expect it to because if the problem was the character display, at least I would be seeing different nonsense chars not just the same sequence repeated. I didn't test it very thoroughly though, so if someone thinks that's the problem I'll try that again.
I've attached all my files, as well as these pictures:
"regular settings.jpg" shows output when transmitter=8MHz, receiver=4MHz.
I've tried various frequencies and this is what I get for most of them.
"12mhz.jpg" shows that I get different garbage for both micros set to 12MHz.
Can someone please help me get this to work? Thanks in advance.
If it's that the baudrate/frequency is mismatched, please explain how to fix it because I have tried many different settings.
(The proteus is inside simulation.zip)