Serial port problem - Netduino 2 (and Netduino 1) - Netduino Forums
   
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

Serial port problem

serial serial port serialport rs-232

  • Please log in to reply
3 replies to this topic

#1 Duefectu

Duefectu

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 22 January 2013 - 12:47 PM

Hello:

 

I found some post about serial port problems, but I have a strange case.

 

I have a new Netduino Plus 2, and a RFID reader that sends data via RS-232 in 9600,n,8,1. This reader only sends data, and no need to receive any information or config.

 

I connected the RFID TX to D0, and GND to GND (I tried with COM1 and COM2).

 

I use simple code to read the data, and I tested several methods (read byte to byte, all bytes indicated by BytesToRead property…)

 

When I approach a card to the reader it sends the serial number of the card, but the data is different to the read with Hyperterminal on the PC.

 

[font="'courier new', courier, monospace;"]Hyperterminal  : 02 30 31 30 36 44 30 45 42 32 36 0D 0A 03[/font]

[font="'courier new', courier, monospace;"]Netduino Plus 2: 3F A6 E6 66 E6 F9 EA F6 36 26 CA D6 F2 00[/font]

 

The number of bytes is correct but the other data is totally wrong.

 

Any idea?

Thanks for your time!



#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 22 January 2013 - 01:43 PM

Do you have a data sheet for the reader and can you post more information about the hardware set up?

 

For instance, you mentioned that the reader is generating data over RS-232 - the Netduino cannot handle RS-232 data directly as it uses TTL serial logic levels.  So, you have any form of converter in place or is this needed?

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 Duefectu

Duefectu

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 22 January 2013 - 03:50 PM

Thanks for your fast response Mark:

 

Unfortunately, the technical sheet is very poor, only one page without any tech details. But as you say, if Netduino is unable to handle RS-232 data, I thing I need a shield like this http://www.futurlec....32_TTL_3V.shtml to ensure compatibility. Is this correct?

 

Regards!



#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 22 January 2013 - 04:29 PM

Unfortunately, the technical sheet is very poor, only one page without any tech details. But as you say, if Netduino is unable to handle RS-232 data, I thing I need a shield like this http://www.futurlec....32_TTL_3V.shtml to ensure compatibility. Is this correct?

You would need to confirm the voltage levels on the RFID reader and verify that it is generating RS-232 voltage levels.  If it is then you will need a converter which can output 3.3V levels.  The one you mentioned looks like it operates at 3V rather than 3.3V and there is no link to a datasheet to verify how it works.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter






Also tagged with one or more of these keywords: serial, serial port, serialport, rs-232

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.