5270 Uart Serial ports

Discussion to talk about software related topics only.
Post Reply
BillC
Posts: 72
Joined: Tue Oct 13, 2009 6:22 am
Location: Buckinghamshire, UK

5270 Uart Serial ports

Post by BillC »

I have just received delivery of my MOD5270 Development kit and am familiarizing myself with the product.

Can anyone please tell me if the Serial library supports using the Uart ports with "ALWAYS 0" or "Always 1" parity values, I couldnt see them listed ?

Thanks in adavnce

Bill Comben
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: 5270 Uart Serial ports

Post by lgitlitz »

Hi,

The Serial driver only supports 4 different parity modes:
eParityNone -> No Parity
eParityEven -> Even Parity
eParityOdd -> Odd Parity
eParityMulti -> Multidrop Parity

The processor also supports low or high parity modes but this is not in the driver. I did a quick search and didn't find what one would use these modes for. If you dont mind me asking, why do you need fixed parity bits? Seems like it adds an extra bit of overhead with much less error checking benefit compared to the other parity modes.

You could easily modify the driver to support the high and low parity modes. Look for the following line in serial.cpp:
switch ( parity )
Then add the following two cases:
case eParityHigh:
tmp = 0x0C;
break;
case eParityLow:
tmp = 0x08;
break;

You will also need to add these to the enum in serial.h:
typedef enum { eParityNone, eParityOdd, eParityEven, eParityMulti } parity_mode;
typedef enum { eParityNone, eParityOdd, eParityEven, eParityMulti, eParityHigh, eParityLow } parity_mode;


-Larry
BillC
Posts: 72
Joined: Tue Oct 13, 2009 6:22 am
Location: Buckinghamshire, UK

Re: 5270 Uart Serial ports

Post by BillC »

Hi Larry
Thanks for your prompt reply, exactly what I needed, I will add your modifications to my copy of the serial library.

Yes, I agree that an always low setting is unusual, I have never seen it used before, I need it for use with a cheap temperature/humidity sensor board that I want to interface to that only supports this parity setting.

If you are interested in the device, the website page is http://www.sureelectronics.net/goods.php?id=904.
I found it on EBay.

Thanks again for your help.
Bill
Post Reply