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

POS Printer serial communication issues

serial rs232 garble baudrate

  • Please log in to reply
5 replies to this topic

#1 dcypher

dcypher

    Member

  • Members
  • PipPip
  • 17 posts

Posted 01 June 2013 - 07:51 AM

I'm trying to hook up a stock POS printer (OKI PT330) to my N+. So far without luck. I get garbled text. I can put the printer i a HEX debug mode, and the characters I get are not the same as a send. The printer is hooked up via an rs232 connector with the following pins N+ RS232 (25PIN) 0 - 2 1 - 3 Gnd(14) - 1 Looking in various trouble shooting guides leaves me with the following causes : 1. Baudrate issue I've have the the baud rate to 115200 on both printer and n+. Selecting a lower rate eg. 19200 does make the garble slower. 2. Parity, stopbit and bits. Also the settings here match I've tried both 8NONE1 and 7EVEN1 same issue. 3. Serial port crystal frequency. Some guides mention this and recommends setting the frequency to 14.34Mhz for PCI based rs232 ports. I don't know if this is at all an issue with Netduino, and I can't find any info on how to adjust this. I've used serial connections for the smaller SparkFun thermal printer, and it worked like a charm. Does anyone have any ideas on this?



#2 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 01 June 2013 - 09:57 AM

is the printer serial voltage levels TTL or RS-232?  voltmeter can help here.

 

also, I find one of those FTDI USB serial adapters most handy for debugging; you can tap the data between your netduino and your printer to see what's really being sent.  and you can send stuff directly to the printer as a sanity check on it's config.

 

lastly, and it's probably a stretch, but one device I interfaced with used inverted serial, and I most definitely got garbage until I figured that out.  this is a less common configuration, but it makes a little sense when you realize that line drivers are often also functionally inverters.  voltmeter can help here too.



#3 dcypher

dcypher

    Member

  • Members
  • PipPip
  • 17 posts

Posted 01 June 2013 - 08:11 PM

Hi Zigg, 

 

Thanks for the answer. I've moved the GND to PIN 7 on the RS232 plug for the printer. It should be SIG GND but no improvement. 

Between the printers TX and SIG GND there is 9.8V and 0V between RX and SIGGND. So I asume that this is not a TTL port and the wireing is not crossed correct. Shouldn't a 25pin serial port that the printer have , always be a rs232?

 

I'm still getting garbled results. I've tried to move to pin 11 and 12 but no result either.



#4 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 01 June 2013 - 08:30 PM

I would avoid connecting it to your netduino until some things are straightened out!

 

The netduini have 5v tolerant inputs, but I don't know about +/- 9v!  Need to get that level shifted to TTL (or 3.3v) first.

 

Yes, a serial printer that is all packaged up to be connected to a PC should have RS-232 (nominally +/15v, but can be as low as +/-3v), since that is the expectation; and this is why I asked.  Printer 'cores' (e.g. that don't have a case), may well not have the rs232 drivers either, since that is more convenient for interfacing with other stuff, which is presumably why you would buy a 'core' in the first place.

 

You can do some things:

*  use ye olde MAX232 to convert from TTL to RS-232.  Very popular device.

*  you could make some converter out of discretes, but you'll need to get the higher, bipolar, voltage from somewhere (which is what makes the max232 popular:  it creates these from 5v with a charge pump)

*  you could be bold, and open up your printer, and find where the TTL side of things are.

 

If you only connected the TX of your netduino to the RX of the printer, you surely didn't damage anything.  If you also connected the RX of the netduino to the TX of the printer, you might have, but who knows.  If you want to do a sanity check, you could jumper your netduinos TX to RX and send a little data and verify it reads back correctly.  But regardless, you need to get your signal levels right, first.



#5 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 02 June 2013 - 06:33 PM

Also check you don't need to invert your rx and TX lines I.e. Feed it through a Schmidt inverter. Also check that you don't need to ground the chasis of the printer if its an oem printer assembly. Nak.

#6 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 02 June 2013 - 06:34 PM

Also check you don't need to invert your rx and TX lines I.e. Feed it through a Schmidt inverter. Also check that you don't need to ground the chasis of the printer if its an oem printer assembly. Nak.




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.