Netduino plus uart communication
#1
Posted 08 October 2011 - 04:01 PM
#2
Posted 09 October 2011 - 05:27 AM
- None: No parity check occurs.
- Odd: Sets the parity bit so that the count of bits set is an odd number.
- Even: Sets the parity bit so that the count of bits set is an even number.
- Mark: Leaves the parity bit set to 1.
- Space: Leaves the parity bit set to 0.
That should be pretty reasonable, because to achieve the possibility to treat the 9th bit as a normal data bit, it needs an extra buffer of data to store its sequence.
I never heard any UART chip allowing this feature. The most "flexible" way would be to set explicitly the 9th bit by your code, but that's an overkill for performance.
I would recommend a XON/XOFF solution instead.
Cheers
#3
Posted 09 October 2011 - 08:32 AM
#4
Posted 09 October 2011 - 12:11 PM
Basically, instead of using the 9th bit to transport an extra-info, you may use a special prefix on your data stream.
Now, I don't know what you are doing, but a very simple example of multidrop protocol is the Modbus RTU.
There is only one master, but one or more slaves: this classification is also stable (i.e. the master cannot be a slave or vice-versa).
The master initiates the transmission toward one slave by issuing a well-known "start-of-message". Any of the slave must begin listening the next byte, because it is the "address". But only one will be actually involved in the communication, being its address matching the message field.
And so away...
Is it that what you are looking for?
#5
Posted 20 October 2011 - 08:54 AM
#6
Posted 20 October 2011 - 12:17 PM
This protocol is very odd. I never saw a so strange use of the parity bit.
I guess would be hard to find a workaround, since I'm not sure you would solve this problem even writing your own native C/C++ driver. Most of the time, the parity bit either is hardware calculated, or must be fixed along the whole message.
At this point, I may suggest you to pick up an AVR microcontroller (such as Boarduino, for instance), then implementing the UART in a bitbang-fashion. It'll be not a walk, but it sounds the easiest way to come out.
However, once the Boarduino-based-UART is working, you may connect it to the Netduino via SPI. I have done already some experiment on that, and it works. Note that I do NOT have any bitbanged-UART implementation.
Not sure about, but this library for Arduino could fit.
Cheers
#7
Posted 21 October 2011 - 07:39 AM
I know how to intiate master -> slave with parity mark, space, but the problem is on receive, because i cannot detect the mode bit = 1 on the last byte so that i know that we have end of transmission. Problem is in variable data len in response, where u need the detection of the modebit = 1.
I am working on exactly the same problem. On my pc and on windows CE i solved it by switching the parity from space to mark while sending and ignoring the parity on receiving, but using a intercharacter timeout.
It works on pc and windows ce with CF Net 3.5. Now i am waiting for my netduino to arrive.
If you have any news on that topic, please let me know.
regards
Mirko
#8
Posted 23 November 2012 - 02:41 PM
#9
Posted 27 July 2014 - 03:20 PM
Sorry to resurrect an old post, but I too am trying the same thing. Did anyone figure this out?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users