pic 12f629 assembly

Thread Starter

suvenier

Joined Jul 30, 2008
3
hi.

I just got a 12f629 unit and i'm tryng to get it to output high at pin 7.

after some intense learning around the net, I managed to write an assembly program and burn it to the chip.

I don't Seem to get any results, so I'm asking for the experts word.

Rich (BB code):
list      p=12f629
#include <p12f629.inc>
__CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF &  _PWRTE_ON & _INTRC_OSC_NOCLKOUT 
 
cblock 0x20    
delay1
delay2
tone1
tone2
endc
;*****************<<
;Start
;*****************<<
ORG     0x000             
goto    SetUp              
ORG    0x004
nop                             
nop                             
nop
SetUp   
pin7 equ 0
bsf         STATUS,rp0 
movlw     b'00110111'
movwf    TRISIO
bcf         status,rp0 
goto Main
Main
bsf        GPIO,pin7 
end
any help?

thanks.
 

AllVol

Joined Nov 22, 2005
55
hi.

I just got a 12f629 unit and i'm tryng to get it to output high at pin 7.

after some intense learning around the net, I managed to write an assembly program and burn it to the chip.

I don't Seem to get any results, so I'm asking for the experts word.

Rich (BB code):
list      p=12f629
#include <p12f629.inc>
__CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF &  _PWRTE_ON & _INTRC_OSC_NOCLKOUT 
 
cblock 0x20    
delay1
delay2
tone1
tone2
endc
;*****************<<
;Start
;*****************<<
ORG     0x000             
goto    SetUp              
ORG    0x004
nop                             
nop                             
nop
SetUp   
pin7 equ 0
bsf         STATUS,rp0 
movlw     b'00110111'
movwf    TRISIO
bcf         status,rp0 
goto Main
Main
bsf        GPIO,pin7 
end
any help?

thanks.
I think your biggest problem is that the program is working okay... you just can't see it. Add this line before end: goto $

That will enable your program to continue looping long enough for you to see the LED in action.

Hope this works.

Oops, just noticed. Your TRISIO command is backwards. You want b'00111000', making the TRIS pins (GP2:GP0) outputs. (Remember 1 is for in 0 is for out). Actually, you could make TRIS all 0's for this exercise.

See if this helps any.
 
Top