Line follower

Discussion in 'Embedded Systems and Microcontrollers' started by cpleng7, Feb 7, 2010.

  1. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    can someone tell me how should i start to write the line follower in assembly language. Currently I am using PIC16F877.
     
  2. Nanophotonics

    Active Member

    Apr 2, 2009
    365
    3
  3. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    Thank you Nanophotonics.

    But can some one tell me how this work in assembly language? is that we can test 4 bit in a time?
     
  4. Nanophotonics

    Active Member

    Apr 2, 2009
    365
    3
    Last edited: Feb 9, 2010
  5. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    Once a time thank for nanophotonics reply.

    actually I know the assembly language, but the things is how to program the infra red sensor is the problem. i don't know when will it be receive the signal.

    let say i using 4 IR sensor together for the robot line following purpose. is that the PIC 16F877 microcontroller will receive the signal in the same time? how could I test the bit? if i just use btfss / btfsc instruction for the retrieve the IR signal data?
     
  6. Nanophotonics

    Active Member

    Apr 2, 2009
    365
    3
    OK. Strictly speaking, you can't monitor 4 bits at the same time. The program would actually have to scan the sensor data lines one by one, but it would do it so fast that it would appear as if you were scanning all the 4 bits. That obviously will depend on your clock frequency (4 MHz is typical). If your sensor has a digital output, then interfacing with the PICmicro is easy, otherwise you might need additional interfacing circuits.
     
    Last edited: Feb 10, 2010
  7. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    That's probably the simplest way of doing it. A slightly better way would be to read the port to a temporary location and then do the bit tests on that. That way if something changes in between tests (and it will) it doesn't affect the result.
     
  8. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    I not using the digital type , May I know what extra circuit that I need?
     
  9. Nanophotonics

    Active Member

    Apr 2, 2009
    365
    3
    Last edited: Feb 10, 2010
  10. symqwerty

    Member

    Feb 22, 2010
    31
    0
    I hv seen many threads which is similar to this topic. If possible, just spend some time to read another thread..
     
Loading...