Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Low baud rates on serial port


  • Please log in to reply
3 replies to this topic

#1 Chahu

Chahu

    New Member

  • Members
  • Pip
  • 2 posts
  • LocationAustria

Posted 29 August 2013 - 12:59 PM

I'm using a NP2 and need to communicate to a power meter. This device only supports 300 baud, 7 data bit, even parity an 1 stop bit.

I made some tests and I guess that the lowest baud rate supported from of NP2 is 1200. Is there any trick to run one NP2s serial port with only 300 baud?

 

If not, is a software solution, like SerialSoft for Arduino, possible? Or has anyone experience with I2C/SPI to UART devices, and are there breakout boards or shields available?

 

 



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 30 August 2013 - 07:39 AM

If the meter unidirectional and "read only": UART signals are quite simple active low pulses, look it up on wikipedia and you'll see how to interpret the signal. At 300 baud, it should possible to read using an interrupt enabled GPIO. You would then analyze the time difference in between the slopes. Also, It just might be possible to read it at 1200 and then convert the data afterwards (you would typically receive each bit four times). Start och stop bits might present problems though. If the meter is bidirectional, I think you could use one of these: https://www.sparkfun.com/products/9981

#3 Chahu

Chahu

    New Member

  • Members
  • Pip
  • 2 posts
  • LocationAustria

Posted 03 September 2013 - 08:20 AM

@ hanzibal

Thanks for your response.

The communication to the meter is unfortunately bidirectional. I have to send a initial sequence to the meter to start data output. So checking the received data would be possible with interrupt and timing analyses, but sending the initial sequence reliably is not possible. The NP2 isn't a real time system.

I think if I would use 1200 baud for receiving instead of 300 I will get framing errors, because the UART checks the parity bit and the correct timing and occurrence of the stop bits. Checking parity bit can be bypassed by using 8 data bit and no parity bit.

 

First I will try the above mentioned module.

After some tests I have to decide to use this module further on, or to design a new shield with either the NXP [color=rgb(51,51,51);font-family:Arial, 'MS Sans Serif', Geneva, sans-serif;font-size:13px;]SC16IS740[/color] or Maxim Max3100.



#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 03 September 2013 - 02:36 PM

Yes, a soft UART would work for receiving since interrupts are correctly time stamped but sending is trickier.

 

Still, if the meter doesn't really use full duplex (won't receive and respond in parallel) you might get away with sending too - 300 baud means >1 ms between pin toggles and that is a pretty long time even for an NP2.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.