pic 12f629 assembly

Discussion in 'Embedded Systems and Microcontrollers' started by suvenier, Jul 31, 2008.

  1. suvenier

    Thread Starter New Member

    Jul 30, 2008
    3
    0
    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.

    Code ( (Unknown Language)):
    1.  
    2. list      p=12f629
    3. #include <p12f629.inc>
    4. __CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF &  _PWRTE_ON & _INTRC_OSC_NOCLKOUT
    5.  
    6. cblock 0x20    
    7. delay1
    8. delay2
    9. tone1
    10. tone2
    11. endc
    12. ;*****************<<
    13. ;Start
    14. ;*****************<<
    15. ORG     0x000            
    16. goto    SetUp              
    17. ORG    0x004
    18. nop                            
    19. nop                            
    20. nop
    21. SetUp  
    22. pin7 equ 0
    23. bsf         STATUS,rp0
    24. movlw     b'00110111'
    25. movwf    TRISIO
    26. bcf         status,rp0
    27. goto Main
    28. Main
    29. bsf        GPIO,pin7
    30. end
    31.  
    any help?

    thanks.
     
  2. AllVol

    AAC Fanatic!

    Nov 22, 2005
    55
    2
    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.
     
Loading...