Searching \ for '[PIC]: 9 bit serial w/ PC COM port?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=serial
Search entire site for: '9 bit serial w/ PC COM port?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 9 bit serial w/ PC COM port?'
2002\01\05@201155 by Andy Meng

picon face
Hello,

I am working on a Windows program using C++ to talk to a PIC. The PIC is
using 9-bit serial mode (the PC is simulating one side of what will
eventually be two PICs communicating over an RF link), but it seems that the
PC serial port can do only 8 bits. Is this true? Is there a way to get
around this?

Thanks,

Andy Meng


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\01\05@215626 by Bob Barr

flavicon
face
On Sat, 5 Jan 2002 20:11:20 -0500, Andy Meng wrote:

>Hello,
>
>I am working on a Windows program using C++ to talk to a PIC. The PIC is
>using 9-bit serial mode (the PC is simulating one side of what will
>eventually be two PICs communicating over an RF link), but it seems that the
>PC serial port can do only 8 bits. Is this true? Is there a way to get
>around this?
>

I don't know the specifics of the C++ interface code but, in
Hyperterm, the 9th bit can be set to odd parity, even parity, mark,
space, or none. You'll probably find a similar capability in your C++
documentation.

Switching between mark and space could get a bit messy if you want to
use the 9th bit as a data bit. Are you using it for data or for parity
checking?

Regards, Bob

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2002\01\05@225401 by Byron A Jeff

face picon face
On Sat, Jan 05, 2002 at 06:54:08PM -0800, Bob Barr wrote:
> On Sat, 5 Jan 2002 20:11:20 -0500, Andy Meng wrote:
>
> >Hello,
> >
> >I am working on a Windows program using C++ to talk to a PIC. The PIC is
> >using 9-bit serial mode (the PC is simulating one side of what will
> >eventually be two PICs communicating over an RF link), but it seems that the
> >PC serial port can do only 8 bits. Is this true? Is there a way to get
> >around this?
> >
>
> I don't know the specifics of the C++ interface code but, in
> Hyperterm, the 9th bit can be set to odd parity, even parity, mark,
> space, or none. You'll probably find a similar capability in your C++
> documentation.

Which makes it pretty much useless for this application.

>
> Switching between mark and space could get a bit messy if you want to
> use the 9th bit as a data bit. Are you using it for data or for parity
> checking?

The 9th bit is an address/data bit. When set it indicates an address that
the packet it targeted for. Reset indicates data.

The usefulness on the PIC is that that its USART can be configured to generate
an interrupt only if an address is sent. So the basic gameplan when you have
multiple nodes on the line:

- Everyone sets up to just accept addresses.
- When an address is sent everyone is interrupted and checks the address. If the
 address doesn't match, when go back to accepting addresses only.
- However if the address does match configure the USART to accept data.

So once a matching address is sent, only the targeted station will receive the
data. All the other stations will ignore the line until another address is
sent.

This issue comes up time to time on the list. Personally I always thought the
best tack was to attach the PC to a PIC which does 9 bits to the rest of the
network and uses a 8 bit software UART to talk to the PC. By the time you
finish contorting your Windows code to mangle the PC UART to simulate 9 bit
mode, you will have pulled all your hair out of your head.

Since your final target is 2 PICs anyway, why waste time trying to get a PC
to simulate?

BAJ

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2002\01\05@235644 by Bob Barr

flavicon
face
On Sat, 5 Jan 2002 22:51:15 -0500, Byron A Jeff <.....byronKILLspamspam.....CC.GATECH.EDU>
wrote:

>On Sat, Jan 05, 2002 at 06:54:08PM -0800, Bob Barr wrote:
>> On Sat, 5 Jan 2002 20:11:20 -0500, Andy Meng wrote:
>>
>> >Hello,
>> >
>> >I am working on a Windows program using C++ to talk to a PIC. The PIC is
>> >using 9-bit serial mode (the PC is simulating one side of what will
>> >eventually be two PICs communicating over an RF link), but it seems that the
>> >PC serial port can do only 8 bits. Is this true? Is there a way to get
>> >around this?
>> >
>>
>> I don't know the specifics of the C++ interface code but, in
>> Hyperterm, the 9th bit can be set to odd parity, even parity, mark,
>> space, or none. You'll probably find a similar capability in your C++
>> documentation.
>
>Which makes it pretty much useless for this application.
>

True, it's useless with Hyperterm but not when writing your own C++
code for testing.

{Quote hidden}

Thanks for clarifying the application. I hadn't realized that the
PIC's UART had that capability. Of course, I haven't implemented any
multi-node PIC networks either. :=)

Since the 9th bit can be set to a mark or a space in the PC, all that
needs to be done in the C++ code is set it to mark for the addresses
and switch it to space for the data bytes.
Regards, Bob

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\01\06@002529 by Andy Meng

picon face
> The 9th bit is an address/data bit. When set it indicates an address that
> the packet it targeted for. Reset indicates data.
>
> The usefulness on the PIC is that that its USART can be configured to
generate
> an interrupt only if an address is sent. So the basic gameplan when you
have
> multiple nodes on the line:
>
> - Everyone sets up to just accept addresses.
> - When an address is sent everyone is interrupted and checks the address.
If the
>   address doesn't match, when go back to accepting addresses only.
> - However if the address does match configure the USART to accept data.
>
> So once a matching address is sent, only the targeted station will receive
the
> data. All the other stations will ignore the line until another address is
> sent.

I think that is one of the things that can be done with it. I am simply
using the 9th
bit as a single address bit - if it is set, the "main" 8 bits are for one
PIC, and if the
9th bit is clear the data is for the other PIC.

> This issue comes up time to time on the list. Personally I always thought
the
> best tack was to attach the PC to a PIC which does 9 bits to the rest of
the
> network and uses a 8 bit software UART to talk to the PC. By the time you
> finish contorting your Windows code to mangle the PC UART to simulate 9
bit
> mode, you will have pulled all your hair out of your head.

I thought of that, but I don't have a spare 873 here.

> Since your final target is 2 PICs anyway, why waste time trying to get a
PC
> to simulate?

The PIC that the PC is simulating a PIC which interfaces to a Microsoft
digital joystick. I was having problems with that and wanted to put it on
the back burner and work on the other (receive) side of the link and have a
way to test out the serial input. The main reason I did it is to learn more
about programming a Windows GUI program in C, instead of just the console
stuff I do at school.

Andy


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu


2002\01\06@100510 by Gerhard Fiedler

flavicon
face
At 00:24 1/06/2002 -0500, Andy Meng wrote:
>I think that is one of the things that can be done with it. I am simply
>using the 9th bit as a single address bit - if it is set, the "main" 8
>bits are for one PIC, and if the 9th bit is clear the data is for the
>other PIC.

Can be done, have a look at Get/SetCommState and related functions.

ge

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...