Need help for PIC16C745


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Is this all of your code or is it a snippet (in post above)? I ask because you have no list, includes, or CONFIG at the start. Inside the Microchip folder (from the MPLAB install), you should be able to find a template for the 16c745. I would suggest using this as the outer shell and put your stuff inside. Further, because the PIC you picked is quite "fancy", you should make it blink an LED first to ensure it is even running. Your program is not difficult, but you should start even simpler than you are otherwise you do not know if your problem is a logic issue, a hardware issue, a register issues, etc.

    Try to blink your led first

    Oh, if your code is complete, you lost the wrap around to return to Start. Your code would just run off into no-where and execute any code left in your PIC (should it be the windowed version)
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi Paul,

    I did include list and # include and CONFIG in my code .
    list p=16c745 ; list directive to define processor
    #include <p16c745.inc> ; processor specific variable definitions

    __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _E4_OSC

    But yet with this, my code is not working.Can you help me. I did like what you said do the simple one first ( blink the LED only ) but it is not working either . Here is my code : for binkling one.
    list p=16c745 ; list directive to define processor
    #include <p16c745.inc> ; processor specific variable definitions

    __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _E4_OSC


    MAIN org 00000030h


    bsf STATUS,RP0 ; select bank1
    movlw b'00000000' ; Set pins PORTB 1,2 as Input
    movwf TRISB ;
    bcf STATUS, RP0 ; go back to Bank 0

    Start
    movlw b'00000001' ; move it from register 1 to w.
    movwf PORTB ; move it to PORTB to light up the LED
    movlw b'00000000' ; move it from register 1 to w.
    movwf PORTB ; OFF the LED
    goto Start

    Can you help me with the code cause this Fridat is my dateline.

    Thank you so much

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    >>I did like what you said do the simple one first ( blink the LED only ) but it is not working either
    Did the LED not light or did it stay on?

    What crystal are you using?

    Do you have a schematic?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts