ON 20090305@10:48:04 AM at page:
On a web page you were interested in at:
http://www.piclist.com/piclist/index.htm#39876.4662731482
James Newton[JMN-EFP-786] removed post 39876.4662731482
|Delete 'preonrelt_75@mail.ru asks: "
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru"
I created a timer programme that counts from 0-99. How do i change this so that on 99 it activates an output (preferably a buzzer).
am using one of those circuit boards that have all the 7 segment displays input output on it. its a simulator
i will pay you $2 by paypal if this works. my email is azizmail@hotmail.co.uk
I beleive it just needs a small edit
i will test it at my collage. so i need a day to know if it works or not
This is my programme
;*******************************************************************
; TITLE: New 16C84 project
; AUTHOR:
; DATE:
;*******************************************************************
;State here what the program does
;*********************************************************************
; DEFINITIONS
;*********************************************************************
list P=PIC16C84, R=D ;Define PIC type and radix
;(H=Hex, D=Decimal). Hex numbers must
;be of the form 0xAA or 0AAh
include "P16C84.INC" ;P16C84.INC is a file containing
;definitions of PIC registers
;****** REGISTER USAGE ******
;For PIC16C84, user RAM starts at 0Ch. The following definitions
;(the names are arbitrary) will be found useful in many programs.
temp1 equ 0Ch ;Temporary register 1
temp2 equ 0Dh ;Temporary register 2
temp3 equ 0Eh ;Temporary register 3
count1 equ 0Fh ;Counter register 1
count2 equ 10h ;Counter register 2
count3 equ 11h ;Counter register 3
;*********************************************************************
; VECTORS
;*********************************************************************
;The PIC16C84 vectors live at the bottom of memory (0000h-0007h)
org 0000h ;Reset vector for PIC16C84 is at 0000h
goto start ;Go to main program start
org 0004h ;Interrupt vector for PIC16C84 is at
;0004h
goto inter ;Go to start of interrupt service
;routine
org 0008h ;first location available to programs
;*********************************************************************
; SUBROUTINES
;*********************************************************************
;By convention, subroutines are placed after the vectors so that they
;are at the bottom of memory. This avoids memory bank-switching for
;small programs.
;Code for subroutines goes here
;Delay subroutines 'onems'=1ms, 'quart'=0.25s, 'second'=1s
onems movlw 0F8h
movwf temp1
again1 nop
decfsz temp1,1
goto again1
nop
return
quart movlw 0F9h
movwf temp2
again2 call onems
decfsz temp2,1
goto again2
return
second movlw 04h
movwf temp3
again3 call quart
decfsz temp3,1
goto again3
return
;*********************************************************************
; MAIN PROGRAM
;*********************************************************************
;****** INITIALISATION ******
;Before using the I/O ports, the data direction registers must be set
;up. Bit RP0 in the status register selects either the normal register
;set when 0, or the special register set when 1. The data direction
;registers TRISA and TRISB live in the special register set. A '1' in
;these registers sets the corresponding port line to an Input, and a
;'0' makes the corresponding line an output.
start bsf STATUS,RP0
movlw b'11111'
movwf TRISA
movlw b'00000000'
movwf TRISB
bcf STATUS,RP0
loop movlw 01h
movwf PORTB
movlw 0Ah
movwf count1
next1 call second
decfsz count1,1
goto next1
movlw 03h
movwf PORTB
call second
call second
call second
movlw 04h
movwf PORTB
movlw 0Fh
movwf count1
next2 call second
decfsz count1,1
goto next2
movlw 02h
movwf PORTB
call second
call second
call second
goto loop
;*********************************************************************
; INTERRUPT SERVICE ROUTINE
;*********************************************************************
;The interrupt service routine (if required) goes here
inter
END ;all programs must end with this