int R1, R2;
USART_Init(9600); //9600bps
R1 = ADC_Read(0)>>2; //Read CH0 (8-bit)
R2 = ADC_Read(2)>>2; //Read CH1 (8-bit)
USART_Write(R1); //Send reading1
delay_ms(1); //Wait for 1ms
USART_Write(R2); //Send reading2
//This would be the reading from ADC and sending to PC part.
//This would just send the readings, nothing else
//This code is for mikroC v8.2, I don't know about other versions
unsigned char R3;
if (USART_Data_Ready()){
R3 = USART_Read();
PORTD = R3;
}
//This would read from UART and show on PORTD.
//If you send binary 01010011, PORTD will be equal to binary 01010011 and so on
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
U | pic16f690 - LCD works in proteus but not on breadboard | Microcontrollers | 7 | |
Help with PIC16f690 and pin address -- CCS C compiler | Microcontrollers | 7 | ||
Help with PWM and servo with Pic16F690 | Microcontrollers | 13 | ||
C | Timer 2 PIC16F690 | Homework Help | 8 | |
Question Regarding Pic16F690. | Homework Help | 1 |