HyperTerminal


Closed Thread
Results 1 to 7 of 7

Thread: HyperTerminal

  1. #1
    Tomas's Avatar
    Tomas Guest

    Post HyperTerminal

    Hi everyone,

    I downloaded the code below and run it, i was expecting to see the msg "Hello World" but nothnig came up. I'm not sure if the problem is with my PIC16F877 running with 4MHz or HyperTerminal.
    I think the PIC is sending the data, as the LED connected to TX (pin 25, PORTC.6) is falshing continously. However the receive pin of the DB-9 connecter (pin 2) is HIGH all the time and don't know what that means.
    HyperTerminal is set to 9600- 8-N- 1
    I'm just wondering if i'm supposed to see the output on the Terminal? And if not how can i test/ see the result?

    Cheers,
    Tom


    Define LOADER_USED 1

    Include "modedefs.bas" ' Mode definitions for Serout


    loop: Serout2 PORTC.6,16468,["Hello",10,13] ' Display "Hello", next line
    Pause 500 ' Wait .5 second

    Serout2 PORTC.6,16468,["World",10,13,10,13] ' Display "World", skip a line
    Pause 500 ' Wait .5 second

    Goto loop ' Do it forever
    End

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Hi Tom,

    you don't need to include "modedefs.bas"
    (it does neither help nor hinder)

    Mode 16468 ($4054) means 9600 8N1 driven inverted.

    This mode is ok if you connect PORTC.6 of the PIC directly to the RX Pin (Pin 2) of the DB9 connector
    (no RS232 driver)


    I think the problem is caused by the LED you have connected to that Pin, the LED is drawing too much power from the PIC output.

    The PC-COM-Port is expecting RS232 levels (+/- 10V)
    most COM-Ports work with TTL-levels from a PIC when connected directly to the PIC.

  3. #3
    Tomas's Avatar
    Tomas Guest


    Did you find this post helpful? Yes | No

    Post HyperTerminal

    Hi,
    I have tried it as you mentioned. I just ignored my MAX232 and connected PORTC.6 direct to pin 2 of the DB-9 connecter. The result was the same (no data has shown). The LEDs were disconnected.
    I think the problem might be with the HyperTerminal, not sure how to use it, do u think it is enough to just specife the boudmode and wait the msg to show up? How about the modem protocols and all those settings?

    Cheers,
    Tom

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    If you are using an RS232 driver (i.e. MAX232) you need to use a different mode (TRUE instead of inverted)

    For 9600 8N1 this would be 84 ($54)

    What is your clock speed ? 9600 Baud won't work with a 4MHz Crystal.

    Try 4800 Baud Mode $40BC (inverted) $00BC (true)

    rgds

  5. #5
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Thomas,

    No expert here, but you probably want a current limiting resistor between the PIC output (C6) and the PC. Otherwise the PIC is trying to pull-down the 'iddle' level (which I believe to be +12V) to ground (not a good idea). The manual (PBP) suggests 1k in series, I have used this with many other PICs before and it has worked with no problems. SEROUT2 assumes 4MHz clock, which is what you're using, so you should have no problem there. Is the C6 output an open-drain, or analog type (I do not have the datasheet available). If so, you have to use either a pullup or define it as a digital IO (whichever the case may be).

    Good luck,

    languer.

  6. #6
    Tomas's Avatar
    Tomas Guest


    Did you find this post helpful? Yes | No

    Unhappy HyperTerminal

    Hi again,

    Have tried with 4800 Baud, behavs a bit different as the LEDs connected to PORTC.6 and pin 2 of the DB-9 connecter fashes (the LEDs were connected for only test purpose). The thing is i still cann't see the output.
    Can't tell where the fault is (PIC16F877 -> MAX232-> DB-9) com3 is used.
    What am i missing? Please help

    Thanks,
    Tom.

  7. #7
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Hi Tom,

    what crystal are you using ?

    have you DEFINEd it ?
    (important for correct baud-rate generation)

    DEFINE OSC 8 ' for 8 MHz crystal

    connecting the PIC via MAX232 to your PC is actually the right way.

    Then you need to Set a "TRUE" Mode because the MAX232 does the inversion for you.

    Here some MODEs:

    300 Inverted $4CF1 True $0CF1
    1200 Inverted $432D True $032D
    2400 Inverted $418C True $018C
    4800 Inverted $40BC True $00BC
    9600 Inverted $4054 True $0054


    If you see nothing at all in your hyperterm window do the following tests:

    1. Hyterterm, COM-Port, Serial Cable

    put a jumper between Pin 2 & Pin 3 of the COM-Port you are intend to use for the communication (connect RX & TX)
    Start Hyperterm, and type something on your keyboard.
    you should see the characters you typed in your hyperterm window.
    If you have enabled the "LOCAL ECHO" option in Hyperterm every character you typed should appear twice, with LOCAL ECHO OFF only once.
    (Disconnect the Jumper and see the difference)

    If this is OK you can be sure your Hyterterm, COM-Port and Serial Cable is OK.

    2. MAX232

    a TTL-HIGH Level (+5V) on one of the MAX232 TTL Inputs should give - 10 to 12V on the corresponding RS232 output

    a TTL-LOW Level (0V) on one of the MAX232 TTL Inputs should give + 10 to 12V on the corresponding RS232 output

    have you connected GND to Pin 5 of the DB9 Connector ?

Similar Threads

  1. Reading PIC serout in hyperterminal
    By financecatalyst in forum Schematics
    Replies: 5
    Last Post: - 22nd October 2009, 15:13
  2. load .hex file in PIC with hyperterminal
    By irenuska23 in forum General
    Replies: 8
    Last Post: - 1st September 2009, 09:52
  3. interactive menu with hyperterminal
    By jamied in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 5th January 2009, 11:13
  4. Hyperterminal problem
    By DR.Larq in forum Serial
    Replies: 2
    Last Post: - 9th May 2008, 18:40
  5. Replies: 1
    Last Post: - 30th March 2008, 15:53

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts