send data from pc(Visual Basic) to pic16f877a through serial port(DB9)


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,623


    Did you find this post helpful? Yes | No

    Default

    Have a look here

  2. #2
    Join Date
    Aug 2008
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    thanx man...

  3. #3
    Join Date
    Aug 2008
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    here's the code for micro controller:

    PinNumber var byte
    PinState var byte

    Main:

    ' Use the programming port to receive
    ' data at 2400 baud
    ' Wait for the synch byte (255) and then
    ' get the PinNumber and PinState
    Serin 16,16780,[WAIT(255),PinNumber,PinState]

    ' If PinState=0 Then go to GoLow
    ' otherwise go to GoHigh
    Branch PinState,[GoLow,GoHigh]
    Goto Main


    ' Set The pin low
    GoLow:
    LOW PinNumber
    Goto Main


    ' Set the pin high
    GoHigh:
    HIGH PinNumber
    Goto Main
    END

    i have problem when compile it....the 'Serin 16,16780,[WAIT(255),PinNumber,PinState]' appear as bad expression...why is it???

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,623


    Did you find this post helpful? Yes | No

    Default

    Hi,
    i have problem when compile it....the 'Serin 16,16780,[WAIT(255),PinNumber,PinState]' appear as bad expression...why is it???
    That's probably because WAIT isn't supported by the SERIN command, you'd need to change that to SERIN2 i think.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Or might be because PIN 16 is not a valid pin , funny I have never used PINs always used PortA, PortB etc . . less confusing I guess . . . anyway only 0-15 are valid: SEC. 4.11. PINS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Aug 2008
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    so what is your suggestion joe s.????

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    HenrikOlsson and Joe are saying change your code from
    Code:
    Serin 16,16780,[WAIT(255),PinNumber,PinState]
    to
    Code:
    SERIN2 PORT?.?,16780,[WAIT(255),PinNumber,PinState]
    Seems to work much better using for example:
    PORTC.3
    instead of
    PIN?
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 05:47
  2. Replies: 2
    Last Post: - 24th August 2008, 21:03
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 15:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 29th November 2004, 00: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