manojkl
Newbie level 5
i am using pic16f877a.i wrote a simple code as below.
getting a identifiers error for "CMCON"
![Screenshot (26).png Screenshot (26).png](https://www.edaboard.com/data/attachments/55/55377-7a9d662ff08a7777a4aed5063f68517b.jpg)
![Screenshot (26).png Screenshot (26).png](https://www.edaboard.com/data/attachments/55/55377-7a9d662ff08a7777a4aed5063f68517b.jpg)
.help pls![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
getting a identifiers error for "CMCON"
![Screenshot (26).png Screenshot (26).png](https://www.edaboard.com/data/attachments/55/55377-7a9d662ff08a7777a4aed5063f68517b.jpg)
![Screenshot (26).png Screenshot (26).png](https://www.edaboard.com/data/attachments/55/55377-7a9d662ff08a7777a4aed5063f68517b.jpg)
.help pls
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 unsigned int temp_res; void main() { ADCON1 = 8; CMCON=0x07; // Configure other AN pins as digital I/O TRISA = 0xFF; // PORTA is input TRISC = 0; // PORTC is output TRISB = 0; // PORTB is output do { temp_res = ADC_Read(2); // Get 10-bit results of AD conversion PORTB = temp_res; // Send lower 8 bits to PORTB PORTC = temp_res >> 8; // Send 2 most significant bits to RC1, RC0 } while(1);}
Last edited by a moderator: