Questions Pages:
Questions:
I am wanting to read in a bit from port a0 (0 or 1) and store > that value in some temp register until i get a byte. My code below > does not seem to work: > > btfsc porta,0 > bsf temp,7 > delay > btfsc porta,0 > bsf temp,6 > delay > etc... to temp,0. > > however, when for example i read porta,0 and then set bit 2, and output > this to porta, bit2 is set high, as is bit1. bit1 is not suppose to > come on, but it keeps coming on. bit1 is connected to a led. I just > cant seem to figure out what is going on. I think it may have > something to do with the bsf or bcf as when i try to just output a > simple decimal value to porta, it comes out as it should and bit 1 is > right. It would be much appreciated if anyone has any ideas that may > help me. Thanks, Charlene
Hi I am having trouble geting the interrupts working for the PIC16f628. It seems to go to the interrupt once only. i tried checking the toie flag, as it should toggle between 1 and 0, but it does. Any ideas anyone??? Thanks, Charlene
Charlene,
From page 101 of the datasheet (rev DS40300C):
"When an interrupt is responded to, the GIE is cleared to disable any further interrupt". Therefore, when you have finished servicing your interrupt, you must set the GIE bit again. This may be the reason you only see the interrupt serviced once.
Comments: