mixographer 2 Posted October 11, 2012 Share Posted October 11, 2012 First off, let me say thanks for Energia. I love it. I am having great fun with the Launchpad and Energia. I'm working on a project that uses the Hardware UART to communicate with a POS printer. Everything works great while I am connected via USB through the 'emulation' side. I have my RXD and TXD connected as shown in the wiki so they look a little like this =||| with the RX and TX perpendicular to the other three RST, TST and VCC. So far so good. I send data to the printer (via a max232) and it comes out on the paper. Maybe this is simple, and I'm just missing a key detail. If I disconnect the VCC and RST and TST, or disconnect all five jumpers on J3 Nothing comes out of the printer. I am powering the board off AA batteries. I have tried a few other programs to ensure that the rest of my setup is good. I can play music on a speaker, I can control some RGB LEDs, but I cannot send data out of those pins marked UART on the board. Can anyone point me in the right direction? My code is super simple, I've just written a little hello world to simplify everything: void setup(){ Serial.begin(9600); } void loop(){ Serial.print("Hello World"); Serial.write(0x0A); delay(20000); } The pins I'm using are P1.1 and P1.2 (marked UART) and they go out to a MAX232 board and then off to the printer. EDIT: I wanted to add I'm using the 2553 chip, not the 2452 and a 1.5 rev board. Thanks! Quote Link to post Share on other sites
gordon 229 Posted October 11, 2012 Share Posted October 11, 2012 Connect a USB-serial converter (FTDI cable, whatever) to on the RX and TX pins of J3 on the target side, RX is J3 pin 2, TX is J3 pin 3 (see the schematics and the board layout in SLAC437). mixographer 1 Quote Link to post Share on other sites
mixographer 2 Posted October 11, 2012 Author Share Posted October 11, 2012 Thanks for that. Forgive my ignorance, but so I'll need the ftdi chip to go from usb to TTL-level, then I'll go to the MAX232 to get my RS-232 level? Will I need to invert the TTL-level signal? Thanks. Jimmy Quote Link to post Share on other sites
SeuPay 17 Posted October 11, 2012 Share Posted October 11, 2012 Why a 20 seconds delay? it's a lot of waiting time to me. You will be using the reset button to send the message... :thumbup: mixographer 1 Quote Link to post Share on other sites
mixographer 2 Posted October 11, 2012 Author Share Posted October 11, 2012 I just wanted to see if it was printing, without printing it over and over and over 8-). I plug it in, see if it prints and then unplug it. I'm more concerned with getting an ftdi that's not surface mount, or a breakout that doesn't come with a USB connector. Maybe I should go software serial and use the MAX 232 I already have made? Quote Link to post Share on other sites
gordon 229 Posted October 11, 2012 Share Posted October 11, 2012 You need either the FTDI to go from TTL serial to USB or you need the MAX3232 to go from TTL to RS232 (I don't know if the MAX232 can cope with 3.3V, the 3232 can, IIRC). mixographer 1 Quote Link to post Share on other sites
SeuPay 17 Posted October 11, 2012 Share Posted October 11, 2012 Several comments: If you are turning ON the LaunchPad and the printer simultaneously, use a delay before sending the message, maybe the printer needs more time to begin the reception... LaunchPad VCC = 3.6 Volts Two AA batteries= 3.0 Volts or less Three AA Batt. = 4.5 Volts or less How do you power the MAX232 ? (Supply voltage range 4.5~5.5V). Setting time of the MAX232 after power on? If you are using a MAX232 is good practice to place a delay routine to ensure that the charge pump voltage has risen to its proper operating level. Logic levels betwen MAX232 and the launcPad? just ideas, trying to help... :thumbup: mixographer 1 Quote Link to post Share on other sites
mixographer 2 Posted October 11, 2012 Author Share Posted October 11, 2012 I'll take a look at the MAX232 datasheet. The MAX232 is in the circuit and works when I am using the 'emulation side' though, so I figured it works at 3.3v. Quote Link to post Share on other sites
SeuPay 17 Posted October 11, 2012 Share Posted October 11, 2012 Edited my last comment... may be useful. Quote Link to post Share on other sites
mixographer 2 Posted October 11, 2012 Author Share Posted October 11, 2012 Thanks SeuPay, I am powering the board off 2 AA (Alkalines) for ~3.0v. Those are going into the VCC and GND on the headers at J1 and J2. The board with the MAX232 is powered from the Launchpad from J6 VCC and GND. maybe J6 is pushing 5v when I'm on USB? Thanks for all the help on this. Quote Link to post Share on other sites
VirtualEnder 3 Posted October 12, 2012 Share Posted October 12, 2012 It sounds like the battery voltage is not enough to power the MAX232. Try plugging in to a USB wall charger rather than battery power. Unless there is some specific need to use battery, it's much more reliable. I'm assuming since this going right to the printer it will be near an outlet. mixographer 1 Quote Link to post Share on other sites
mixographer 2 Posted October 12, 2012 Author Share Posted October 12, 2012 Thanks for the comment. I think you are right. I'll run it off a usb wall wart with the emulation side connected for now. I was hoping to get it off the launchpad. But since I'm trying to get the whole project off the ground for Halloween, I'll just go with the power supply. Thanks. Quote Link to post Share on other sites
cde 334 Posted October 12, 2012 Share Posted October 12, 2012 Thanks SeuPay, I am powering the board off 2 AA (Alkalines) for ~3.0v. Those are going into the VCC and GND on the headers at J1 and J2. The board with the MAX232 is powered from the Launchpad from J6 VCC and GND. maybe J6 is pushing 5v when I'm on USB? Thanks for all the help on this. Nope, J6 VCC/GND is same as J1/J2 and J3 VCC/GND. There is no 5v source south of the emulator dotted line. That said, plenty of people run Max232 off 3.3v without issue. That's one of the main ways people got dd-wrt compatible La Fonera routers connected to serial. While it is recommended 5v, it works at 3v, but you suffer from possible reliability issues (and slightly lower output voltage, but within specs). Most of the time it's just cheaper to use a usb-ttl adapter, they are like 3 bucks on ebay (Actually, there are a bunch for like 1.80 or slightly more). Quote Link to post Share on other sites
jazz 209 Posted October 13, 2012 Share Posted October 13, 2012 As I understood, problem is in link between uC uart interface (MAX chip) and POS printer, when the uC is running on batteries? So, uC is sending data (by itself) over uart to printer, and printer is printing, without any connection to PC, right? In this case I don't understand for what on this topic FTDI need to be used? There is no need to have any connection to PC, only uC to POS printer? If I have the right picture, than solution for your problem, is in using some MAX chip that can work (by data sheet spec) in range 3.0V - 5V (not the standard MAX232 chip that you are using). For example, I am using MAX3243. And than connect Vcc/GND lines of this chip to MSP430 Vcc/GND lines, to be on same voltage. Quote Link to post Share on other sites
VirtualEnder 3 Posted October 13, 2012 Share Posted October 13, 2012 I think that 3.3V is enough to power the MAX232 but the margin is very close. 3.0V (or less depending on charge) seems to be below the margin. Using a wall wart will supply a constant 3.3V through the regulator that seems to be enough to trigger the logic on the MAX232. I think the FTDI entered the conversation as a way to allow you to program the chip without having the emulation side connected in order to save power if using a battery. The MAX3232 might be a valid option to allow the device to work on the battery running at or below 3.0V. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.