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

Netduino Plus 2 non-standard serialports

netduino serial comm port

Best Answer SpitfireMike, 28 January 2013 - 12:57 AM

Just to close the loop, using a few RS232 Shifters (SparkFun PRT-00449) and the Netduino Plus 1, I was able to communicate at 19200 7E2.  Unfortunately, after all of this, the barcode scanner doesn't support the UCCEAN128 barcode format required for the DHL label we needed to use.  After all of that, the project was scrapped.

The good news is that we have identified a few other places on our manufacturing floor where the Netduino platform can be used,

Go to the full post


  • Please log in to reply
13 replies to this topic

#1 SpitfireMike

SpitfireMike

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationColorado Springs, CO, USA

Posted 17 January 2013 - 09:58 PM

Having trouble reading 19200, 7E2 data from COM2 and COM3 with Netduino Plus 2.

 

<details>

After playing with Netduinos at home, I finally brought one in to work for a relatively simple project.  The board is the Netduino Plus 2 RevA with stock firmware.  The Netduino should sit in the middle of an RS232 connection, reading values from one SerialPort, converting the data, then sending it out the other SerialPort.  The problem seems to be the port configuration that I have to use.  It's 19200, 7E2.  I read in another forum topic here that COM1 may have problems with anything other than 8N1, so I'm using COM2 and COM3.  Everything initializes correctly, no exceptions creating or opening the ports.  The data that is read looks like regular garbage data that you'd see with a config mismatch.  Connecting the input to a Windows XP Hyperterminal session with 19200 7E2 gives me good valid reads.  It sure looks like the Netduino is having trouble with this configuration.

 

The setup is pretty straight forward, an overhead barcode scanner sends data through RS232, RS232 connected to Netduino COM2 pins, DataReceived handler writes to SerialLCD on COM1 and log file on SD card.  Once receive is OK from COM2, send the modified data out COM3 at the same config.

</details>



#2 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 17 January 2013 - 10:22 PM

Hi SpitfireMike,

 

I don't have a lot of experience with anything beyond 8N1, but I am curious if the newer firmware for the Netduino Plus 2 should would help alleviate any issues. You can download the latest firmware from here: Netduino Plus 2 Firmware v4.2.2

 

Also what are the voltage levels of your RS232 device and how exactly do you have it wired to the Netduino? Keep in mind that the Digital inputs are only 5V tolerant and the output can only go up to a maximum of 3.3V. 

 

Cheers,

Steve



#3 SpitfireMike

SpitfireMike

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationColorado Springs, CO, USA

Posted 18 January 2013 - 01:29 AM

Specs for the barcode scanner said 5V, but meter says 12V a few minutes ago. Hmph. I only need to validate the receive bit tomorrow, I'll whip up a voltage divider until I can get a proper level converter.  If it was a simple voltage problem, this should take care of it.

 

I'll hold off on updating the firmware, last time I did that it didn't work out quite so well.



#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 January 2013 - 01:27 PM

Hi SpitfireMike,
Having trouble reading 19200, 7E2 data from COM2 and COM3 with Netduino Plus 2.
The STM32 chips can support 8-bit or 9-bit words and 1 or 2 stop bits. But they have a maximum length that they can support of 9 bits...so 7 data bits + even parity bit + 2 stop bits might be pushing you one bit beyond the boundary. It's also possible that we can tweak the firmware a little bit to enable less common UART settings like 7E2. Does your barcode scanner enable alternative UART settings? If not, Netduino Plus 1 might be the best fit for your specific application. Chris

#5 SpitfireMike

SpitfireMike

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationColorado Springs, CO, USA

Posted 18 January 2013 - 08:13 PM

The scanner is an old AccuSort Mini-X, I'm pretty sure I can change the data line to 8N1.  If I can't, I have a few Netduino 1s on my desk at home, I'll grab one of those. 

 

I really can't thank y'all enough.  Evey time I've had a problem and posted a question, I've had a helpful response far quicker than I expect.



#6 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 19 January 2013 - 09:37 AM

If you have to use 7E2, you could use 8N2.

To do this,

 - on receive, you would mask off the parity bit to ignore it, (and you might also need to shift the data by 1-bit).

 - on transmit, you would need to add a parity bit to each byte before sending.

This would slow down your code, but will work.

 

Even better if (as suggested above) Chris could include this in the firmware.

 

 

Paul



#7 caEstrada

caEstrada

    Advanced Member

  • Members
  • PipPipPip
  • 84 posts

Posted 22 January 2013 - 07:26 AM

In Netduino Plus 1 I tested many speeds and configurations with excellent results.  I used hyperterminal on the pc side.



#8 SpitfireMike

SpitfireMike

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationColorado Springs, CO, USA

Posted 28 January 2013 - 12:57 AM   Best Answer

Just to close the loop, using a few RS232 Shifters (SparkFun PRT-00449) and the Netduino Plus 1, I was able to communicate at 19200 7E2.  Unfortunately, after all of this, the barcode scanner doesn't support the UCCEAN128 barcode format required for the DHL label we needed to use.  After all of that, the project was scrapped.

The good news is that we have identified a few other places on our manufacturing floor where the Netduino platform can be used,



#9 couchounou

couchounou

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationFrance

Posted 30 January 2013 - 01:17 PM

I've also a strange behavior on N2+.

Taking a shield working very well at 1200 E71 on N+ COM1  does not work anymore on N2+ COM. Datareceived event is fired but each received byte is 0.

 

Same issue ?



#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 January 2013 - 05:05 PM

Hi couchounou, The STM32 UARTs are really designed for 8 data bits. There are ways to make them do other things, but they're a bit outside the normal box. 1200,E,7,1 might be possible. What shield are you using? Chris

#11 couchounou

couchounou

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationFrance

Posted 31 January 2013 - 08:51 PM

Hi Chris,

 

I use a realy simple homemade one to connect to french electrical meter.

The shield is only doing a AM demodulation of the meter signal through an optocoupler.Com1 input D0 is connected to 5V through a 4,7K resistor and bits are generate by the optocoupler by pulling down D0 to ground.

It works perfectly on N+



#12 couchounou

couchounou

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationFrance

Posted 06 February 2013 - 09:34 PM

Dear Chris,

Any idea on a workaround or do i need to forget about N2+ working and coming back to N+

 

Regards



#13 couchounou

couchounou

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationFrance

Posted 16 February 2013 - 09:23 AM

So, roll back to N+ and forget N2+ for this simple app...

 

:(



#14 couchounou

couchounou

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationFrance

Posted 19 August 2014 - 06:13 AM

Dear Chris,

 

Back here after a while.

Any way to have serial 1200,E71 working on N2+ ?

 

Best Regards






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.