capture/repeat data ?


Closed Thread
Results 1 to 40 of 45

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    92

    Default

    Hey Ben,
    You were right, I had to switch the serial output of the PIC from the 2 pin on the DB9 cable to the 3 pin. But, that still didn't work so I then removed the 1k resistor that I had inline btwn the PIC and the DB9 and directly connected it to the 3 pin of the DB9 and it worked perfectly!

    Now I have to learn SERIN,the code I posted actually came from a post from Mister_e because it seemed perfect for my project (thank you Mister_e) and then I just changed the output data. But, when I try to send anything from hyperterminal to the 12F675 nothing happens,nothing in the terminal window will show up regardless of any key I press???

    Here is the actual code from Mister_e's post that I need help with getting the SERIN part working if anyone has some suggestions on why it's not working for me.



    '12F675
    @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
    DEFINE OSCCAL_1K 1
    INCLUDE "modedefs.bas"
    TX_Pin var GPIO.0 'To DB9 RX pin 2
    RX_Pin var GPIO.1 'To DB9 TX pin 3

    TRISIO.0 = 0 'Set GPIO.0 to output.
    TRISIO.1 = 1 'Set GPIO.1 to input

    ANSEL = 0 'disable ADCs
    CMCON = 7 'disable comparator

    AChar var byte
    tx_pin = 0 'inverted mode idle state

    achar="A"
    Pause 100 'OSC settle time...

    loop:
    SerOut tx_pin,N2400,["Waiting for ",achar,13,10]
    SERIN rx_pin,N2400,[achar]
    serout tx_pin,N2400,["Got it...",13,10]
    goto loop


    Thanks again, this is great!

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382

    Default

    When you communicate with a PC you are now working with RS232 which requires a MAX232 or other circuitry to convert to TTL (the elm devices uses that circuitry for serial in/out). However, with the elm device you are talking TTL and can connect directly to a pic. BTW you can eliminate all the serial circuitry between the elm and pic (you will still need to flip Rx in software or add circuitry to do it via hardware).

  3. #3
    Join Date
    Mar 2004
    Posts
    92

    Default

    Please check out this thread: http://www.picbasic.co.uk/forum/show...=hyperterminal

    This is where I found the code I'm trying and they say a MAX232 isn't needed and I can read the data from the 12F675 in hyperterminal with only a 1k resistor in line with pin 2 direct to the pc which is running hyperterminal.

    However, I cannot get anything to show up in hyperterminal when I try typing on that pc. Nothing that I type shows in the hyperterminal window regardless if the DB9 is connected to the 12F675 or not. This is the same pc that I've used to communicate with the elm322 and when doing that,I'm able to enter characters in the h/t window.

    I'm certainly not doubting your previous statement at all but the guys in the thread above seem to have it working without a MAX232 chip so I thought it would work with my pc (laptop).

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382

    Default

    The reason you see what you’re typing with the elm chip is because it is echoing the characters you’re typing.

    In HyperTerm under Properties, there is a Settings tab. Under that there is ASCII Setup button and a check box that says Echo Typed Characters Locally. Check that box and try it again.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    AND there's some chance it don't work as their internal OSC is sometime pretty poor. You may need to calibrate it AND/OR using the DEFINE OSCCAL_1K 1

    DEBUG is recommended for those nifty PIC.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Mar 2004
    Posts
    92

    Default

    Hi,
    I had tried the echo setting but nothing, I've tried every setting I can think of in H/T and still no characters show up in window.

    mister-e,I'm fairly sure I have the define already in the code.I think it's something with the H/T because no matter what I do, nothing.

    Does the tx line from the pc need to see a weak pull up or down or something before the typing will show up?

    I'm going to go see if I can find a MAX232 chip and try that.

    Thanks for your patience and help!

  7. #7
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382

    Default

    Tie CTS and RTS together.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

Members who have read this thread : 0

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