Last edited by skimask; - 21st March 2008 at 00:44.
Re-Read the replys the Clue to solve your mystery is "I.O.C."...
hopes this helps just a little
Hi xnihilo,
Don't get upset! We are only trying to help.
A lot of posts the user just wants the answer without learning the ways of Microchip and the PIC's. They learn how to solve that problem but not how to understand the datasheet.
Don't get me wrong, I have spent hours pulling out my hair and after posting the problem it turns out to be a simple mistake that I have made. We are all human.
The important part of the datasheet is this bit,
'For enabled interrupt-on-change pins, the values are
compared with the old value latched on the last read of
PORTA. The ‘mismatch’ outputs of the last read are
OR’d together to set the PORTA Change Interrupt Flag
bit (RAIF) in the INTCON register (Register 2-3).'
The following tip is the last I can give. The next step is to write the program for you!
Read the port before enabling the interupt!!!
Regards,
Bob
A little more help. remember if any pins change state the RAIF is set in the INTCON register, you must end any mismatch on the port first then reset the RAIF bit. Can't be much more clear than this
Mike
Come on! I know i sound stupid but i am not.
i DO read porta bits individually prior to enabling intcon, even if i maybe didn't mention it.
the int occurs anyway. when i outout the state of porta at the begining of interrupt routine 2 strange things can be noticed. it seems it is ra3 that triggers the interrupt. however i used the same program structure for another project and i didn'have such problem. even if the ra3 was left floating.
second thing: porta.5 value is not what it is supposed to be. with no wpu and set low with trisa, it is high when interrupt occurs. dammit.
the complete source code is at:
http://users.edpnet.be/charlesetchri...g/se210308.pbp
Hi,
I do hate war games ... ( except the film ...) BUT
Are you really sure of those lines ... ???Code:FOR i = 0 to 5 aport[i] = porta.0(i) 'mirror the pins states into the array NEXT i
Alain
PSHa,ha,ha ... YOU 're dead !!!Code:IF dead == 1 THEN finish 'if player is already dead, don't answer and leave the int routine
Re-PS
And overall sado-maso games ...Code:The PICs control transistors that drive relays for 9V supply to nichrome wires for the physical feedback. One cm of 38ga Nichrome wire, with 9V and a 6 ohms resistor is heated for 500ms, inducing a little burn that will leave a very tiny scar similar to cat's claw scratch.
WHAT A PITY !!!
Last edited by Acetronics2; - 21st March 2008 at 12:43. Reason: WHAT A PITY !!!
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks