![]() However those 8 bits are whatever you want them to be. What gets sent/received by a UART is generally 8 bits (plus the overhead its). While(ADCON0bits.GO=1) //wait for the conversion to end _delay_us(10) //Wait the acquisition time (about 10us).ĪDCON0bits.GO = 1 //start the conversion UART_Print("Hello world!\r\n") // UART print UART_Init(9600) // initialize UART module with 9600 baud OSCCON = 0x70 // set internal oscillator to 8MHz TXREG = data // update EUSART transmit data register While (TRMT = 0) // wait for transmit shift register to be empty Return RCREG // read from EUSART receive data register While (RCIF = 0) // wait for data receive Return RCIF // return RCIF bit (register PIR1, bit 5) RCSTA = 0x90 // serial port enabled, continues receive enabled TXSTA = 0x24 // transmit enabled, high speed mode TXSTA = 0x20 // transmit enabled, low speed mode " UART_Print("Hello world!\r\n", result) // UART print UART_Print(12345) // UART print result = (ADRESH 255) // low speed Hi all, now i'm learning adc module on 16f690, i have uart code, and can send text on pc software serial monitor Putty, UART_Print("Hello world!\r\n") but if I send some int value, or adc result without quotes ". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |