amdkicksass
Member
Any particular place i should buy the stuff from ? Maybe straight from microchip ?
pete
pete
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
amdkicksass said:Any particular place i should buy the stuff from ? Maybe straight from microchip ?
pete
amdkicksass said:The PickIt2 comes in different packages, one being the starter kit. I believe the starter kit (DV164120), comes with a card that has a socket for the PIC. If i dont go with the starter kit , are there other socket cards/zif socket cards that would be better ?
;PIC Christmas Pattern Lights
;Peter 2007
LIST p=16F628 ;tell assembler what chip we are using
#include "P16F628.inc" ;include the defaults for the chip
__config 0x3D18 ;sets the configuration settings
;(oscillator type etc.)
;Constants
COUNT1 equ 020h ;First counter for our delay loops
Timer1 equ 021h ;Second counter for our delay loops
org 0x0000 ;org sets the origin, 0x0000 for the 16F628,
;this is where the program starts running
movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)
bsf STATUS, RP0 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movlw b'00000000'
movwf TRISA ;set PortA all outputs
bcf STATUS, RP0 ;select bank 0
movlw 255 ;First put the value of 85h in the W register
movwf 020h ;Now move it to our 08h register.
movlw 85h ;First put the value of 85h in the W register
movwf 020h ;Now move it to our 08h register.
Main
Pat1 MOVLW 01H ; Set the first bit
MOVWF PORTB ; on Port B.
RLF PORTB,1 ;Pattern to shift Lights left
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTB,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RLF PORTA,1
CALL Delay
RRF PORTA,1 ;Pattern to shift Lights Right
CALL Delay
RRF PORTA,1
CALL Delay
RRF PORTA,1
CALL Delay
RRF PORTA,1
CALL Delay
RRF PORTA,1
CALL Delay
RRF PORTA,1
CALL Delay
RRF PORTA,1
CALL Delay
RRF PORTA,1
CALL Delay
Rpt decfsz Timer1,1 ;This second loop keeps the LED
goto Pat1
goto end
Delay
Loop1 decfsz COUNT1,F ;This second loop keeps the LED
goto Loop1 ;turned off long enough for us to
return
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F628 "christmaslights1.asm" /l"christmaslights1.lst" /e"christmaslights1.err"
Message[302] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 21 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 23 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[202] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 26 : Argument out of range. Least significant bits used.
Error[113] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 89 : Symbol not previously defined (end)
Warning[203] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 98 : Found opcode in column 1. (return)
Warning[205] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 101 : Found directive in column 1. (end)
Error[173] C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM 102 : Source file path exceeds 62 characters (C:\DOCUMENTS AND SETTINGS\PETERBASTA\DESKTOP\PIC\CHRISTMASLIGHTS1.ASM)
Halting build on first failure as requested.
BUILD FAILED: Thu Jun 21 22:10:35 2007
Right movlw 01h
movwf PORTB
call Delay
movlw 02h
movwf PORTB
call Delay
movlw 04h
movwf PORTB
call Delay
movlw 08h
movwf PORTB
call Delay
movlw 10h
movwf PORTB
call Delay
movlw 20h
movwf PORTB
call Delay
movlw 40h
movwf PORTB
call Delay
movlw 80h
movwf PORTB
call Delay
goto Right
Delay decfsz 20h,F
goto Delay
decfsz 21h,F
goto Delay
return
amdkicksass said:If I remove the lines that store the value 255 in both registers that what would the
decfsz 20h,F
command do, how would it react if there is nothing in that register ?
Also since the value in that register is being modified by decreasing it how is it supposed to be used again and again if after the first delay run the register is already run down to 0 ?