squintz said:Also i notice that the pic programer uses a DC plug but it says it accepts ac and dc. What is the polarity of the DC? is it Positive or negative center?
while waiting from a responce from you guys i ound PicALLw software
org 0x00 ;This is where we come on power up and reset
;*******************SETUP CONSTANTS*******************
INTCON EQU 0x0B ;Interrupt Control Register
PORTB EQU 0x06 ;Port B register address
PORTA EQU 0x05 ;Port A register address
TRISA EQU 0x85 ;TrisA register address
TRISB EQU 0x86 ;TrisB register address
STATUS EQU 0X03 ;Status register address
COUNT EQU 0x0c ;This will be our counting variable
TEMP EQU 0x0d ;Temporary store for w register
goto main ;Jump over the interrupt address
;***************INTERRUPT ROUTINE***************
org 0x04 ;This is where PC points on an interrupt
movwf TEMP ;Store the value of w temporarily
incf COUNT,1 ;Increment COUNT by 1, and put the result
;back into COUNT
movlw 0x0A ;Move the value 10 into w
subwf COUNT,0 ;Subtract w from COUNT, and put the
;result in w
btfss STATUS,0 ;Check the Carry flag. It will be set if
;COUNT is equal to, or is greater than w,
;and will be set as a result of the subwf
;instruction
goto carry_on ;If COUNT is <10, then we can carry on
goto clear ;If COUNT is >9, then we need to clear it
carry_on
bcf INTCON,0x01 ;We need to clear this flag to enable
;more interrupts
movfw TEMP ;Restore w to the value before the interrupt
retfie ;Come out of the interrupt routine
clear
clrf COUNT ;Set COUNT back to 0
bcf INTCON,1 ;We need to clear this flag to enable
;more interrupts
retfie ;Come out of the interrupt routine
;*******************Main Program*********************
main
;*******************Set Up The Interrupt Registers****
bsf INTCON,7 ;GIE – Global interrupt enable (1=enable)
bsf INTCON,4 ;INTE - RB0 Interrupt Enable (1=enable)
bcf INTCON,1 ;INTF - Clear FLag Bit Just In Case
;*******************Set Up The Ports******************
bsf STATUS,5 ;Switch to Bank 1
movlw 0x01
movwf TRISB ;Set RB0 as input
movlw 0x10
movwf TRISA ;Set R 0 to RA3 on PortA as output
bcf STATUS,5 ;Come back to Bank 0
;*******************Now Send The Value Of COUNT To Port A
loop
movf COUNT,0 ;Move the contents of Count into W
movwf PORTA ;Now move it to Port A
goto loop ;Keep on doing this
end ;End Of Program
;*******************SETUP CONSTANTS*******************
INTCON EQU 0x0B ;Interrupt Control Register
PORTB EQU 0x06 ;Port B register address
PORTA EQU 0x05 ;Port A register address
TRISA EQU 0x85 ;TrisA register address
TRISB EQU 0x86 ;TrisB register address
STATUS EQU 0X03 ;Status register address
COUNT EQU 0x0c ;This will be our counting variable
TEMP EQU 0x0d ;Temporary store for w register
goto main ;Jump over the interrupt address
;***************INTERRUPT ROUTINE***************
org 0x04 ;This is where PC points on an interrupt
movwf TEMP ;Store the value of w temporarily
incf COUNT,1 ;Increment COUNT by 1, and put the result
;back into COUNT
movlw 0x0A ;Move the value 10 into w
subwf COUNT,0 ;Subtract w from COUNT, and put the
;result in w
btfss STATUS,0 ;Check the Carry flag. It will be set if
;COUNT is equal to, or is greater than w,
;and will be set as a result of the subwf
;instruction
goto carry_on ;If COUNT is <10, then we can carry on
goto clear ;If COUNT is >9, then we need to clear it
carry_on
bcf INTCON,0x01 ;We need to clear this flag to enable
;more interrupts
movfw TEMP ;Restore w to the value before the interrupt
retfie ;Come out of the interrupt routine
clear
clrf COUNT ;Set COUNT back to 0
bcf INTCON,1 ;We need to clear this flag to enable
;more interrupts
retfie ;Come out of the interrupt routine
;*******************Main Program*********************
main
;*******************Set Up The Interrupt Registers****
bsf INTCON,7 ;GIE – Global interrupt enable (1=enable)
bsf INTCON,4 ;INTE - RB0 Interrupt Enable (1=enable)
bcf INTCON,1 ;INTF - Clear FLag Bit Just In Case
;*******************Set Up The Ports******************
bsf STATUS,5 ;Switch to Bank 1
movlw 0x01
movwf TRISB ;Set RB0 as input
movlw 0x10
movwf TRISA ;Set R 0 to RA3 on PortA as output
bcf STATUS,5 ;Come back to Bank 0
;*******************Now Send The Value Of COUNT To Port A
loop
movf COUNT,0 ;Move the contents of Count into W
movwf PORTA ;Now move it to Port A
goto loop ;Keep on doing this
end ;End Of Program
Deleting intermediary files... done.
Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F84A "LED.asm" /l"LED.lst" /e"LED.err"
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 11 : Found opcode in column 1. (goto)
Warning[205] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 14 : Found directive in column 1. (org)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 15 : Found opcode in column 1. (movwf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 16 : Found opcode in column 1. (incf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 18 : Found opcode in column 1. (movlw)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 19 : Found opcode in column 1. (subwf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 21 : Found opcode in column 1. (btfss)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 25 : Found opcode in column 1. (goto)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 26 : Found opcode in column 1. (goto)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 28 : Found opcode in column 1. (bcf)
Warning[204] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 30 : Found pseudo-op in column 1. (movfw)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 31 : Found opcode in column 1. (retfie)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 34 : Found opcode in column 1. (clrf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 35 : Found opcode in column 1. (bcf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 37 : Found opcode in column 1. (retfie)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 41 : Found opcode in column 1. (bsf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 42 : Found opcode in column 1. (bsf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 43 : Found opcode in column 1. (bcf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 45 : Found opcode in column 1. (bsf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 46 : Found opcode in column 1. (movlw)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 47 : Found opcode in column 1. (movwf)
Message[302] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 47 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 48 : Found opcode in column 1. (movlw)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 49 : Found opcode in column 1. (movwf)
Message[302] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 49 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 50 : Found opcode in column 1. (bcf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 53 : Found opcode in column 1. (movf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 54 : Found opcode in column 1. (movwf)
Warning[203] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 55 : Found opcode in column 1. (goto)
Warning[205] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 56 : Found directive in column 1. (end)
Loaded C:\Documents and Settings\Owner\My Documents\PICs\LED.COD
BUILD SUCCEEDED: Fri Oct 24 18:53:04 2003
ORG 0x00
goto main
Main
org 0x04
movwf TEMP
incf COUNT,1
...
...
End
Deleting intermediary files... done.
Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F84A "LED.asm" /l"LED.lst" /e"LED.err"
Message[302] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 47 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\DOCUMENTS AND SETTINGS\OWNER\MY DOCUMENTS\PICS\LED.ASM 49 : Register in operand not in bank 0. Ensure that bank bits are correct.
Loaded C:\Documents and Settings\Owner\My Documents\PICs\LED.COD
BUILD SUCCEEDED: Fri Oct 24 20:23:46 2003
Program error:
Program adress=000 buffer=2811 device=3fff
Warning:
Configuration word is not
included with the hex file !!!
For detail look at the PICALLW.HLP section FAQ!!!
Squintz said:What is the configuration code? I looked at the Help file but did not understand it! Thank you all for helping me through all this
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?