USART_Init(9600); // baud rate 9600kbps
delay_ms(20); // relax
Usart_Write(ADRESH); //send result [15:8]
Usart_Write(ADRESL); // [7:0]
//pls replace ADRESH and ADRESL with MSB and LSB of temp_res respectively...
There is an error here,can't be compiled. Should I do any changes on the USART Terminal or connect it to a serial port?after TRISB = 0, put
Rich (BB code):USART_Init(9600); // baud rate 9600kbps
I'm using MicroC Pro to program. Anyway,I will try out.What version of MikroC compiler you use?
Rich (BB code):Usart_Write(ADRESH); //send result [15:8] Usart_Write(ADRESL); // [7:0] //pls replace ADRESH and ADRESL with MSB and LSB of temp_res respectively...
This is the way to send data out from PIC using UART. ADRESH and ADRESL are two registers that hold digital value of ADC conversion. So, this code will send 8-bit of ADRESH through UART followed by ADRESL..your PC will receive 2 bytes of data..I don't understand the coding here. Mind to explain?
Thanks so much. I hope this can be solved asap as I'm running out of time to submission date for project.
| Thread starter | Similar threads | Forum | Replies | Date |
|---|---|---|---|---|
|
|
best error detection of serial data | General Electronics Chat | 55 | |
|
|
Question about serial comms between a pic and a pc using a max232 | Microcontrollers | 11 | |
| L | serial comms on RPI GPIO pins | Microcontrollers | 5 | |
| R | Serial comms problem | General Electronics Chat | 2 | |
| S | PIC16F88 Serial COMMs | Microcontrollers | 6 |