![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I have recently switched my comparator on my PIC16f628 over from using an external reference voltage to the internal one. THe problem is the state of the comparator doesnt change anymore. Here is some pseudocode of a test program: CMCON = %00000100 'set up internal comparator VRCON = %10100010 'set up voltage reference module TRISA = %11111100 'set all porta as input TRISB = %11110000 'set portb start: High PORTA.6 While CMCON.0 = 1 Low PORTA.6 Wend Goto start I have checked the value of my reference voltage and it falls between the high and low values. Its just meant to switch the light on and off as the comparator changes, but the light remains on. Can someone help. Thanks
__________________ The first rule of mstechca club is do not talk about mstechca club. http://www.electro-tech-online.com/s...induser&u=1245 | |
| |
| | (permalink) |
| The CMCON setting you currently use doesn't connect the reference output to a comparator input... you might want to take a look at the comparator IO operating modes in the datasheet again | |
| |
| | (permalink) |
| Yeah cheers Im an idiot and I know it
__________________ The first rule of mstechca club is do not talk about mstechca club. http://www.electro-tech-online.com/s...induser&u=1245 | |
| |