Bug in nrf_USB2Serial.c ?

http://www.sparkfun.com/datasheets/Wire … B2Serial.c

In nRF_USB2Serial.c, line 75 (in the USART ISR), the input byte counter is set to zero when 416 bytes are received. But in the main event loop (main(), line 175) a 512 byte buffer is assumed. So, I think 96 bytes of garbage (or maybe all zeros) are sent after every 416 good bytes of data?

That seems to align with what I see when I send large blocks of data. I see what I expect for 416 bytes, a pause where nothing happens, then the results I expect to see for the remaining bytes.

So, I was going to reprogram to see if that fixes the problem. But, 416 is a number that seems like it might have been picked for a reason? Maybe a 512 SRAM part needed those extra bytes for the stack? And someone forgot to change the 512 to 416 in main() also?

Finally, the board actually has an ATMega328p, not an ATmega168. So, just change MCU=atmega168 to MCU = atmega328p in Makefile and truck right along?

Thanks,

Dave Thomas

Changing line 174 of nrf_USB2Serial.c

to

if(RX_read >= 416) RX_read = 0;

Solved the problem. So, I think it is a bug.

Dave Thomas