Don't return from Interrupt!


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    29

    Default Don't return from Interrupt!

    Hello this is my first post here, but i'm using PicBasic Pro since some years. Here's my problem : I have to make a program with 2 interrupts source. The first Interrupt source is on RB0/Int, after many try and read, I decided not to interrupt this one but only scan INTCON.1 and make my main code around that. The second interrupt source is by receiving a Serial signal. I can't use the Hardware Serial Port cause it's inverted and it don't work with my circuit (I've tried with a PIC16F688 that have an Enhance Serial Port but PicBasic doesn't seems to support this one... but this is another story). So I use a RB4-7 Port change Interrupt. Everything seems to work fine but when I receive serial data, it doesn't return to the main code.

    Here is what my code looks like :

    'I'm using a 16F627 @ 20 MHz
    'Naturally my prog start with all the define, registry settings and var

    INTCON = %10001000 'Enable RB Port Change and GIE

    ON INTERRUPT GOTO RECEIVE

    START :
    IF INTCON.1 = 1 THEN
    'My main code is here and everything work before receiving serial data
    '.........
    INTCON.1 = 0
    ENDIF
    GOTO START

    DISABLE
    RECEIVE :
    SERIN2 RXPIN,6,[DAT05,DAT04,DAT03,DAT02,DAT01]
    LED = ~ LED
    INTCON.0 = 0
    RESUME
    ENABLE


    The LED tell me that my serial data is received and it toggle each time I send serial data. But the program never return to the main section. Any help will be appreciate Thanks

  2. #2
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    Argh,

    if you want to use interrupts to receive serial input - use hardware !!!!!
    Access direct the registers and place an inverter into the serial signal !

    Using SERIN will lead you to big trouble !

  3. #3
    Join Date
    Jun 2005
    Posts
    29


    Did you find this post helpful? Yes | No

    Default

    Thank you for the adviced I will use HSERIN instead of SERIN.

    P.S. : If someone make to work the Hardware serial Port on the PIC16F688 with the Hserout command please let me know how you did it...

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  4. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts