Log in

View Full Version : Darrel Taylor's Interrupt Stuff & CDLite



picster
- 9th March 2006, 16:54
I'd like to use Darrel Taylor's interrupt handlers to allow me to write service routines in PBP, but I've been using CDLite until now. MPLAB looks a little daunting in comparison - do I NEED to use it to get this new approach to work, or can I somehow keep using CDLITE and just use the MPLAB assembler with it?

Oh, and I'm running on WIN98SE.

Thanks,

--------------Picster----------

Darrel Taylor
- 10th March 2006, 01:31
Hi picster,

It just needs to be compiled with MPASM. You don't need to use MPLAB.

But you might consider dumping CDlite for MicroCode Studio. Not needed for the interrupt routines, just a better program.
<br>

picster
- 10th March 2006, 13:28
It just needs to be compiled with MPASM. You don't need to use MPLAB.

But you might consider dumping CDlite for MicroCode Studio. Not needed for the interrupt routines, just a better program.
<br>

Hi Darrel, and Kudos to you for the work...

Will MicroCode Studio run these interrupt routines "out of the box", or will I need to do some configuring/jockeying?

Thanks

picster
- 10th March 2006, 14:36
Darrel,

Unfortunately, I could still use a little help here...

I regurgitated your little LED program in MicroCode Studio, and here's what I receive in errors:

--------------------------------------------------

'Interrupt test - PIC16F88

LED1 VAR PORTB.1
INCLUDE "DTINTS.BAS" 'base interrupt system (renamed only, not edited)
INCLUDE "REPBP.BAS" 'include if using PBP interrupts (as above)

Asm
INT_LIST macro ;IntSource, Label, Type, Resetflag?
INT_Handler INT_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ;creates the interrupt processor

INT_ENABLE INT_INT ;enable external (INT) interrupts
EndAsm

Main:

Pause 1
GoTo main

'----------[INT - interrupt handler]----------------
ToggleLED1:
Toggle LED1
@ INT_RETURN


------------------------------------------

Errors are as follows:

Error[113] g:\pbp\inttst.asm 115 : Symbol not previously defined (PIR2)
Warning[207] g:\pbp\inttst.asm 288 : Found label after column 1. (L?GoTo)
Error[122] g:\pbp\inttst.asm 288 : Illegal opcode (_SavePBP)
Warning[207] g:\pbp\inttst.asm 297 : Found label after column 1. (L?GoTo)
Error[122] g:\pbp\inttst.asm 297 : Illegal opcode (_ToggleLED1)
Warning[207] g:\pbp\inttst.asm 241 : Found label after column 1. (L?GoTo)
Error[122] g:\pbp\inttst.asm 241 : Illegal opcode (_RestorePBP)
(is there an easy way to copy this error list to clipboard? It seems to get lost every time I try, so I had to retype it manually here)

Attached is the inttst.asm file renamed to .txt

Darrel Taylor
- 10th March 2006, 20:19
Will MicroCode Studio run these interrupt routines "out of the box",

It should. It's been awhile since I installed MCS, but I remember it being pretty easy. Just select "use MPASM" in the View|Compile and Program options|Assembler dialog. Of course MPASM has to be installed already.

And for the program, the post says it's for a 16F88, but the ASM file shows it was compiled for a 16F84. Could be part of the problem.
<br>

picster
- 11th March 2006, 01:22
Thanks Darrel, you were right about the chip... the '84A doesn't have the PIR2 register, so it was undefined - this led to two of the errors.

I also found that in the DT_INTS-14.BAS file, I had to change the instances of "L?GoTo" to "LGoTo" to get rid of the other errors.

Now I can't wait to be interrupted!

Thanks again.

------------------Picster-------------------

Darrel Taylor
- 11th March 2006, 02:26
picster,

When I compile your code from Post #4 for a 16F88, I don't get any errors. (except for the file names)

And, the L?GOTO's are there for a reason, and will not work if changed to LGoTo.

Since we know that you've edited the files, I would suggest downloading them again, without renaming or editing.
<br>

picster
- 11th March 2006, 13:43
Darrel,

I just reproduced what you got. For some unknown reason, I wasn't getting that before, and I have NO clue why. I suspect I was messing something up in the MCS (not having the right window selected, or the right PIC selected, or something equally daft).

All is "back the way it was" and it seems to compile fine now. Anyway, thanks for sorting this out with me, much appreciated.

----------------------Picster---------------------