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
5270 Uart Serial ports
Re: 5270 Uart Serial ports
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
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
Re: 5270 Uart Serial ports
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
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