View Full Version : Hyper Terminal Setting for TTL putput
ClayE
- 7th June 2008, 03:34
I can't get the output from a PIC 16F877A to appear correctly on hyper terminal. When I use the melabs LabX-1 board it works fine. I have moved the pic to a proto board that does not have the MAX232 chip, and I am using a 1K resistor on pin 2 of the DB9, and pin 5 is to ground. I understand that this make the signal inverted, so I changed the serout code for inverted.
with all lines set to T2400, this code works fine on the LabX-1 (with the MAX232).
when ran on the board without the MAX232, my understanding is that I need to change from T2400 to N2400. But when I do that I receive what appears to be symbol font or ???? on hyperterminal. I am setting hyperterminal to 2400-8-N-1, hardware flow control. I can't find anything on how to configure hyper terminal for TTL.
Serout PORTC.6,N2400,["********************",10,13] ' rs232 output
Serout PORTC.6,N2400,["* ce_ADCIN.BAS *",10,13] ' 10 and 13 are
Serout PORTC.6,N2400,["* v1.0 * 2/29/2008 *",10,13] ' return and LF
Serout PORTC.6,T2400,["* updated * 6/4/08 *",10,13] '
Serout PORTC.6,T2400,["********************",10,13] '
Serout PORTC.6,T2400,[10,13,10,13] '
Pause 500 ' Wait .5 second
Can anyone help?
Thanks,
Clay
skimask
- 7th June 2008, 04:14
There is no setting inverted or normal logic levels in Hyperterminal or on any other normal PC. It's straight RS232 or nothing.
Somehow I doubt that the code you posted is all there is.
What does the rest of your schematic look like?
What freq is your oscillator? How are your config bits set up?
Does your new 'protoboard' have a decent set of cap's across Vdd/Vss?
Put an LED on a pin...make a heartbeat LED...make sure your program at least looks like it's running correctly.
ClayE
- 7th June 2008, 05:19
So Skimask, am I correct to understand that hyperterminal will read the TTL signl OK if everything else is OK?
I'm not even sure if hypertermnal will read a TTL input or if TTL is intended for other types of devices.
I was trying to determine if the only code change I needed when using the 1K resistor instead of the MAX232 was to change the Serout command from the T prefix to the N prefix.
I programmed the PIC and ran it in the LabX-1 board. Blinking LEDs, output to a LCD, and rs232 output to hyperterminal. I used this to make sure the program was working properly. I then removed to PIC and inserted it into the board without the MAX232. The board without the MAx232 is a Picproto64 from microEngineering Labs. The only thing I added to the board was the 1K resistor between the RS232 transmit pin and the DB9. (I saw this on page 139 of the PicBasic Pro Compiler book.) I was trying to only add one new item at a time by testing the program out first on a purchased board. The components i put on the board without the MAX232 were a kit I purchased with the baord from microengineering Labs. The osc is 4MHz.
skimask, thanks for taking the time to reply. This is my first non-basicstamp project, so I appreciate the replies.
mackrackit
- 7th June 2008, 05:49
You should not have any problems without the inverter chip. N2400 is correct.
Like skimask asked, are you sure the PIC is running on the new board?
How long is the cable from PIC to PC?
skimask
- 7th June 2008, 06:13
Forget about what Hyperterminal wants for a minute, because basically, Hyperterminal doesn't want anything. You tell Hyperterminal what you want. Hyperterminal is only going to read what the serial port sends it at the baud rate and format YOU select in Hyperterminal, which in turn, sets the serial port to transmit/receive.
The PBP manual does a fairly decent job of explaining why, generally speaking, a MAX232 chip is not needed when using PICs (or most MCUs for that matter).
If the voltage levels coming into the serial port from the PIC without a level converter (MAX232) happen to fall within that serial port's high and low voltage specifications (which can and does ocassionally vary between manufacturers) levels, then, all else being equal, everything should work. If they don't, it won't.
ClayE
- 7th June 2008, 06:41
Thanks for the help. I have some work to do tomorrow. Your information has really helped. At least now I know that what I am trying to do will work if I do it correctly. It may sound funny, but that is a huge help.
Archangel
- 7th June 2008, 06:50
and I am using a 1K resistor on pin 2 of the DB9, and pin 5 is to ground. I understand that this make the signal inverted, so I changed the serout code for inverted.Clay. . . not quite, the resistor gives short protection if either p/c or pic pulls the serial line in opposite polarities, grounding pin 5 simply gives both the p/c and pic a common reference, GROUND. Now that said, setting N2400 does set the serial data to Inverted.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.