i only get a high signal...when i checked it using simulator i found that the first delay itself does not end...!!it keep executing the line "here:goto here"...:|
can anyone temme whats the mistake??!
Hi buddy...
the program stays in the loop all the time....
Here: goto Here
That means the interrupt is not getting generated...To check this problem...1st u check whether the timer is running properly or not...Do this by replacing (Here: goto Here)
Here: btfss (timer overflow flag)
goto here
& if u find that there is no problem with timer...
Then the problem lies within the interrupt initialisation...Try debugging it...
a computer is stupid in that it does exactly what you have programmed it to do. here you have programmed it to loop around forever. so it loops around forever.
if you expect something else, program accordingly.
If you cant work something that simple out the first
thing you should do is stop using assembler and change to a higher level language. That is the reason they exist.
Some simulators can indeed do interrupts. It just depends.
But he doesnt need a simulator he needs a debugger.
I'm starting to sound like a salesman but - the mikroC IDE includes a software debugger.
I suggest you download that - learn C and read their
examples (at least one of which just does what you are struggling with. )
Cut and paste it.
Compile it.
And if you really must - read the assembly output it generates.
If you still can't make it work - learn to use the software debugger and single step through it.
All this should take no more than 2 days from scratch. It really isnt that hard.
If you still have questions after doing that they will probably be the sort someone can really help with.
You might want to read their online book pages too.
That will probably help you quite a bit.
now 1 confusion is that to start the second delay do i have to initialize isr at org 0x08
or its ot needed...i can just clear the timer register and stat over again:|
After initialisation of the Timer to generate interrupt, its going to occur after a delay, as per the values u have loaded in Timer registers...It will keep running in the background. Now when an interrupt occurs all u have to do is perfrom the task for which interrupt was generated, Clear the Interrupt Flag, Load the Timers & return, Now u r ready to go for another interrupt...Regards.