PDA

View Full Version : Hserin and Timer0



Pesticida
- 3rd February 2008, 18:35
Hi,

I have a question,I use Timer0 to Refresh my Real Time all is ok all work fine but my problem is when I use this:

On Interrupt goto IntHandler ''''''''''''''''''''''''''''''''''''''''''''''''In terrupt Routine
LoopHauptMenu:

HSerin 10000,Main_RFID,[Menupunkt]

.......
.......
Disable
IntHandler:
IF TMR0IF then Timer
Resume
Timer:
TMR0IF = 0 '''''''''''''''''''''''''''''''''''''''''''''Clear Timer 0 Interrupt
TMR0H = $3C
TMR0L = $AF
Gosub ReadTime
Gosub Read_BCD
Lcdout $fe,$80," RFID Leser "
Lcdout $fe,$C0," ",DEC2 Stunde[0],":",DEC2 Minute[0],":",DEC2 Sekunde[0]," "
Resume
Enable
Every 10 Seconds my Time is Refreshing!

And when I use this :

On Interrupt goto IntHandler ''''''''''''''''''''''''''''''''''''''''''''''''In terrupt Routine
LoopHauptMenu:

HSerin 1000,LoopHauptMenu,[Menupunkt]

.......
.......
Disable
IntHandler:
IF TMR0IF then Timer
Resume
Timer:
TMR0IF = 0 '''''''''''''''''''''''''''''''''''''''''''''Clear Timer 0 Interrupt
TMR0H = $3C
TMR0L = $AF
Gosub ReadTime
Gosub Read_BCD
Lcdout $fe,$80," RFID Leser "
Lcdout $fe,$C0," ",DEC2 Stunde[0],":",DEC2 Minute[0],":",DEC2 Sekunde[0]," "
Resume

All is ok is refreshing every seconds why is this so?!

Thank you for any answer.

Regards Pesti

Pesticida
- 3rd February 2008, 19:17
Ok

I found on the PBP book the Answer ,but not the solution.

Where Can I found a good Assembler Interrupt example ?

regards Pesti

duncan303
- 3rd February 2008, 19:40
Where Can I found a good Assembler Interrupt example ?

you could take a look at Darrel Taylors instant interrupts routines, http://darreltaylor.com/DT_INTS-18/home.html
if you are using 18F's
They have made interrupts so much easier, especially for me.

HTH

Duncan

Pesticida
- 5th February 2008, 18:34
Hi

I have try Darrels Instant Interrups ,but all the time show the Error 108.

Warning[207] C:\PICHEX\USBWIZ.ASM 1849 : Found label after column 1. (warning)
Error[108] C:\PICHEX\USBWIZ.ASM 1849 : Illegal character (")


I can not found the Errors!

Rgards Pesti

skimask
- 5th February 2008, 18:46
Hi
I have try Darrels Instant Interrups ,but all the time show the Error 108.
Warning[207] C:\PICHEX\USBWIZ.ASM 1849 : Found label after column 1. (warning)
Error[108] C:\PICHEX\USBWIZ.ASM 1849 : Illegal character (")
I can not found the Errors!
Rgards Pesti

Do you have an extra ' <- yes, that character right there, the little extra tick
in between a couple of quotation marks. They hide very well. Or maybe an extra quote mark somewhere?

Archangel
- 5th February 2008, 22:16
Hi Pesti,
I get errors like those if I have spaces where they do not belong, I am sure you are using MPASM 'cause I think you have to for 18F parts, but Darrel's Instant Interrupts also require them. One more thing is Darrel has different DT_Instant interrupts for 16f and 18F series.
JS

Pesticida
- 6th February 2008, 14:57
Hi

Thank you ,Yes I must take a look .
I found another way to use Interrupts.

I use just little pause intervals,my problem was that I use Debugin,Hserin Interrupt and the Timer0 Interrupt.

Now is OK but I think that i will learn another Programming Language while PBP dont work very good with interrupts,I need for my Company something efficient.

Regards Pesti

skimask
- 6th February 2008, 15:03
Now is OK but I think that i will learn another Programming Language while PBP dont work very good with interrupts,I need for my Company something efficient.
Regards Pesti

PBP works great with interrupts, at least as well as anything else you'll find out there.
Yes, DT_INT's work better than ON INTERRUPT, but only because they work in a different way. I've used DT_INT's, I like them, outstanding piece of software to add to a program...But...I still use ON INTERRUPT only because I know how to handle it and to keep it out of my way.

It's all about the keyboard and who is banging on it to define whether or not the program you are writing is responding to those interrupts as you want.
I think I can say with a high degree of confidence that you won't be able to change compilers/assemblers and magically get good interrupt performance without first improving programming skills.

Archangel
- 6th February 2008, 18:08
Hi

Thank you ,Yes I must take a look .
I found another way to use Interrupts.

I use just little pause intervals,my problem was that I use Debugin,Hserin Interrupt and the Timer0 Interrupt.

Now is OK but I think that i will learn another Programming Language while PBP dont work very good with interrupts,I need for my Company something efficient.

Regards Pesti
Look Pesti,
You have 2 1/2 years invested into your learning experience here, how inefficient is starting over going to be? What you learn here translates pretty nicely into C, Assembly, and others.
Stay the course, learn how to do it here and the learning curve will be considerably shorter later, interrupts are one place you could invest the time, learn how to put assembly interrupts into your PBP program, and kill 2 birds with a single stone.
JS

skimask
- 6th February 2008, 19:22
Look Pesti,
You have 2 1/2 years invested into your learning experience here,

I'm reminded of a story...
Something about a man, a bicycle, a tire pump, a shop...
Oh I don't know what I'm thinking... :)

Archangel
- 7th February 2008, 02:10
I'm reminded of a story...
Something about a man, a bicycle, a tire pump, a shop...
Oh I don't know what I'm thinking... :)
That was a prophesy, was it?

b1arrk5
- 8th February 2008, 02:05
Pesti,

In your program you have the following line;
HSerin 10000,Main_RFID,[Menupunkt]
This command tells PicBasic to wait ten seconds (10000 milliseconds,)for input from the hardware serial port, before it moves on. The OnInterrupt command doesn't really interrupt, it just sets a flag, and waits the ten seconds before it moves on. In your second example you have shortened this to 1000, which means that it will only wait one second instead of ten. However, if you start using Darrel Taylor's Instant Interrupts (THANKS AGAIN DARREL!) it will interrupt instantly! Also, with Darrel's tool it is pretty easy to have different interrupts for different events, so you can have one interrupt handler for Timer0 and a different one for serial input, and another one for something else.

At the end of this line;
Lcdout $fe,$C0," ",DEC2 Stunde[0],":",DEC2 Minute[0],":",DEC2 Sekunde[0]," "
You have a space at the end? I don't think that you need it, and this might be causing your Error108 problem.
I can promise you that you will not find an easier language to learn than PicBasic, but it does take time. I suggest that you try the examples on Darrel's webpage, start with the Blinky program and work your way through them all until you understand how they go together, and remember, this is supposed to be fun!
Good Luck!

Jerry

Pesticida
- 8th February 2008, 17:03
Thank You People for the examples and Answers and critique :-) !

Yes I k'now that Picbasic is easy I must have more pacience.

I will try without spaces

Regards Pesti