is there interrupt serial communication in pbp?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    8

    Unhappy is there interrupt serial communication in pbp?

    can it be done?
    i have the following code. But in order to work i must send always data to serin.I want when the program to be executed all until a new B0 comes.

    INCLUDE "MODEDEFS.BAS"

    B0 VAR WORD
    B1 VAR WORD
    Pause 500
    SerOut2 PORTC.6,84,["Hi!",13,10]

    start:
    SerIn2 PORTC.7,84,[DEC B0,DEC B1]
    IF(B0==1) Then
    Low PORTC.1
    High PORTC.2
    EndIF
    IF(B0==0) Then
    Low PORTC.1
    Low PORTC.2
    EndIF
    IF(B0==2) Then
    Low PORTC.2
    High PORTC.1
    EndIF
    IF (B1==3) Then
    Low PORTC.2
    High PORTC.1
    Pause 10
    Low PORTC.2
    Low PORTC.2
    Pause 10
    EndIF
    IF (B1==4) Then
    Low PORTC.2
    High PORTC.1
    Pause 500
    Low PORTC.2
    Low PORTC.2
    Pause 1000
    EndIF
    GoTo start
    End

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You will need to use hardware serial (HSERIN).
    Here is a thread to get you started.
    http://www.picbasic.co.uk/forum/showthread.php?p=51502

    Here is another thread. post #11 has a nice test program.
    http://www.picbasic.co.uk/forum/show...=8601#post8601
    Last edited by mackrackit; - 12th September 2008 at 13:42.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Mar 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    thanx mackrackit! sorry for the delay...:-) . Your advice was extremely helpful!

Similar Threads

  1. 18F2480 asm interrupt
    By Richard Storie in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th March 2009, 19:40
  2. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  3. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  4. Interrupt and Serial communication to PC.
    By obaskirt in forum mel PIC BASIC
    Replies: 2
    Last Post: - 17th June 2005, 20:01
  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