Line follower

Thread Starter

cpleng7

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

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
 

Nanophotonics

Joined Apr 2, 2009
365
Last edited:

Thread Starter

cpleng7

Joined Dec 18, 2008
120
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?
 

Nanophotonics

Joined Apr 2, 2009
365
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:

Markd77

Joined Sep 7, 2009
2,796
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.
 

Thread Starter

cpleng7

Joined Dec 18, 2008
120
I not using the digital type , May I know what extra circuit that I need?
 

symqwerty

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