Shop OBEX P1 Docs P2 Docs Learn Events
UART and Hyperterminal — Parallax Forums

UART and Hyperterminal

Don FrenchDon French Posts: 126
edited 2007-01-26 15:36 in General Discussion
I have been trying to get the UART example HyperTermCOM.java to work with the MS Hyperterm program with no success.· So, what could I be doing wrong?· Here is the code of HyperTermCOM:


import stamp.core.*;
public cl(expletive) HyperTermCOM {························ // COM Port (9-pin serial)
· final static int SERIAL_TX_PIN = CPU.pin0;······· //···· 2
· final static int SERIAL_RTS_PIN = CPU.pin1;······ //···· 7
· final static int SERIAL_CTS_PIN = CPU.pin2;······ //···· 8
· final static int SERIAL_RX_PIN = CPU.pin3;······· //···· 3

· static Uart txUart = new Uart( Uart.dirTransmit, SERIAL_TX_PIN, Uart.dontInvert,
························· SERIAL_RTS_PIN, Uart.dontInvert, Uart.speed9600,
························· Uart.stop1 );
· static Uart rxUart = new Uart( Uart.dirReceive, SERIAL_RX_PIN, Uart.dontInvert,
························· SERIAL_CTS_PIN, Uart.dontInvert, Uart.speed9600,
························· Uart.stop1 );

· static StringBuffer buffer = new StringBuffer(128);
· static char c;
· static void bufferMessage(){
··· c = 0xff;
··· while (c != '\r'){
····· if(rxUart.byteAvailable()){
······· c = (char)rxUart.receiveByte();
······· buffer.append(c);
····· }
··· }
· }················································· // end bufferMessage
· public static void main(){
··· do{
····· buffer.clear();
····· txUart.sendString("Type a message, the press enter: \n\r");
····· bufferMessage();
····· txUart.sendString("The message you sent was: \n\r");
····· txUart.sendString(buffer.toString());
····· txUart.sendString("\n\rDo you want to enter another message? (y/n) \n\r");
····· c = (char) rxUart.receiveByte();
··· } while(c == 'y' || c != 'n');
··· txUart.sendString("Goodbye!\n\r");
· }················································· // end main
}··················································· // end cl(expletive) declaration

I could not find where in the documentation·the IO pins that are attached to the onboard COM port on the Demo board are defined, but I am (expletive)uming that the ones in the example are right.· Correct?

In Hyperterminal, I have the following settings:· COM1 9600 baud 8-N-1 Hardware

But I don't get anything in the Hyperterm window and it does not show what I type.· What am I doing wrong?

·

Comments

  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-01-26 06:21
    Are you using a 'Full' serial cable - may be that you are using a Null Modem cable ?

    I have used routines for null modem (3wire - rx,tx,gnd) - on·my own circuits with·no issues

    static Uart txUart = new Uart(Uart.dirTransmit,
    CPU.pin0, Uart.invert,Uart.speed9600,Uart.stop1 );


    with this example - hyperterminal is set to 9600,n,8,1 - none

    Post Edited (QuattroRS4) : 1/26/2007 6:30:49 AM GMT
  • Don FrenchDon French Posts: 126
    edited 2007-01-26 06:53
    Ok, I found where to echo what I type but I get nothing back. Plus, it takes a long time to (several seconds) echo characters. And I never get anything from the Javelin.

    P.S. I can't believe that this forum converts every occurance of a-s-s to (expletive), even when it is included in the middle of a word. I (expletive)ume that is to protect our youth, who will be corrupted by reading the word a-s-s? Save me!
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-01-26 07:24
    I suppose the expletive delete is to protect the young hobbyist·!

    What serial cable are you using, Is it a homebrew board or kit ?

    did you try a simple send from the javelin to hyperterminal ?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-01-26 07:26
    The expletive thing is since yesterday, I think because of this thread
    http://forums.parallax.com/showthread.php?p=626089
    because it never happened before.

    To make the javelin work with a pc com port you need to wire
    javelin I/O pins to a rs232 level shifter, like the SP237 onboard
    the javelin demoboard or a max232 (or alike).

    regards peter
  • Don FrenchDon French Posts: 126
    edited 2007-01-26 15:10
    No, as I said, this is the Javelin Demo board I am talking about. And I am using a standard PC serial cable, the same one I use to program the Javelin on the Javelin Demo board. I thought that the COM port on the demo board was already wired and ready to go. Am I mistaken? Isn't the hyperterm example supposed to work with the COM port. And I am not trying to use the same port that I program the Javelin with, rather the other one that is at right angles to it. I ask again, are the Javelin pins that are (expletive)igned in the example the correct pins for this COM port? Where in the documentation would that be stated?
  • Don FrenchDon French Posts: 126
    edited 2007-01-26 15:15
    Quattro, what do you mean by "Did I try a simple send from the Javelin to hyperterminal?" Isn't the send from the HyperTermCom.java program a simple send?

    P.S. Would the moderator please turn off that stupid expletive thing? No kids are harmed by reading the word a-s-s. And when it is embedded inside another word,even!!! My Lord!!!
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-01-26 15:25
    The serial port labeled COM is not standard wired to any javelin I/O pin.
    (The program port is labeled JIDE)
    see manual page 64 and further. (Communicating with other computers).

    You need to supply connections between connectors X2 and X4 (figure 4.8b)

    regards peter
  • Don FrenchDon French Posts: 126
    edited 2007-01-26 15:36
    I was blind, I guess.· Thanks!
Sign In or Register to comment.