USART interrupt not interrupting :-(


Closed Thread
Results 1 to 2 of 2
  1. #1
    barkerben's Avatar
    barkerben Guest

    Default USART interrupt not interrupting :-(

    Hi,

    I've been testing out the USART on my 16F76 by writing a simple echo server. I started off with:


    DEFINE OSC 4
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_BAUD 2400
    DEFINE HSER_ CLROERR 1

    serial var byte

    main:
    HSerin [serial]
    Hserout [serial]
    GoTo main


    This worked absolutely fine. I then tried to add interrupts to the program:

    DEFINE OSC 4
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_BAUD 2400
    DEFINE HSER_ CLROERR 1


    init:
    PIE1.5=1 'Enable USART RX interrupts
    INTCON.6=1
    INTCON.7=1


    on interrupt goto handler
    main:
    'Main loop, does absolutely nothing for the moment
    GoTo main

    DIsable
    handler:
    HSerin [serial]
    Hserout [serial]

    resume
    enable

    This ought to behave in exactly the same way, except that it doesn't work at all. Have I forgotten to set a needed register to enable interrupts or something ...?


    Ben

  2. #2
    barkerben's Avatar
    barkerben Guest


    Did you find this post helpful? Yes | No

    Default

    Arg! Both the code samnpoles above work perfectly! My problem was with solderus badus on my part! It was pure chance that it worked whenever I loaded one code in, but not the other. My Iron is warming as I speak(write) .... :-)

Similar Threads

  1. 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
  2. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  3. USART interrupt in PIC16F877A
    By amindzo in forum General
    Replies: 7
    Last Post: - 26th August 2006, 18:51
  4. PIC Basic PRO 16F877 USART Interrupt TX
    By BigH in forum Serial
    Replies: 8
    Last Post: - 9th January 2006, 23:26
  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 : 1

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