RX interrupt


Results 1 to 7 of 7

Thread: RX interrupt

Threaded View

  1. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Arciure View Post
    Hello,
    first of all, im new on this forum and i'm from the Netherlands (spelling issue)

    since a month, im programming PIC controllers for school. im using a big, pic16f877a device which have alot of functions, including interrupts.

    However those interrupts dont work for me. I wrote a code, just to interrupt when serial data is incomming.
    Heres the code:
    Code:
    ;DEFINE HSER_RCSTA 90h (no function if baud rate is defined)
    ;DEFINE HSER_TXSTA 20h (no function if baud rate is defined)
    define HSER_BAUD 9600
    DEFINE HSER_SPBRG 25
    define osc 20
    Include "modedefs.bas"
    
    ON INTERRUPT GOTO INTERRUPT_HANDLER
    INTCON = %11000000
    PIE1.5 = 1 ' enable interrupt on usart receive
    
    
    Main_Loop:
    low portd.2
    pause 500
    hserout ["main loop hser"]
    GOTO Main_Loop
    END
    
    DISABLE INTERRUPT
    INTERRUPT_HANDLER:
    high portd.2
    hserout ["Interrupt handler hser"]
    
    PIR1.5 = 0 'Receive int clear
    
    pause 1000
    RESUME
    ENABLE INTERRUPT
    When i power up the pic, interrupt is active (portd.2 is a led) and will glow up. Sending serial data to usart wont make any difference.

    Anybody who can help? or write a simple RX interrupt example?
    Thanks in advance.
    Hello, and welcome to the forum.
    HSEROUT transmits HSERIN receives. That is where I would start . . . and understand , it must occur on the RX pin as defined in the Data Sheet. Additionally The hardware USART requires the RX port to "Idle High", which is to say, PULL UP Resistor required.
    Last edited by Archangel; - 3rd March 2010 at 19:22.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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, 10: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, 03:35
  3. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 19:14
  4. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 03:59
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02: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