9 Bit Transmission


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thank You !

    Yes I think I will use my own Protocoll !

    But I dont understand how Can I send a 9 Bit Packet when a Byte have just 8 Bit?

    9 Bit is more then 255 and is a Word Size !

    Thats mean when I Use 9Th Bit I must send a Word Divided in two Bytes ?

    Thanks

    Regard Pesti.

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    974


    Did you find this post helpful? Yes | No

    Default

    Pesti

    You do not have to use 9 bits. Your standard serial UART will do the job just fine. I mentioned this earlier
    You can define your own protocol and use it with normal 8 bit data.
    When you use the 9 bit packets, you distinguish address and data bytes by the 9th bit alone. So, any byte having the 9th bit set is an 8bit address byte whereas all words with the 9th bit low are data.

    Jerson
    Last edited by Jerson; - 4th August 2007 at 10:25.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Ok I understand,but where is the 9th bit ?

    When I send 1 Byte I have: 1 Start Bit,8 Data Bit,1 Stop Bit.
    Where Is here the 9Th Bit? :-)

    For example when I use Hyperterminal I can not adjust to 9th Bit I just have 7 or 8 Bit data.

    Regard Pesti

  4. #4
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    The USART module of a PIC has multi-processor communication
    capability using 9-bit address detection.

    See this document:
    http://www.datadog.com/rs485.pdf

    Use The PC's UART With 9-Bit Protocols
    http://www.elecdesign.com/Articles/I...ArticleID=6245
    (You will have to wait 20 seconds before you see the doc).

    See the datasheet of the used chip.

    Best regards,

    Luciano

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Mille Grazie Luciano !

    :-)

    Regard Pesti

  6. #6
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Pesti,

    With the VB MScomm control you can set the parity as following:

    Code:
    Setting   Description 
    E         Even 
    M         Mark 
    N         (Default) None 
    O         Odd 
    S         Space

    If you use MARK parity, then the bit after the data word is a logical 1.
    If you use SPACE parity, then the bit after the data word is a logical 0.

    With MARK parity the slave device will see the data as a 9-bit transmission. (Last bit = 1)
    Use the MARK parity to send the address to the slaves.

    With SPACE parity the slave device will see the data as a 9-bit transmission. (Last bit = 0)
    Use SPACE parity to send the data to the selected slave.


    (Click on the picture to enlarge)

    (VB pseudocode)
    Code:
    VB pseudocode
    .....
    Insert a delay here to ensure that UART FIFO buffer of the PC is 
    empty before you change the parity. The UART 16550 has up to 16 bytes 
    for the FIFO transmit buffer. 
    
    MSComm.Settings = "9600,M,8,1"
    MSComm.Output = (The slave Address) 
    
    Insert a delay here to ensure that UART FIFO buffer of the PC is 
    empty before you change the parity. The UART 16550 has up to 16 bytes 
    for the FIFO transmit buffer. 
    
    MSComm.Settings = "9600,S,8,1"
    MSComm.Output = (The data for the selected slave)
    .....
    From the Windows control panel you can adjust the size of the FIFO buffers of the used serial port.

    (Click on the picture to enlarge)

    Best regards,

    Luciano
    Last edited by Luciano; - 5th August 2007 at 13:22.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thank You!

    Thats it !
    This is the Answer what I waiting for.

    Now I know how to Programming the Software routines.

    I use Pic 18f452 and I see on the PDF Datasheet that I can set the 9th Bit Transmission for RX and TX.

    Thanks a lot Luciano!

    Buona Giornata!


    Regard Pesti.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 08:55
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 11:38
  3. Sleep Mode
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th March 2008, 11:31
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 01:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07

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