/* Program : cro.c author : Ajith Kumar (ajith@iuac.res.in) License : GNU GPL version 3 or above On receiving a single byte command,reads ADC channel 0 500 times, with 100 usec timegap and returns a 'D' followed by 500 bytes of data. No error checking implemented. */ #include #define READBLOCK 1 // code for readblock is 1 #define NS 500 // Maximum 1800 for ATmega32, with 2K RAM #define TG 100 // 100 usec between samples uint8_t tmp8, dbuffer[NS]; uint16_t tmp16; int main (void) { // Initialize the RS232 communication link to the PC 38400, 8, 1, N UCSRB = (1 << RXEN) | (1 << TXEN); UBRRH = 0; UBRRL = 12; // At 8MHz clock (12 =>38400 baudrate) UCSRC = (1 <