sayzer i tried to run your but it didn't do anything, i don't know why. and i need a comparison in my code can you add too?
I already DID just that. The code in my previous message IS edited so it should work the way I think you want.yah HenrikOlsson help me on that edit where necessary so that it can work as i want, iam a begginer in the pics progrmming, thanx indvance
The code and the circuit in my post works with no problem in simulation.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
thanx for your suggestion. on stimulation if the input voltage equal to vref else statement always and if the input voltage is higher than or less than Vref else statement is executed too. it seems the "if statement" is not functioning, have you any solution on that case, i have no way to go forward , help me please
I'm pretty sure that the IF statement executes as it should. The problem is likely that the C1Out doesn't actually toggle.
According to your schematic in the first post you have one input to RA0 and the other to RA2. As far as I can see in the datasheet, section 12.1, the inputs to comparator 1 is RA0 and RA3.
/Henrik.
Thanx alot henrikolsson and sayzer for all of your suggestions, the problem was in configuration of cmcon, now it work as i want, thanx in advance
How can it work when the two inputs, according to your schematic, are wired to two different comparators? What did you change CMCON to to make it work?
Bookmarks