PIC16F84 Line Follower Robot Project

| July 16, 2023 Updated
PIC16F84 Line Follower Robot Project

Line following robot is the thing to run on the line by controlling the motor of the left and right detected by light, such as infrared drawn in black (7m / m width or so) line. As illuminating the line, I put the light of the ordinary uses wheat balls of 3 volts instead of the infrared, we used (at the Akizuki) CDS with a diameter of 5m / m the sensor this time. The CDS ON motor twin motor gearbox controls the RB4, RB6 of port B sent to RA1, RA2 of port A of the PIC signal ON when out of the line, the signal OFF when applied to the line, and OFF. LED indicates the state.

Software is a thing of the ordinary, but is attached to the external interrupt RB0 port of B. Motor it indicates that you have entered the interrupt operation (about 30 seconds) LED stops flashing alternately once interrupt enters. The signal of the oscillation sound has placed it out of the RB7 of port B. These and there is not to the wiring, but so have been on board the bull’s-eye half board, you may want to experiment with a favorite circuit later. For example, I am such as to interrupt or light voice.

Line Follower PICmicro Project

cizgi-izleyen-maket-araba siyah-cizgi-takip-eden-robot-projesi

cizgi-izleyen-robot-flower-robot

Line Follower Robot Schematic

basit-cizgi-takip-eden-robot-projesi-pic16f84a-150x150

Source site: web1.incl.ne.jp Line Follower Robot Schematic pic assembly source code :

When compiling for the HEX file, the configuration will be as follows

.OSC RC; Oscillator type: RC

PWRT ON; Power-up timer: ON

.WDT OFF; Watchdog timer: OFF

.PROTECT OFF; Code protection: OFF
Following Robot Assembly Source Code


	LIST	P=16F84,R=DEC

INTCON	EQU	H'B'

STATUS	EQU	3

PG	EQU	5

PORTB	EQU	6

PORTA	EQU	5

TRISA	EQU	H'85'

TRISB	EQU	H'86'

PORTA_IN	EQU	H'11'	

WORK_REG	EQU	H'12'

WORK_STATE	EQU	H'13'

COUNTER		EQU	H'14'

COUNTER2 	EQU	H'15'

COUNTER3 	EQU	H'16'

COUNTER4 	EQU	H'17'



;**********************************

	ORG	0

	GOTO	START

	ORG	4

	GOTO	INT





;**********************************

;

;***********************************



START	BSF	STATUS,PG

	MOVLW	B'00110'

	MOVWF	TRISA

	MOVLW	B'00000001'

	MOVWF	TRISB

	BCF	STATUS,PG

	MOVLW	B'10010000'

	MOVWF	INTCON

	CLRF	PORTB



;************************************

;

;************************************



MAIN	MOVF	PORTA,0

	MOVWF	PORTA_IN

	MOVLW	B'00110'

	ANDWF	PORTA_IN,1

	MOVLW	B'00000'

	SUBWF	PORTA_IN,0

	BTFSC	STATUS,2

	GOTO	STR



	MOVLW	B'00010'

	SUBWF	PORTA_IN,0

	BTFSC	STATUS,2

	GOTO	RSTP



	MOVLW	B'00100'

	SUBWF	PORTA_IN,0

	BTFSC	STATUS,2

	GOTO	LSTP



	MOVLW	B'00110'

	SUBWF	PORTA_IN,0

	BTFSC	STATUS,2

	GOTO	STP



	GOTO	MAIN

	

;**************************************

;

;**************************************

STR	MOVLW	B'01011010'

	MOVWF	PORTB	

	GOTO	MAIN



RSTP	MOVLW	B'00011000'

	MOVWF	PORTB	

	GOTO	MAIN



LSTP	MOVLW	B'01000010'

	MOVWF	PORTB	

	GOTO	MAIN



STP	MOVLW	B'00000000'

	MOVWF	PORTB

	GOTO	MAIN

	



;****************************************

;	Interrupt processing

;*****************************************

INT	MOVWF	WORK_REG

	SWAPF	STATUS,W

	MOVWF	WORK_STATE

	BCF	INTCON,1

	

	CALL	SAB_TAIM



	SWAPF	WORK_STATE,W

	MOVWF	STATUS

	SWAPF	WORK_REG,F

	SWAPF	WORK_REG,W

	RETFIE





;******************************************

;	Interrupt subroutine

;******************************************

SAB_TAIM	

	CLRF	PORTB

	MOVLW	20

	MOVWF	COUNTER2



LOOP

	BSF	PORTB,1

	MOVLW	150

	MOVWF	COUNTER3

DLY1	BSF	PORTB,7

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	BCF	PORTB,7

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	DECFSZ	COUNTER3,1

	GOTO	DLY1



	BCF	PORTB,1

	BSF	PORTB,3



	MOVLW	150

	MOVWF	COUNTER4

DLY2	BSF	PORTB,7

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	BCF	PORTB,7

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	GOTO	$+1

	DECFSZ	COUNTER4,1

	GOTO	DLY2

	BCF	PORTB,3

	DECFSZ	COUNTER2,1



	GOTO	LOOP

	

	RETURN





;*******************************************

	END

;*******************************************

Published: 2009/01/23 Tags: , , ,



1 Comment “PIC16F84 Line Follower Robot Project

  1. Electronics CircuitsElectronics Circuits

    PIC16F877 Nixie Clock Circuit CCS C

    Nixie clock circuit software 16F877 ccs c prepared by the controller based on the display indicating that circuit anyway `at 2 Lamp made ​​with Nixie do not have any information about the project and schema files are available in source c

    In response to a request from a student, I made a Nixie clock using the Nixie tube. I have a lot of Nixie tube of Hitachi in hand, but I used the (NEC) LD-955A used this time. Driving circuit in the static display using the 74141, the control uses the PIC16F877 you are taught in school, I tried formed a soft CCS-C. Since using XTCO the main clock, it does not slip off one second even after one month.

    PIC16F877 CCS C Nixie Clock Project

    REPLY

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Comment moderation is enabled. Your comment may take some time to appear.