PBP "USART.BAS" Doesn't Work


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

    Question PBP "USART.BAS" Doesn't Work

    Hi Everyone,

    I've been using HSEROUT and HSERIN with no problems. That being said, I'd like to make my program as lean as possible. I'd also like to be able to do some small background tasks while I wait for characters.

    So far I've been able to accomplish this with HSERIN and a time-out. Basically, I look for a character and, after 1ms, if there still isn't a character I go do something else and then look again.

    To do all of the things I'd like to do and still keep my "ear" to the receive line, I need to get down to the nuts & bolts of the USART a bit more.

    Has anyone been able to make "USART.BAS" from the PBP "Sample" folder work?

    I loaded it as is and all I get is garbage. I'm using the same oscillator (20MHz) and I have my terminal program set at 2400 baud.

    If anybody can give me a hand here that would be great!

    I've attached the actual code to this post in case you don't feel like looking for it in the PBP folder.

    Thanks!
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    I also had problems with this and I used a 16f876 with a bildin usart.
    now i use an other instuction and never had any problems with the uart anymore.
    here is an example: 2400 baud
    DEFINE OSC 4
    DEFINE SER2_BITS 8
    TRISC = %10010000
    pinin VAR PORTC.7
    pinout VAR PORTC.6
    B1 var byte

    for taking data in I use:

    SerIn2 pinin,396,[B1]

    The data will be put in B1
    sending data to device

    SerOut2 pinout,396,[B1]

    succes

Similar Threads

  1. ICD & PBP && how to get it to work
    By archendekta in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 24th March 2010, 01:56
  2. Will PBP work in Vista64?
    By Countryman in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 25th February 2009, 17:47
  3. How to set ICD-2 clone to work with PBP?
    By G-R-C in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th October 2006, 02:50
  4. Pin RA4 doesn't work
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 15th July 2004, 12:03
  5. Using the PBP example "USART.bas"
    By Corey in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 5th October 2003, 18:38

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