YES!
It's a little tight for RAM and program space. But it should work.
DT
YES!
It's a little tight for RAM and program space. But it should work.
DT
DT
One note of interest, I kept hanging at the end of one of the interrupt modules, like it lost an address on the stack or something. I ran ICD and I saw the execution just hang on the ENDIF at the very bottom.
I have an RX interrupt that would write out to an I2C device 2 bytes received via USART. I removed the I2C command from within the interrupt and instead set a flag. Then I checked the flag from within the main logic and issued the I2C write and everything worked perfectly.
Darrel, here are some screenshots in case you see something obvious. Sorry, I didn't keep a copy of the code.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
2nd pic:
The program USB 18F2550 is for the master processor, that is not the one I am debugging. I am running the next program, MCP23016 16F628A.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Interrupts and the MCSP debugger, don't get along together very well.
You should use DISABLE DEBUG before any interrupt routines, Including the Handlers.
Then ENABLE DEBUG after them.
It is possible to save the debugger variables in the same way as ReEnterPBP, but it's a waste of space when not debugging, so I didn't include them
HTH,
DT
The weird part is that the interrupts and the debugger worked nicely as long as the I2C command was outside the interrupt routine.
I suppose there are probably exceptions, but disabling/enabling debug in and out of interrupts isn't the end of the world. It's not like we need to debug your work.
Robert
![]()
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
It's kind of like standing on the white line in the middle of a highway.
Everythings fine for a while, with cars wizzing past at 90mph.
But take one step to the left or right and, <img src=http://www.darreltaylor.com/files/splash.jpg height=70 width=70 align=top></img>
DT
With a 12F629 my app gets lots of "beyond ram_end" messages; with a 12F683, only two, so I might be able to pare it down to fit.Originally Posted by Darrel Taylor
If you don't have any complex math formula's in the program, you can reduce the number of T?_Save variables.
From ReEnterPBP.bas...
T1_Save VAR WORD
T2_Save VAR WORD
T3_Save VAR WORD
T4_Save VAR WORD
Start with T4. Comment it out and recompile. If no error, try T3, etc.
Then try ...
RS1_Save VAR BYTE
RS2_Save VAR BYTE
Might save a few bytes of RAM.
Just remember to un-comment them if you write a program for another chip.
DT
I am trying to use the instant interrupts to add the funnctionality of interrupts to my programs but I am having problems with the example that found on Darryl's site. I was trying to do the example with turning a LED on and off with an external interrupt but I am having some problems. I have downloaded the latest files form Darryl's site and have saved them to same folder. I have copied the code from hiw webpage also.
I am using PICBASIC Pro vers.2.46
I am using the PIC16F687.
I am getting the following errors
Error TOGGLE~1.ASM 490 : [224] local directive only for use in macros
Error TOGGLE~1.ASM 490 : [225] undefined symbol 'iflagreg'
Error TOGGLE~1.ASM 490 : [226] numeric constant or symbol name expected
Error TOGGLE~1.ASM 490 : [201] ')' expected
Error TOGGLE~1.ASM 490 : [300] too many errors
I commented out the Wsave's that were not needed. I have some experiece with writing programs in assembly and working with interrupts. I have looked through the include files to see if I could make sense of what is going on but I am having problems figuring it out.
Can you direct to anywhere that will give me more information about macros? Any suggestions? Thanks for your time and help.
Josh
EDIT
Looking at the datasheet for the 16F687 there IS an External interrupt on RA2 instead of RB0. There is a Port change interupt on both Port A and B. Do I have to modify the file to include the interrupt on PortA? I would want to place any available interrupt pin that I can.
Last edited by jblackann; - 31st July 2006 at 17:31.
There's no math but it didn't help. I think I'll have to try to learn enough ASM for this application. I just need TMR0 to toggle a pin every 8-10mS and TMR1 to give me a 500µS or 1000µS interval after each TMR0 rollover.Originally Posted by Darrel Taylor
Hi Josh,
The INT_INT should work ok, even with it on PORTA.
For the Interrupt on change with PORTA and PORTB, just add these two lines in the ASM section right before the INT_LIST
RBIF = RABIF
RBIE = RABIE
(no space at the beginning of the line)
Then use RBC_INT. I'll add RABC_INT, C1_INT and C2_INT names in DT_INTS-14 later, but that should get you going for now.
HTH,
Darrel
dhouston,
For the 12F683...
Did you comment out the wsave2 and wsave3 variables in DT_INTS-14?
DT
Not until seeing your question. That seems to do it. It compiles and only uses 593 words so I think it will be OK, now.Originally Posted by Darrel Taylor
Will the pin change functions work with the 12F683?
Last edited by dhouston; - 1st August 2006 at 17:16.
Bookmarks