For those interested on why the RA4 interrupt wouldn't work, the interrupt on RA4 was dedicated to TMR0 and not the comparators. B7, a spare pin in the design, is going to be sub'd for RA4.
Excellent! Let us know!ok i just compiled it, and will be having a beer and trying the revised code.i have a feeling this might work.
well i reflashed the 88 used port B7 instead of A4 addes a 4.7k pulldown resistor, and it WORKS as intended. SO FAR. i am going to do some further testing before i call it a success. Im gonna have another beer and work on this some more. ill call it a final sucess after im done .Excellent! Let us know!
EXCELLENT news! Let us know when "success" means "SUCCESS"! Thanks for the continued updates.well i reflashed the 88 used port B7 instead of A4 addes a 4.7k pulldown resistor, and it WORKS as intended. SO FAR. i am going to do some further testing before i call it a success. Im gonna have another beer and work on this some more. ill call it a final sucess after im done .
Unfortunatly its not a complete sucess. It works better, BUT it still isnt rock solid, sometimes when i boot the ckt, it will not change modes, as indicated on a LCD screen. What ive noticed after testing is If i let it sit for 5-10 sec between applying pwr is it works. if i remove power and then reapply pwr to the ckt it does not work. Im wondering if my power supply mainly the capacitors used as filters is still powering the ckt after 12v is removes for a few sec as they discharge and causing it to hang up when power is reapplied quickly. Tell me what you all think here. Im learning allot!EXCELLENT news! Let us know when "success" means "SUCCESS"! Thanks for the continued updates.
What you just said is accurate. For a few seconds after power is removed, the PIC still runs.Unfortunatly its not a complete sucess. It works better, BUT it still isnt rock solid, sometimes when i boot the ckt, it will not change modes, as indicated on a LCD screen. What ive noticed after testing is If i let it sit for 5-10 sec between applying pwr is it works. if i remove power and then reapply pwr to the ckt it does not work. Im wondering if my power supply mainly the capacitors used as filters is still powering the ckt after 12v is removes for a few sec as they discharge and causing it to hang up when power is reapplied quickly. Tell me what you all think here. Im learning allot!
ok this makes sense then.What you just said is accurate. For a few seconds after power is removed, the PIC still runs.
Obvious things to check:
-Check that the interrupt routine checks which button is being pressed
-Check that the TRISB.B7 bit is SET "1"
-Check that a 16-bit timer isn't throwing random interrupts upon overflow (which is tied to RB7, as we talked about)
I'd be happy to look at your edits if you want. I'm done for tonight, though. It's 3 am my time.
I recall your code constantly using PORTB for LCD operations. I am concerned that the TRISB.B7 bit is being written, or something along those lines. If you re-send the code, I can check out the mods you made.ok this makes sense then.
In flowcode i set port b7 as a input Single bit, not masking or entire port.. it is definatly reading the pin. just not all the time.
I do not have the 16bit timer enabled i dont think i should need that timer active to poll the status of that pin +5V logic 1 or 0 v logic zero. depending on the state of the pin it throws it into varible and then makes a decision on if it should enter this mode or the other mode.
I dunno if this helps.
I understand, but what i dont get now that its on portB7 is that on a cold boot it works, if i disconnect power and then reapply within a few seconds it no longer works. If i wait 5-10 sec between boots, it works fine again.I recall your code constantly using PORTB for LCD operations. I am concerned that the TRISB.B7 bit is being written, or something along those lines. If you re-send the code, I can check out the mods you made.
Timer1 shouldn't need to be enabled, but the interrupt that is attached to RB7 that triggers the timer1if (the interrupt flag for timer1) does need enabled, but you probably knew that/did that already.
Well, did some more testing today, It seems that if its a cold boot the thing works, If power is reapplied quickly it does not work. If i let it chill for about 5 sec it then works again. im thinking it could be the caps, How could i discharge them quickly once the power is removed? i want to try this to see if it solves the problem.I understand, but what i dont get now that its on portB7 is that on a cold boot it works, if i disconnect power and then reapply within a few seconds it no longer works. If i wait 5-10 sec between boots, it works fine again.
When you come back on paul ill send you updated code.
It might solve the problem, but it's bandaid-ish.Well, did some more testing today, It seems that if its a cold boot the thing works, If power is reapplied quickly it does not work. If i let it chill for about 5 sec it then works again. im thinking it could be the caps, How could i discharge them quickly once the power is removed? i want to try this to see if it solves the problem.
by Aaron Carman
by Duane Benson
by Jake Hertz