Ok. This one blinks immediately, it's 133 words smaller, and a lot faster than the last...
Edit: I don't see why your own version wouldn't work too, but you'll need to sort out the interrupt-on-release.
Ok. This one blinks immediately, it's 133 words smaller, and a lot faster than the last...
Edit: I don't see why your own version wouldn't work too, but you'll need to sort out the interrupt-on-release.
Last edited by Bruce; - 7th August 2010 at 21:54.
-wow Bruce, what can I say ....that nailed the puppy - my leds are positively zippy now (they light before I've even pressed the switch - and they know which switch I'm going to press...like I say you're good!)
Can't thank you enough - to paraphrase the woman in Poltergeist "This thread is cleeeeaaan"
....no more questions your honour.
Now, back to PCB layouts....wow, look at all the new space I now have!
Ok....experiencing a few diffs here.
Basically I need IOC interupts (which I'm basing on a simpler cut down noobesque version of excellent Bruce's provided code)...but I also need timer interupts.
My problem is that I get a boat load of errors when my program compiles when IOC & timer interupts are enabled together - what are the errors I hear you say? Well, I'm at work right now so can't cut/paste in what I'm seeing, but what I can say is that when I remove the timer interupt it compiles fine. Or when I remove the IOC interupt it compiles fine - only when both are enabled does it spew out heaps of errors during compilation.
I also know that my overall code is fine - previously I was using the INT pin for interupts ...I was able to get both INT & Timer interupts enabled & working in that setup. So I'm figuring here that maybe this latest way of handling the switches - IOC interupts - are using up a whole lot more PIC resource than the previous way I was doing this? Maybe the combinbation of IOC interupts, timer interupts, plus my coat are pushing things too far?
How to progress this?
Ok, I'm home now.....here are the compile errors...
Error[116] : Address label duplicated or different in second pass (_305AfterUserRoutine)
Error[116] : Address label duplicated or different in second pass (_305NoInt)
Error[116] : Address label duplicated or different in second pass (INT_EXIT)
Error[116] : Address label duplicated or different in second pass (_290OverCREATE)
Error[116] : Address label duplicated or different in second pass (L00001)
Error[116] : Address label duplicated or different in second pass (L00002)
Error[116] : Address label duplicated or different in second pass (L00003)
.....and so on.
Like I say I think it's to do with both interupt handlers being enabled?
Which prompts me, how should two interupt handlers be coded wrt 'returns'. Should it look like this (wrt IOC Interupts, I've stripped it back to basics & removed the disabling/enabling in the interupt handler here.... just for easiness on the eye)
Code:LED1 VAR PORTB.1 INCLUDE "DT_INTS-14.bas" ' Base Interrupt System INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler RABC_INT, _Switch_Interupt, PBP, no INT_Handler TMR1_INT, _ToggleLED1, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM T1CON = $31 ; Prescaler = 8, TMR1ON @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts @ INT_ENABLE RABC_INT Main: PAUSE 1 GOTO Main '---[TMR1 - interrupt handler]-------------------------------------------------- ToggleLED1: TOGGLE LED1 @ INT_RETURN '---[ioc Interupt Handler]------------------------------------------------------ Switch_Interupt: TOGGLE LED2 @ INT_RETURN
Many thanks.
Last edited by HankMcSpank; - 12th August 2010 at 18:52.
Is that the whole program?
The errors seem to indicate there's another INT_CREATE somewhere.
DT
************************************************** ***********************
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 " !!!
*****************************************
Thought about that, but it only affected DT_INTS-18.Do you remember those errors also appeared in MPLAB 8.30 ( ? ), when PBP 2.50 was released ???
He's using -14 here.
And as shown, it compiles without error here on a 16F690.
PBP2.60A
MPASM 5.36 from MPLAB 8.53, using MCS+.
DT
Bookmarks