On Tue, 19 Mar 2013 09:08:26 -0700 (PDT), you wrote: >I am trying to transfer 256 bytes of at data 1M baud rate from my PC to an= Atmega328 microcontroller. I am using checksum to verify the integrity of = the data and I am emptying the received data into a ring buffer as quickly = as possible. This is all I have in my interrupt subroutine: >temp =3D UDR0; >BufferWrite(&rx_buffer,&temp);=20 >The data is transferred properly only at speeds upto 250K baud rate. It re= sults in error beyond that point. The Atmega 328 datasheet specifies that i= t possible to transfer at speeds upto 2M baud rate. The ring buffer size is= about 400 bytes and I am looking for some suggestions to achieve higher ba= ud rates while maintaining the data integrity. >Sai The ATMEGAs can do these rates but you need to look carefully at the assem= bler that your compiler is generating for the ISR code to check timings are adequate - add an IO po= rt set/reset around your ISR code to check how long it's taking on a scope.=20 You also need the data to be clean- certainly not via an RS232 driver - nee= ds to be 5V TTL UART (e.g. from USB-serial chip located nearby) or RS422/485does the waveform lo= ok OK on the scope? If transfer is on the edge, adding an extra stop bit can help, but you need= to have an understanding of exactly what is happenning and why it is failing. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .