PIC16F690 portB change interrupt???

Status
Not open for further replies.
Resolved PIC16F690 port B "IOC"

Just thought I'd let you all know the solution. It was the I/O. It turns out on port B you must clear ANSELH which is in Bank2 address 1F. I can now see the internal pullup on the pin and my push button switch will pull it down. Everything works now!
 
You should use labels instead of the actual address.
example

Code:
bcf  0x1, 0x7         ; vague tough to read, may not be the same on all PICs
bcf  OPTION_REG, RBPU ; more readable
 
mr.gone said:
Just thought I'd let you all know the solution. It was the I/O. It turns out on port B you must clear ANSELH which is in Bank2 address 1F. I can now see the internal pullup on the pin and my push button switch will pull it down. Everything works now!

If you had posted your souce code someone would have spotted that 3 days ago and saved you a lot of time.

Mike
 
William At MyBlueRoom said:
You should use labels instead of the actual address.
example

Code:
bcf  0x1, 0x7         ; vague tough to read, may not be the same on all PICs
bcf  OPTION_REG, RBPU ; more readable

It's not that ne's not using labels (presumably?), it's that he's not posting the SOURCE code - he's only posting the MPLAB disassembly of the HEX file.

I asked him to post it twice, but he completely ignored me?. As Pommie says, if he'd posted properly he would have got an answer quickly - as it was, I couldn't be bothered, and probably no one else could either?.
 


I only lost part of a day. Do all of you work over the weekend? Anyway I very much dislike that style of disassembly because it doesn't show the actual addresses or bits used. That's why I put the "source" code information in the comments and leave the mnemonics as is. I find it to be very clear and you get the best of both worlds.
 
Last edited:

No, you get a confusing mess that people don't bother reading!!.
 
You're supposed to use the mnemonics not the addresses. Generally nobody memorises or generally cares what the address is for the SFRs. It's good advice and programming practice.
You're not MSTECHA are you? Lets see he leaves you appear hmmm... Na he wasn't a programmer... or was he?

PS me thinks that ugly mess is his source code! Its got comments with line numbering and machine code turned on. He will rule at reverse assembly if he can read that and remember what it's supposed to do.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…