need sample code for serial port(DB9) from PIC16F877A to VB 2008 ?

Discussion in 'Embedded Systems and Microcontrollers' started by pink bunny, Feb 27, 2010.

  1. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0
    hello,

    pls help me......
    i hve a project which i hve to control the climate rate with sensor that been connect to PIC16F877A using DB9. and from the PIC16F877A to VB 2008.
    can someone help me to create a code to display the sensor rate at the textbox in VB 2008? how?


    pls help me................
    someone................


    :(
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,867
    992
    You don't give any specifics on what kind of help you need.

    There is tons of code and sample projects out there that deal with Rs232.


    You will want to look at a MAX232 chip for your interface.
     
  3. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0
    i dun hve any circuit or start my program yet...........
    i need a coding which the rate of a sensor can be read in a textbox using serial port.....
     
  4. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0
    need a sample of code for vb.net................
    pls help me...............
     
  5. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0




    thanks.............
    i just wanna ask............
    do i need the both of it which are rs232 and max232 or i only need max232...?????
     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Rs232 is the protocol:
    http://en.wikipedia.org/wiki/Rs232

    and MAX232 is a popular chip which converts from microprocessor voltage levels to the RS232 standard (and inverts the signal).
     
  7. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0


    markd77, so i need both to interface with pc?????
     
  8. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0
  9. pink bunny

    Thread Starter New Member

    Feb 27, 2010
    7
    0
    hello spinnaker,

    pls tell me do i need both of the RS232 and Max232 to interface to PC????
     
  10. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,867
    992

    Yes and no.

    RS232 is an interface standard. It is already a part of your PC's serial port. So yes you need it but it is already supplied by your PC.

    But you must design your PIC circuit so that it complies with RS232. This is what the MAX232 will help do for you.



    Your questions tell me you are not very experienced with PICs. If you have not written a simple program to have the PIC turn on an LED. You might want to start there.

    You can then move on to more complicated things like interfacing to RS232.

    Or instead of using a PIC, you should consider using an Arduino board. Much of the circuitry for RS232 is already done for you.
     
  11. symqwerty

    Member

    Feb 22, 2010
    31
    0
    I hv the code that you asking for. It's fairly easy since you use VB.NET. However, have you get your hardware ready?

    Let's divide it into 2 groups, hardware and software. I guess that you know how to program your PIC ( i can give u the code but it written in C ) and what you need is to read data from the PIC and displayed on the textbox, right?

    On hardware portion, you have options to choose either to use MAX232(plus DB9 connector) or FT232R chip( it is rs232 to usb converter ). the 1st option already mention by other forumer. The 2nd option allows you to use USB port as a virtual comport (or RS232). Don't worry about the software part because we will treat it the same way.
     
Loading...