I am a final year student in polytechnic and currently enrolled in diploma in mechatronics engineering. My fellow team member have picked to create a flame extinguishing robot. The problem is I can't find an example of project that implied this sensor(HAMAMATSU UV TRON) and I'am using an ATMEL C80951 Microcontroller to handle the control. I'am programming this robot using .HEX file that I created by using Notepad to create the .ASM file. Does anyone know how to use a pulse in programming using assembly code?Anybody?
This is an example of program that I created this program is used to provide the robot with wall evasion manuever:
CPU "8051.tbl"
incl "8051.inc"
org 0000h
START: JB P1.0,START ;JNB=A-High JB=A-Low
MOV A,#11111010b ;can be changed to any initial segment
MOV P0,A
sensor1: JB P1.3,sensor1 ;press to start shifting display
foward: MOV P0,A
;MOV A,P0
;JNB P1.3,brake ;JNB=A-High JB=A-Low When IR sensor hit a wall the motor start to brake and reverse afterwards
brake: Mov P0,#11111111b
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
reverse: mov P0,#11110101b
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
mov P0,#11111111b
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
mov P0,#11111010b
JMP sensor1
Delay: MOV R0,#255
LOOP1: MOV R1,#255
LOOP: DJNZ R1,LOOP
DJNZ R0,LOOP1
ret
end