Another RS232 question...


Closed Thread
Results 1 to 5 of 5
  1. #1
    Christos_K's Avatar
    Christos_K Guest

    Default Another RS232 question...

    Hi all! Have being trying to send a message from a PIC16F786 to my PC..Have been using the following schematic that was found from the book of C. Hellebuyck "Programming PIC Microcontrollers with PicBasic".

    The code that I have been using is the following:
    -------------------------------------------------------------------
    include "modedefs.bas"

    define osc 10

    trisb = %00000010

    portb.0 = 1

    serout portb.1, t2400, ["hello", 10, 13]

    end
    --------------------------------------------------------------------

    In the seiral communications window of Microcode studio something is received but it is a set of characters rather than "hello"

    Is there something wrong with the code?

    What about the RS232 Cable connections??

    I am using the following configuration in my DB9 connector:

    Pins 1,6,4: short-circuit
    Pin 2: T2out
    Pin3: R2in
    Pin 5: Ground
    Pins 7,8: Short circuit
    Pin9: unused

    Would it be better to use the schematic as shown in Help/ICD etc.. of the Microde code studio help and HSEROUT instead? How should I have my DB9 pin configuration in this case?
    Attached Images Attached Images  

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    It's not like Chuck to leave things out, hmmmm!

    Well, this is what I use for RS232 Comm to PC.

    HTH,
       Darrel

    Added:
    Pin 6 = DSR "Data Set Ready"
    Pin 7 = RTS "Request To Send"
    Last edited by Darrel Taylor; - 30th May 2005 at 04:08.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Portb.1 is wired to the max232 TTL output. Portb.2 is wired to the max232
    TTL input.

    Try: serout portb.2, t2400, ["hello", 10, 13]
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Christos_K's Avatar
    Christos_K Guest


    Did you find this post helpful? Yes | No

    Default

    Have managed to make the circuit work! Another question though..I am using the rs232 port to receive the result from an a/d conversion measuring a potentiometer...is there any clever way instead of getting line after line the results to somehow clear the screen of the terminal so i can get only one message like "DC Voltage: xx" where only the xx value will change ?

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


    Did you find this post helpful? Yes | No

    Default

    if you have some hability with Visual Basic, you can do a simple terminal program in 10-15 minutes. Use MSComm and in MsComEvent when you receive EOT character (26) clear the text box you use to display your data.
    Steve

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

Similar Threads

  1. Universal remote and Rs232
    By Michael in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th February 2010, 17:55
  2. UART vs software RS232
    By Michael in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 5th September 2008, 18:27
  3. RS232 into 2 PC ports
    By manxman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th August 2008, 13:33
  4. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

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