computer controlled car


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2005
    Posts
    12

    Lightbulb computer controlled car

    hey
    can anyone help!
    i m using PIC16F84 to control a car
    i need to send a byte through A0 and get it out on port b(b0...B7)
    can anyone help with the code?
    thx

  2. #2
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    You can have my source code but there is still a bug in the
    subroutine for sensing the distance of the car ahead....



    Luciano

  3. #3
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    ROTFLMAO

    I think its a stack error
    Keith

    www.diyha.co.uk
    www.kat5.tv

  4. #4
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Talking Phew!

    G wiz that's some bug in that software. It was a shame you could have not done a dummy run on the run way and not the highway you don't seee many like that, that sure is a fine balancing act.

    On that note i think i forget my idea on controlling a car with a pic LOL

    chuck

  5. #5
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by elios115
    ... i need to send a byte through A0 .....
    Do you mean the PIC16F84 receives the data through RA0?
    If yes, could you please describe the device sending the data?

    Luciano

  6. #6
    Join Date
    Dec 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Lightbulb computer controlled car

    in fact a vb code sends 4 bytes for controlling the for direction of the car!
    the byte goes out from the serial port of the pc and goes into the PIC through A0.
    then this byte should be outputed on port b of the pic(b0...b7)!

    the algorithm is as follows: the pic receives the byte bit by bit through A0.
    it stores the byte in a register and then output it on port B

    the problem is teh code! can anyone help?

  7. #7
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,


    From the PicBasic Manual "SERIN"

    While single-chip RS-232 level converters are common and
    inexpensive, the excellent I/O specifications of the PICmicro
    MCU allow most applications to run without level converters.
    Rather, inverted input (N300..N9600) can be used is conjunction
    with a current limiting resistor.

    * * * *

    Q1: Are you using a RS-232 level converter like the chip
    MAX232 (RS232>TTL & TTL>RS232) or just a current limiting resistor?


    Q2: What is the used baud rate? (1200, 2400, 9600)

    * * * *

    Best regards,

    Luciano

    Example of circuit using a MAX232:

  8. #8
    Join Date
    Dec 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Lightbulb compter controlled car!

    yea i m using the max232 chip and i m using the 9600 baud rate!
    the serin can be modified for my purpose but i need how?

  9. #9
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    ========================================
    5.68. SERIN

    SERIN
    Pin,Mode,{Timeout,Label,}{[Qual...],}{Item...}

    Receive one or more Items on Pin in standard asynchronous format
    using 8 data bits, no parity and one stop bit (8N1). SERIN is similar to
    the BS1 Serin command with the addition of a Timeout. Pin is
    automatically made an input. Pin may be a constant, 0 - 15, or a
    variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g.
    PORTA.0).
    ========================================

    With the SERIN command you can receive one or more Items.
    Declare four variables for your four bytes. These four
    variables will be the "Items" of the SERIN command.

    Read the PicBasic Pro manual, search this forum.
    If you need help, post your code and the members of this
    forum will help you to fix your code.


    Best regards,

    Luciano

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,796


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by elios115
    the algorithm is as follows: the pic receives the byte bit by bit through A0. it stores the byte in a register and then output it on port B

    the problem is teh code! can anyone help?
    Maybe something like this?

    SERIN 1,N2400,[“A”],B0 'Wait until the character “A” is received serially
    'on Pin1 and put next character into B0
    portb=B0

    This is on the manual, page 99.

    Ioannis

Similar Threads

  1. Car radio (Car radio and electronics support forum)
    By freewillover in forum Forum Requests
    Replies: 1
    Last Post: - 1st July 2009, 20:41
  2. Getting rid of noise of car battery/alternator
    By passion1 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 9th March 2008, 06:11
  3. Slot Car timer with pic 16f84a
    By Snap in forum Serial
    Replies: 4
    Last Post: - 5th July 2007, 05:58
  4. Need help with RC car code
    By rey1867 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th June 2006, 01:18
  5. Remote Car Starter Safety
    By CocaColaKid in forum General
    Replies: 8
    Last Post: - 22nd November 2005, 10:10

Members who have read this thread : 1

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