CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

MDB Protocol Transmit 9 bits RX9D & TX9D

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Viotronics



Joined: 10 Oct 2009
Posts: 5
Location: Mexico

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger

MDB Protocol Transmit 9 bits RX9D & TX9D
PostPosted: Thu Feb 25, 2010 12:31 pm     Reply with quote

Hi!

I'm starting to implement the serial 9 bit MDB protocol, with a PIC18F4420 the first step is configuring the usart

Code:

#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9)


But I have the following question how do I clear/set the 9 bit of transmission TX9D in the TXSTA Register, and how do I read the 9 bit of reception RX9D in the RCSTA Register

For a moment I was planning to use the putc() and readc() functions but the manual says it works with 8 bits. Maybe it changes automatically when you declare the 9 bits and you could transmit a 16 bit register (it will only transmit the first 9 bits)

Thanks for your help.
_________________
Viotronics Inc.
Intelligent Communication & Control Systems
http://www.viotronics.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 12:34 pm     Reply with quote

Read the manual:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Look at the parameters for the #use rs232 statement:
Quote:

LONG_DATA

Makes getc() return an int16 and putc accept anint16.
This is for 9 bit data formats.


Quote:
For a moment I was planning to use the putc() and readc() functions

There is no readc().
Viotronics



Joined: 10 Oct 2009
Posts: 5
Location: Mexico

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger

Thanks
PostPosted: Thu Feb 25, 2010 12:57 pm     Reply with quote

Thank you very much!

The trees didn't allow me to see the Forest and sorry about the typing error readadc

Hasta la vista Amigo!
_________________
Viotronics Inc.
Intelligent Communication & Control Systems
http://www.viotronics.com
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group