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:
file: /Techref/member/CE-student-586/index.htm, 2KB, , updated: 2003/10/6 11:49, local time: 2024/11/22 00:06,
owner: CE-student-586,
3.14.132.43:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.ecomorder.com/techref/member/CE-student-586/index.htm"> Member Homepage for CE-student-586</A> |
Did you find what you needed? From: "http://ecomorder.com/member/CE-student-586/index.htm" |