Code:
; PROGRAM FUNCTION:The state of an LED is toggled every second and a
; buzzer sounds for one second every five seconds.
list P=16F72
include "c:\PIC\_inc\P16F72.inc"
__config _XT_OSC & _WDT_OFF & _CP_OFF
;============
; Declarations:
porta equ PORTA
portb equ PORTB
Mark30 equ 08
Post80 equ 09
_5Second equ 0A
org 1FF
goto Start
org 0
;============
; Subroutines:
Init clrf porta ; resets inputs and outputs
clrf portb ;
bsf STATUS, RP0
movlw b'00000' ; RA0: LED, RA1-3: not connected
movwf TRISA
movlw b'00000000' ; RB0: buzzer, RB1-7: not connected
movwf TRISB
bcf STATUS, RP0
movlw b'00000111' ; sets up timing register
option
movlw d'30' ; sets up marker
movwf Mark30 ;
movlw d'80' ; sets up first postscaler
movwf Post80 ;
movlw d'5' ; sets up 5 seconds counter
movwf _5Second ;
retlw 0
;============
; Program Start:
Start call Init
Main movfw Mark30
subwf TMR0, w
btfss STATUS, Z
goto Main
movlw d'30'
addwf Mark30, f
decfsz Post80, f
; if(Post80 != 0) {
goto Main
movlw d'80'
movwf Post80
comf porta, f
bcf portb, 0
decfsz _5Second, f
goto Main
bsf portb, 0
movlw d'5'
movwf _5Second ;
goto Main ; loops back to start
END
gives errors:----------------------------------------------------------------------
Release build of project `C:\PIC\Double Timing\time_.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.35, mplink.exe v4.35
Thu Jun 24 18:15:48 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F72 "time_.asm" /l"time_.lst" /e"time_.err"
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 9 : Found label after column 1. (porta)
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 10 : Found label after column 1. (portb)
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 11 : Found label after column 1. (Mark30)
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 12 : Found label after column 1. (Post80)
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 13 : Found label after column 1. (_5Second)
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 19 : Found label after column 1. (Init)
Message[302] C:\PIC\DOUBLE TIMING\TIME_.ASM 23 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\PIC\DOUBLE TIMING\TIME_.ASM 25 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[224] C:\PIC\DOUBLE TIMING\TIME_.ASM 28 : Use of this instruction is not recommended.
Warning[219] C:\PIC\DOUBLE TIMING\TIME_.ASM 30 : Invalid RAM location specified.
Warning[219] C:\PIC\DOUBLE TIMING\TIME_.ASM 32 : Invalid RAM location specified.
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 38 : Found label after column 1. (Start)
Warning[207] C:\PIC\DOUBLE TIMING\TIME_.ASM 39 : Found label after column 1. (Main)
Warning[219] C:\PIC\DOUBLE TIMING\TIME_.ASM 39 : Invalid RAM location specified.
Warning[219] C:\PIC\DOUBLE TIMING\TIME_.ASM 44 : Invalid RAM location specified.
Warning[219] C:\PIC\DOUBLE TIMING\TIME_.ASM 45 : Invalid RAM location specified.
Warning[219] C:\PIC\DOUBLE TIMING\TIME_.ASM 49 : Invalid RAM location specified.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F72 "time_.o" /z__MPLAB_BUILD=1 /o"time_.cof" /M"time_.map" /W /x
MPLINK 4.35, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Errors : 0
Loaded C:\PIC\Double Timing\time_.cof.
----------------------------------------------------------------------
Release build of project `C:\PIC\Double Timing\time_.disposable_mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.35, mplink.exe v4.35
Thu Jun 24 18:15:50 2010
----------------------------------------------------------------------
BUILD SUCCEEDED
whhat "Invalid RAM location specified" does that mean? why invalid?