1

This is my first time posting to this forum and I hope you can help me out.

For my research project, I need to implement a Petri Net executioner in C to use all the subsystems of a micro controller. I have been using Atmel Studio 6.2 to simulate the results of my net.

I am running into a lot of problems with the UART system in particular.

void transmiteUART0(unsigned char data)
{
    //Wait until the Transmitter is ready
    while ( (UCSR0A & (1 << UDRE0))==0 );   
    //Get that data outta here!
    UDR0 = data;    
}

This is my function for the transmitting the UART system. But when I try assign the data to UDR0, it won't assign because the UDRE0 bit is still set in UCSR0A register and the simulator won't let me turn this bit off.

Any solutions? I apologize if this is a fairly basic questions but I tried all different types of solutions and emulated tutorials and I can't seem to figure out why it isn't working.

Ravi Raju
  • 11
  • 1

0 Answers0