You have to be using MPASM as the assembler.
The default PM assembler will not work.
<br>
You have to be using MPASM as the assembler.
The default PM assembler will not work.
<br>
DT
Darrel,
How about a little tutorial on how to tell which assembler is in use, and how to switch to the mpasm?
OK, how bout this for detection ...If you put that in your program, and try to assemble it with PM.exe, It will automatically pop-up a window in MicroCode Studio like this ...Code:ASM ifdef PM_USED "Dude, you have to use MPASM with DT_INTS" endif ENDASM
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2450&stc=1&d=120694493 9" />
Then you can just click on "Compile Using MPASM", and it will set the MPASM option and compile it.
If it still fails to compile, you should try this ...
http://www.picbasic.co.uk/forum/show...5&postcount=11
I should add that to DT_INTS-14.
hth,
<br>
DT
Hi DT,
I wanted to post a "thank you" (also as an informative post).
For the first time ever, I used your 18F routine (with RX_INT) about a minute ago.
I saved 3100 bytes!!!
Really very interesting for me.
Thanks a lot for your amazing work.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Hi sayzer,
2 years and 3 months since you joined.
What took you so long?
WOW! Saved 3100 bytes. That's pretty impressive.
Can I ask what the difference was? or maybe where the savings came from?
<br>
DT
You mean that comparing to On-Interrupt of PBP you did a reduction of 3100?
Ioannis
I have been playing with the code shown below on a 16f737 as I was trying to get different prescaler values into the int routinues. As part of the testing I stripped the code right back to just be a simple interrupt with a value loaded into the pre-load registrer, but I seem to end up with an interrupt time of 204uS. According to the Timer Calc in Mister E's PicMulti Calc I should get an interrupt every 5.019mS. (see attached image for capture of the output waveform - I love my PICkit 2!)
This code is lifted straight from Darells example with the blinky led (1-2-3 version), and all I have done is add the pre-load. I have also removed the pre-load and still get the same time for the interrupt.
There has got to be something really simple I am missing...Code:DEFINE OSC 20 rs_led var portb.7 ' rs232 led led var portc.4 ' was Data_Out line ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 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 TMR0_INT, _doBAM, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM OPTION_REG = OPTION_REG & $80 | 1 'Set TMR0 Prescaler to 256, leave RBPU alone TMR0 = 158 ' preload with 158 to give 21uS interrupts (at 1:1) ' this should then give Interrupt every 5.019mS at 1:256 @ INT_ENABLE TMR0_INT ; enable Timer 1 interrupts '~~~~~~~~~~~~~~~~~~ goto main ' jump over ISR '---[TMR0 - interrupt handler]-------------------------------------------------- doBAM: toggle rs_led @ INT_RETURN '~~~~~~~~~~~~~~~~~~~~~~~~~~~ high rs_led main: ''''''''''''''''''''''' ' do some flashing led stuff ''''''''''''''''''''''' high led pause 500 low led pause 500 goto main
bill.
Last edited by bcd; - 1st May 2008 at 10:19. Reason: Clarification of a few things
Use OPTION_REG = %11010111
And load the timer on every interrupt.
<br>
DT
Thanks,
See told you it would be something really simple I missed..
(Hey Darrel - how do you get your code blocks so colourful and properly indented ?)Code:doBAM: toggle rs_led TMR0 = 158 ' reload the pre-load @ INT_RETURN
bill.
http://www.picbasic.co.uk/forum/showthread.php?t=6221
The page may take awhile to load.....
Hello;
I'm Ryan form the Philippines I must admit DTS-14 ints rules!!! i'd like to know how can i turn the interrupt on and off for USART continues recepton I'm using PIC16f877a toggling register PIE.5 doesn't seem to work
Thanks
PS.
Part of my project i'm paying my tuition continue college again OSY for sometime now hehe (",)
Bookmarks