+ Reply to Thread
Results 1 to 4 of 4

Thread: C program on PIC to send data via RS232

  1. #1
    HiJack Newbie
    Join Date
    Mar 2009
    Posts
    5

    C program on PIC to send data via RS232

    Greetings guys,

    I am using PIC to send data via RS232 to a computer, and I am using C to program the chip. However, I don't know how to write this program. Is there any special fuction or instructions in C library? By the way, I am using HyperTerminal on the computer to receive data.

    Also, do I need to worry about ASCII format when I send the data?

    Any help will be most appreciated. Thanks guys.

    Best regards,
    HiJack


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,372

    Can't help you with C, but my tutorials show how to do it in assembler - regardless though, I would suggest you send the data as ASCII rather than binary.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #3
    3v0
    3v0 is offline
    3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent 3v0 Excellent
    Join Date
    Jul 2006
    Location
    USA
    Posts
    6,399
    Blog Entries
    11

    Have you check the compiler manual for examples. Many of them provide one ths shows how to setup the uart and send the data. It is only a few lines of code.

    You did not tell us which compiler or PIC you are using.

    3v0
    Please post questions to the forums. PM's are for personal communication.

    BCHS/3v0's Tutorials
    Junebug USB PIC programmer kit., USB Bit Whacker,
    The 15 Minute Printed Circuit Board! (+drill time)

  4. #4
    HiJack Newbie
    Join Date
    Mar 2009
    Posts
    5

    Hi guys,

    Thanks for kind help. Good news, I finally got it working.

    The circuit that I built is definitely working, the problem was HyperTerminal, which has some compatible issues with Vista. I searched for other serial port logging software and I found this:
    Free Serial Port Logger : RS232 Port Logger Software - Serial Data Logger
    It is called RS232 Data Logger and it is free.

    Now, for people who is new with Vista and if you are using a USB-to-Serial(DB9) cable, make sure you have the cable on Prolific brand. It provides driver on Vista system and it is definitely working.

    Regards,
    HiJack

+ Reply to Thread

Similar Threads

  1. how send serial data with PIC
    By HCT-Pirate in forum Micro Controllers
    Replies: 7
    Latest: 3rd February 2008, 05:27 PM
  2. Replies: 12
    Latest: 24th May 2007, 05:03 PM
  3. send data via uhf
    By elctrochania in forum Electronic Projects Design/Ideas/Reviews
    Replies: 14
    Latest: 16th November 2005, 03:17 PM
  4. send data via uhf
    By elctrochania in forum Micro Controllers
    Replies: 1
    Latest: 15th November 2005, 01:47 AM
  5. rs232 to rs232 data logger with 1meg buffer -help needed
    By ccaammaaccaazzii in forum Electronic Projects Design/Ideas/Reviews
    Replies: 11
    Latest: 20th October 2004, 10:43 PM

Tags for this Thread