[PIC]: Interrupt bitsmaybe you meant to try or'ing (|) instead of = adding. although i thnk it would be the same result.. worth a shot.. andrew ----- Original Message -----=20 From: Dave Gomez=20 To: PICLIST@MITVMA.MIT.EDU=20 Sent: Thursday, September 05, 2002 3:33 AM Subject: [PIC]: Interrupt bits Ok, I'm a newbie, and I'm stumped. I started with an rs232 program I picked up from on the net, and got = it to work, yea!! But the code was written with it's own header file, and the layout was = somewhat non-standard, etc etc. So wanting to learn from the code, I = re-wrote it to use the standard 16f84a header, and expanded commands = etc. All seemed to work well, and aside from a couple of typo's, I got = it all to match hex dump for hexdump except one string (I tell you, the = lst outputs in MPLAB helped a bunch for that one). I was even able to = overcome that one by just overriding the normal addition of the bits, = and shoving the hex value instead that it expected, and by the way makes = the thing work (it just sits there stupidly otherwise ;^) ). Wanting to = get to the bottom of the issue 'cuz it was buggin' the heck out of me, I = have found out this hopefully relevant information. The string in question was associated with the commands(output of = .lst): 0056 3010 00160 movlw GIE+T0IE+INTE = ; enable interrupts 0057 008B 00161 movwf INTCON Or moving the requested bits into the INTCON register. In the original code it's more like: 0056 30B0 00160 movlw GIE+TOIE+INTE = ; enable interrupts 0057 008B 00161 movwf INTCON Which gives me 30B0 instead of 3010 for an instruction. Even though it looks the same, it's not, because of the personal = header that was used, and it had it's own definitions of the INTCON bits = which are: RBIF equ h'01' INTF equ h'02' TOIF equ h'04' RBIE equ h'08' INTE equ h'10' TOIE equ h'20' PEIE equ h'40' GIE equ h'80' While the excerpt from the standard include file is this: ;----- INTCON Bits -------------------------- GIE EQU H'0007' EEIE EQU H'0006' T0IE EQU H'0005' INTE EQU H'0004' RBIE EQU H'0003' T0IF EQU H'0002' INTF EQU H'0001' RBIF EQU H'0000' Oh, and I have tried every conceivable moshing of the different bits = to see if I can replicate the 30B0 hex output, but from what I see, I = ain't never gonna get there, as the number is just way too big when you = add up all of the bits. Can anyone give me some insight as to what the = heck is going on here? Any help greatly appreciated. Thanks, Dave Gomez -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics