UArt question


Closed Thread
Results 1 to 6 of 6

Thread: UArt question

  1. #1
    smeet's Avatar
    smeet Guest

    Default UArt question

    Hi I am trying to send packets of data using HSErout instead of SErout......The reason being when I try to use serout .. my A/d conversion is not as responsive as in Hserout.


    This is the code I am trying to use.. Pls tell me if this is the right approach or not...

    hserout ["SYNC",B2] using UART and I have also tried software using
    serout2 PORTB.6,T1200,["SYNC",B2]

    here B2 stores the A/d results...

    for serin :

    the hardware code is

    HSERIN 1,Main,[wait ("SYNC"),B0]
    and software is SERIN2 PORTB.4,T1200,10,Main,[wait ("SYNC"),B0]


    Pls reply as I need to get it done today thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807

    Default

    Keep in mind that as long as UART is sending the characters, A/D will not work even if you are using the Hserout command.

    To be sure that your converter is started at predetermined intervals, I guess the best approach would be Darrel Taylor's Instant Interrupts. That way you would be able to send one character, start A/D, send another character, if A/D is finished then Interrupt will make a notice to your code, etc.

    Ioannis

  3. #3
    smeet's Avatar
    smeet Guest

    Default

    hi thanks a lot... ill look into that... I had another question.. Do u recommend using Manchester coding for RF communication... My PIC output is connected to a transmitter at 418 Mhz ...

    I need a range of around 300 feet..


    Thanks

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807

    Default Manchester

    Yes, absolutely do use manchester encoding. This came up a number of times and you will find alot of answers if you do a search.

    Ioannis

  5. #5
    smeet's Avatar
    smeet Guest

    Default re:

    I am trying to use Hserout with manchester coding.. however I have this problem... DOes Hserout support 16 bits or do I need to specify IBIN16 before the variable...

    I could not implement the Instant interrupts as I have never used them before and I need to submit my project by tom...

    Any help from you will be appreciated thanks a lot

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807

    Default

    Hserout is 8-bit command.

    If you want to send out 16-bit wide variable you have to send it like 2 bytes as

    Hserout [mybyte.lowbyte, mybyte.highbyte]

    or as an array. I think better is the first way.

    All are in the manual of the compiler.

    Ioannis

Similar Threads

  1. Bootloader for 16f87/88 that doesn't use UART
    By bcd in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 18th January 2008, 17:35
  2. Super easy 18F print strings to UART
    By Bruce in forum Code Examples
    Replies: 0
    Last Post: - 26th August 2007, 23:19
  3. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  4. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49
  5. External UART IC
    By Terry in forum General
    Replies: 4
    Last Post: - 22nd December 2005, 18:01

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