Search found 6 matches

by rharmsen
13 Apr 2010 20:43
Forum: mikroC General
Topic: Pic 16f628a comparator intterupts
Replies: 10
Views: 5282

Re: Pic 16f628a comparator intterupts

Thanks for replying, The integer is value between (-32768 and 32767) so 17bit( i guess, not sure), but because I use the positive side only I could indeed use a 16 bit value, so I shouldn't need 4 bytes but 2 would be enough :p I tried removing the 'counter' variable from the code but in my interrup...
by rharmsen
08 Apr 2010 17:44
Forum: mikroC General
Topic: Pic 16f628a comparator intterupts
Replies: 10
Views: 5282

Re: Pic 16f628a comparator intterupts

This is my final working solution: int counter; char tekst[7]; int increased = 0; unsigned char y[4]; void interrupt(){ if(PIR1.CMIF){ // interrupt from comparators... if (CMCON.C2OUT == 1 && !increased) { counter++; // increase counter increased = 1; } if (CMCON.C2OUT == 0) { PIR1.CMIF = 0; // flag...
by rharmsen
31 Mar 2010 17:12
Forum: mikroC General
Topic: Pic 16f628a comparator intterupts
Replies: 10
Views: 5282

Re: Pic 16f628a comparator intterupts

NICE thanks man, that was indeed the problem.
by rharmsen
30 Mar 2010 23:24
Forum: mikroC General
Topic: Pic 16f628a comparator intterupts
Replies: 10
Views: 5282

Re: Pic 16f628a comparator intterupts

Thnks for relpying,

I tried it, it seems it does something more, but it **** up my LCD screen, it keeps blinking with random characters.
by rharmsen
30 Mar 2010 09:44
Forum: mikroC General
Topic: Pic 16f628a comparator intterupts
Replies: 10
Views: 5282

Re: Pic 16f628a comparator intterupts

Yes, the LCD works fine. But the 8 doesn't increase when I put my hand in the sensor. So my comparator doesn't create an interrupts (at least, that is what I am thinking).
by rharmsen
29 Mar 2010 19:21
Forum: mikroC General
Topic: Pic 16f628a comparator intterupts
Replies: 10
Views: 5282

Pic 16f628a comparator intterupts

Hello all, I am trying to program a 16f628a to count objects passing by an infrared-sensor. My sensor is working. Using the 2nd comparator in the 16f628a. If I use this code in a continues loop it shows OFF if I hold my hand in the sensor, and ON if I pull it out. if (CMCON.C2OUT == 1) { LCD_Out(1,5...

Go to advanced search