help on pic16f88 comparator

Thread Starter

gatoulisss

Joined Jan 23, 2015
69
hello i need help on programming a pic16f88 comparator
i have a programm running on pic16f628a using comparator and i want to upgrade now my hardware using pic16f88
the thing is that using same code as pic16f628a to pic16f88 the comparator doesnt seem to work
any help what might be wrong?
im using mikro c pro and pic kit 3

thank you!
 

Papabravo

Joined Feb 24, 2006
21,225
hello i need help on programming a pic16f88 comparator
i have a programm running on pic16f628a using comparator and i want to upgrade now my hardware using pic16f88
the thing is that using same code as pic16f628a to pic16f88 the comparator doesnt seem to work
any help what might be wrong?
im using mikro c pro and pic kit 3

thank you!
According to the respective datasheets, can you offer any evidence that it should work without modification?
  1. Start by comparing the register file address and BANKS
  2. Then compare the bits within the registers for their functions
  3. See if there are additional control bits that need to be dealt with in the 16f88
 

sagor

Joined Mar 10, 2019
909
The comparator in the 16F88 is programmable in the configuration word to use either RB0 or RB3. RB3 is the default in the 16F628a, and unless you change it, it should be the same for the 16F88. However, check that config word, as in the 628A, the high bits are undefined and may read as "1" (should be "0" but some readers may fill it in?). If CCPMX is mistakenly set to "1", then the comparator pin moves to RB0.
If the comparator uses interrupts, you are out of luck without re-compiling. The 16F628A uses register PIE1, the 16F88 uses register PIE2 to enable comparator interrupts.
There may be other subtle changes with registers.
 

Papabravo

Joined Feb 24, 2006
21,225
The comparator in the 16F88 is programmable in the configuration word to use either RB0 or RB3. RB3 is the default in the 16F628a, and unless you change it, it should be the same for the 16F88. However, check that config word, as in the 628A, the high bits are undefined and may read as "1" (should be "0" but some readers may fill it in?). If CCPMX is mistakenly set to "1", then the comparator pin moves to RB0.
If the comparator uses interrupts, you are out of luck without re-compiling. The 16F628A uses register PIE1, the 16F88 uses register PIE2 to enable comparator interrupts.
There may be other subtle changes with registers.
Thanks for rooting out those pesky details. (Putting on my Bill Maher hat) ) NEW RULES: Once a peripheral device is defined, it is locked in stone for all time. That should take care of the problem
 
Top