PDA

View Full Version : Interrupt problem ?



iugmoh
- 1st February 2008, 18:01
Hi all,
I have a strange problem and if any one have the solution or the idea to solve it
first I interface the barcode reader with PIC16f877a which when anyone pass its ID card it will display the number on the LCD without any problems and it's working alright.
second I interface my HP laseject printer with pic16f877a so I can print some information on printer and it's working alright without any problems.

Now I want to mix two steps since when anyone pass its ID card , the printer will automatically print the ID number.

I did first step and second step individual without any problems, but when i mix the two steps together in one file , the printer worked but the interrupt doesn't work since the number is not true.

I don't know why the interrupt is not woking properly

skimask
- 1st February 2008, 18:44
I don't know why the interrupt is not woking properly

Neither will we unless some code starts magically appearing...

iugmoh
- 1st February 2008, 19:09
Oky it's now woking since I replace gosub with the code itself , but i don't know what is the reason

mister_e
- 1st February 2008, 19:26
Don't post you code just in case we could help ;)

skimask
- 1st February 2008, 22:01
Oky it's now woking since I replace gosub with the code itself , but i don't know what is the reason

You're using a 16F877A...
If you check the PBP manual, you might see where it says that you can only nest a GOSUB so many levels deep. Maybe that was your problem...
You 'overnested' your GOSUBs and caused a stack overflow, which caused the program to either crash or reset.