Author Topic: Hamamatsu UV Tron pulse  (Read 1856 times)

0 Members and 1 Guest are viewing this topic.

Offline Rothman85Topic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Hamamatsu UV Tron pulse
« on: November 10, 2008, 01:15:07 AM »
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











« Last Edit: November 10, 2008, 01:29:01 AM by Rothman85 »

Offline sdavis6736

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: Hamamatsu UV Tron pulse
« Reply #1 on: November 10, 2008, 03:46:41 AM »
First you need to set the port, then the data direction register for that port to an output.  Then use the bset and bclr commands.  There are quite a bit of assembly language tutorials on the net.  Check them out, they are very helpful.

 


Get Your Ad Here