RS232 receive an array (packet)


Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Feb 2008
    Posts
    8

    Question RS232 receive an array (packet)

    Dear PICBasic members,

    I have a master pic which is written in CCS C that send an array through RS232 protocol at 38400 bauds , the array is 24 bytes long.

    The array («packet structure»):

    byte 0 is the delimiter (used to delimit one array to another) constant value 0xC8

    byte 1 is the function to be executed

    byte 2 to 23 is the pwm value applied to each channel ( 22 channels in total)

    The array is sent 100 times a seconds.

    How to grab the rs232 rx data, trim , split data into 1 byte and 1 array ?

    ex:
    byte 0 would be discarded , it only separate array data
    byte 1 would be stored in a BYTE
    byte 2 to 23 would be stored in a array of 22 bytes

    Sorry for such question if it's an easy one.

    Many thanks!

    Best Regards,

    Laurent
    Last edited by ELCouz; - 12th February 2008 at 01:18.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  4. Receiving Packet Array In Usart
    By crhomberg in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 24th April 2007, 20:41
  5. Receiving Packet Array In Usart
    By crhomberg in forum Serial
    Replies: 1
    Last Post: - 18th April 2007, 22:31

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