Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

usart problem with ATmega128

Status
Not open for further replies.

banner

Member level 1
Member level 1
Joined
Oct 6, 2009
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
iran
Activity points
1,529
Hi there,
I am using USART on atmega128 with BR 9600 and buffersize 64. I use RX isr and there is a 10ms wait in this isr.when i send data of 10 byte and resend it from micro to pc..it can be seen that there is a loss always in certain position. for e.g. by sending 0 1 2 3 4 5 6 7 8, I receive 0 1 2 3 4 5 7...
that makes me mad...pls help...tnx
 

Hi,

and there is a 10ms wait in this isr.

If this is a busy wait without the possibility to receive new UART data, then it is quite obvious.
Sending a single byte with 9600 baut will need 10s/9600 = 1.04ms.
Why is it waiting? Within the OSR it makes no sense.

Ther should be another function to read received data from the buffer. Here a 10ms timeout in case of empty buffer may makes sense - as long as it is interruptable by the receive_ISR.

Show us the code. Is it self made?

klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top