It shouldn't affect portE which is where 2 of my relay pins are. I will try it anyway and let you know. Thanks for the suggestion!
Nick
It shouldn't affect portE which is where 2 of my relay pins are. I will try it anyway and let you know. Thanks for the suggestion!
Nick
I went through and disabled everything and then some on portA and PortE. No dice. portA and PortE change from low to high but does not toggle. In fact it undoes any set pins on portA and E. It does not alter them at the bit level individually. My desired function is to latch individual pins in either 1 or 0 condition to energize a relay or de-energize it, through the decoding of local switch presses. I need to take a step back or something....thanks for your help guys.
Nick
The micro is on a circuit board. It uses a 20Mhz resonator and I am using in-circuit-programming. All ports are on header pins and not tied to anything, except for the button switches which are pulled low via 10k resistors. I have physical jumpers to put the hardware into ICP mode and then back to normal mode. I can set ports when the interrupt routine is called on any button press, but it does not decode the content of the variable I place the key press in to. IE, it blasts through conditional statements.
I can set bit wise port A and Port E within the interrupt. If within the interrupt I set portA (your bit of choice) and then use a conditional statement to reset portA (your chosen bit) if the bit is set...it does nothing....the port bit stays set. Toggle does nothing to alter the port logic level output.
Very strange.
Last edited by Macgman2000; - 3rd May 2009 at 20:21. Reason: toggle issue
OK i have had an eintesy bit of success with your code.
To your config statement add _DEBIG_ON and ADD TRISB = %00000001 so the B.0 interrupt will work. I am not saying this will fix it, but it needs those fixes, gotta run, Gotta Barbeque.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Ok for my own sanity, I would like confirmation on my understanding of how RB0 interrupt works or any interrupt for that matter. Once an interrupt condition happens, the interrupt flag is set, then the code is vectored to the interrupt start location.
In my code, I do the customary saving status, pclath..etc. Then I run my code, then repack status and pclath.
Retfie statement at the end of the interrupt clears the interrupt flag so now it is enabled to recieve interrupts. So during the time I am running my code in the interrupt, it shouldn't be retriggering the interrupt based on switch bounce until it sees Retfie....or does it? Somewhere, somehow the contents of the variable that I am passing to the case statements is getting hosed (I assume). The variable is specfied as bank0 System, so content must be common across banks.....or is it?
Lots of questions, I guess I am second guessing everything now.
Nick
Bookmarks