--- trunk/PIC/Demo trimmet/barcode.c 2007/05/28 10:13:48 109 +++ trunk/PIC/Demo trimmet/barcode.c 2007/05/28 15:00:55 111 @@ -28,13 +28,16 @@ // Set Port C bit 6 output (TxD) and bit 7 input (RxD) TRISC6 = 0; TRISC7 = 1; - +/* SPBRG = 25; // x = Fosc/(16 * Baud Rate) - 1 // x = 4000000/(16 * 9600) - 1 // x = 25.0417 ~ 25 // Baud Rate = Fosc/(16 * (x+1)) // Baud Rate = 4000000/(16 * (25+1)) // Baud Rate = 9615 + */ + + SPBRG = 130; //BRG værdi for 20Mhz MCU TXSTA = 0x24; // TXSTA7 = 0 Don't care in asynchronous // TXSTA6 = 0 8-bit transmission // TXSTA5 = 1 Transmit enabled @@ -106,13 +109,9 @@ { barcode_ready = 1; } - else + else { global_barcode_buffer[barcode_length++] = RCREG; } } - - - - }