>
> From: Mike <
spamBeGonemrgizmo@spam@
spam_OUTVIANET.CA>
> Date: 2004/07/08 Thu PM 02:07:54 EDT
> To:
TakeThisOuTPICLISTspam
MITVMA.MIT.EDU
> Subject: Re: [PIC]: 12F675
>
> Ok, here it is.
>
> Clean: Deleting intermediary and output files.
> Clean: Done.
> Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p12F675
> "camtimer.asm" /l"camtimer.lst" /e"camtimer.err"
> Error[113] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 15 :
> Symbol not previously defined (STATUS)
> Error[113] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 15 :
> Symbol not previously defined (RP0)
> Error[116] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 16 :
> Address label duplicated or different in second pass (ASM)
> Error[116] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 17 :
> Address label duplicated or different in second pass (ASM)
> Error[113] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 17 :
> Symbol not previously defined (OSCCAL)
> Error[116] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 18 :
> Address label duplicated or different in second pass (ASM)
> Error[113] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 18 :
> Symbol not previously defined (STATUS)
> Error[113] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 18 :
> Symbol not previously defined (RP0)
> Error[122] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 22 :
> Illegal opcode (after)
> Error[122] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 23 :
> Illegal opcode (count)
> Error[122] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 37 :
> Illegal opcode (ignition)
> Error[122] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 38 :
> Illegal opcode (mercury)
> Error[122] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 39 :
> Illegal opcode (camera)
> Error[108] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 61 :
> Illegal character (5)
> Warning[205] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 63 :
> Found directive in column 1. (If)
> Error[108] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 63 :
> Illegal character (=)
> Warning[212] C:\DOCUMENTS AND SETTINGS\MIKE\DESKTOP\CAM\CAMTIMER.ASM 74 :
> Expected (ENDIF)
> Halting build on first failure as requested.
> BUILD FAILED: Thu Jul 08 10:59:48 2004
>
> There were much more errors but I got those.
>
> This is the program
>
> ;rocket prog 07/06/04 for 12f675 by Peter van Hoof
> ;for basic compiler
http://www.oshonsoft.com
> ;2 input switches
> ; pin 6 to gnd (ignition) made when rocket leaves platform
> ; pin 5 to gnd (mercury) made when parachute deploys
> ;1 output
> ; pin 2 (camera) goes high for 0.5 sec inmediately after takeoff
> ; and every 1.5 seconds thereafter until parachute deploys
> ; when parachute deploys high for 0.5 sec low for 4.5 sec
> ; for a maximum of 12 pictures
>
>
> ;oscilator calibration section not sure if needed for this app
> ;this part does not simulate well so I commented it out
> ASM: bsf STATUS, RP0
> ASM: call 3ffh
> ASM: movwf OSCCAL
> ASM: bcf STATUS, RP0
>
>
> ;declaration of variables
> Dim after As Bit
> Dim count As Byte
> after = 0 ;set after chute deployment
> count = 0 ;counter for number of pictures
>
>
> ;gpio setup section
> OPTION_REG.7 = 0 ;weak pullups on
> OPTION_REG.6 = 0 ;interrupt on falling edge of int
> WPU = 00000111b ;weak pullups on on inputs 0,1,2
> GPIO = 0h ;GPIO all bits off
> CMCON = 7h ;set gp 0 And 2 To digital io
> ANSEL = 0h
> TRISIO = 00001111b ;set gp 0,1,2,3 As inputs and
> ;set gp 4 And 5 As outputs
> Symbol ignition = GPIO.1 ;gpio 1 is ignition switch
> Symbol mercury = GPIO.2 ;gpio 2 is mercury switch
> Symbol camera = GPIO.5 ;gpio 5 is camera or whatever
> ;you have hooked up
>
>
> ;main program starts here
>
> ;again:
>
> ;patiently wait for the ignition input to come on (launch time)
>
> ;If ignition = 1 Then Goto again
>
> ;set up of interrupts
>
> INTCON.INTE = 1 ;enable int interrupts
> INTCON.INTF = 0 ;clear the int flag
> Enable ;enable global interrupts
>
> count = 1 ;first pic being taken
>
> loop: ;get back here for more pictures
> camera = 1 ;output On
> WaitMs 500 ;0.5 second wait
> camera = 0 ;Output Off
> If count = 12 Then Goto the_end ;end if already 12 photo's
> WaitMs 1500 ;1.5 second wait
> If after = 1 Then WaitMs 3500 ;if on its way down wait extra 3.5 sec
> count = count + 1 ;keep track of number of pictures
> Goto loop ;go snap another pic
>
>
> ;this is where the program stays when it is done
>
> the_end: Goto the_end ;endless loop, we are done
>
> End
>
> ;interrupt subroutine executed when int (gp2) goes to 0 volt
>
> On Interrupt
> INTCON.INTE = 0
> INTCON.INTF = 0
> after = 1
> Resume
>
>
>