Well, Just moving
HSERIN [Y]
HSEROUT[Y]
into the ISR solved the HSERIN as mentioned.
Despite getting it working on my equipment, we still don't know why it isn't working for Charles. I'd like to know why the difference.
Steve
Well, Just moving
HSERIN [Y]
HSEROUT[Y]
into the ISR solved the HSERIN as mentioned.
Despite getting it working on my equipment, we still don't know why it isn't working for Charles. I'd like to know why the difference.
Steve
well let's see it in the simplest way... an Interrupt flag have been set, it jump to the ISR but he's not clear before going out... what happen? it return back to the ISR as soon as possible.
As it's just a single character.. HSERIN can be changed to
or few lines of assembler...Code:x=RCREG While RCREG : Discard=RCREG : Wend
OUF, at least i wasn't too far.. that's good for my own self esteem![]()
Last edited by mister_e; - 10th July 2006 at 03:20.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I can deal with the requirement to read the RCREG from within the ISR, but having to shut off the interrupts while running HSEROUT is more problematic. I have to run full-duplex in my application. That is why I needed it interrupt-driven in the first place!
Charles Linquist
SteveB:
Confirming - I took your code and loaded it into my 8720. It works as expected, except that it doesn't handle USART interrupts (as you mentioned). I'm thinking that your routine works better because you saved/restored BSR, while I was was saving/restoring FSR0L and FSR0H.
I have an email to MELABS. Maybe they can shed some light on this.
When we are done, I think we will have a good framework for how to deal with interrupts in the 18F series!
Charles Linquist
PROBLEM SOLVED!
I have been conversing with Tim Box. Although he no longer writes in PBP, he had some great insights.
I'll be able to write a short tutorial on using interrupts with 18F parts and PBP tonight.
Many thanks to all who contributed!
Charles Linquist
...I'm using interrupts with the 18Fxxxx and...
the WSAVE...etc-part in front of a interrupt-handler is ONLY neccessary for PICs with up to 2048 words ? (PIC16F872). Bigger PICs don't need the code in the beginning, it is placed by PBP. The restore-code before the retfie is only used for PICs <PIC18, because they know the "retfie 1"-solution to restore all this silly registers, saved by an interrupt... (PBP doesn't support high/low-priority-Ints, so no other interrupt is used!)
But don't try to use PBP inside a interrupt-service-routine !
PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2
Once all PBP variable saved.. you can use PBP statement inside the ISR
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=960&stc=1&d=1152565276 ">
18Fs are different right, but how... i can't say, as now the regular method work for my requirement... as now. So i guess i should look deeper in that one in case i need something like this.
In this case, there's no big stuff to do in the ISR... so, my question is... is this longer to do only a pure assembler routine... or messing 'round with the known 'once the PBP variables are saved...' stuff. mmm
I miss something in that one anyways... i'll go deeper on my side too. Maybe i could help.
Last edited by mister_e; - 10th July 2006 at 22:07.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks