Need help for PIC16C745


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Thank you Joe for the link.

    HI Paul

    I use the 6 MHZ crystal. I did draw the schematic digram but i do not have a sofware to draw the schematic , so i use free hand.

    Let me expalain how i connect .
    the PIC16C745have 28 pins

    connect pin 8 and 19 to the ground
    pin 20 to +5 V
    pin 21 connnect to a resistor and Led then + 5 V

    pin 21 _______(Resistor)____(Led)___ +5V
    pin 22 connect reisistor ( also the resistor connect to the ground ) + then the switch and follow by + 5V

    (ground)
    ^
    I
    I
    pin 22.______Resistor__(switch)___(+5V)

    pin 23 connect reisistor ( also the resistor connect to the ground ) + then the switch and follow by + 5V


    (ground)
    ^
    I
    I
    pin 23.______Resistor__(switch)___(+5V)

    And the cystal have got 4 pins

    Pin no 7 to the ground
    pin 8 to pin 9 of PIC16C745
    pin 14 to the 5V

    This schematic is tofor match for :

    AIN org 00000030h

    Start
    bsf STATUS,RP0 ; select bank1
    movlw b'00000110' ; Set pins PORTB 1,2 as Input
    movwf TRISB ;
    bcf STATUS, RP0 ; go back to Bank 0
    ON
    btfss PORTB,1 ; Has S1 been press? (Normally high,goes low when pressed.)
    goto ON ; No, go back check again
    movlw b'00000001' ; move it from register 1 to w.
    movwf PORTB ; move it to PORTB to light up the LED

    OFF
    btfsc PORTB,2 ; Has key been press? (Normally high, goes low when pressed.)
    goto OFF ; No, check again
    movlw b'00000000' ; move it from register 1 to w.
    movwf PORTB ; OFF the LED

    end

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


    Did you find this post helpful? Yes | No

    Default

    You did not answer

    Did the LED light up in your blink test?

    Is your 745 windowed or are you burning new PICs each time?

    On the diode, which end (anode or cathode) is connect to 5V?

    Do you have an Oscilloscope? [EDIT] I have never used a four pin Xtal so I cannot comment on its correctness. If you have a scope, it would be easy to find out.[/EDIT]

    you say "btfsc PORTB,2 ; Has key been press? (Normally high, goes low when pressed.)"
    but you described the opposite - normally low and high when pressed. If it truly is opposite your program flies past this routine and then off into the ether. You would never see the light blink at 24MHz clock speed. You need to have a way to either send the program back to top (e.g., goto START) or a way to stop the controller from running away (e.g., goto $)

    I beg you to make your LED blink first ... the rest is trivial after that.
    Last edited by paul borgmeier; - 13th September 2007 at 09:11. Reason: Add Xtal comment
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello,

    I too am not an assembly language user but shouldn't there be some sort of delay (250ms at least)after the LED is turned on and another delay (250ms) after it is turned off so you can actually see the LED changing states?

    BobK

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BobK View Post
    Hello,

    I too am not an assembly language user but shouldn't there be some sort of delay (250ms at least)after the LED is turned on and another delay (250ms) after it is turned off so you can actually see the LED changing states?

    BobK
    Yes - that is why I asked

    Did the LED not light or did it stay on?
    without the delays, if the OP's code was working the LED would appear to the eye as stuck on

    I have asked twice.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  5. #5
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default 4 pins crystal

    Just my 2 cents,
    Never seen a 4 pins crystal or resonator, maybe she's using an oscillator, not a crystal.
    Then we should know if the config is right for that.

    BTW Can we use oscillator ???


    Quote Originally Posted by christina86 View Post
    And the cystal have got 4 pins
    Also, maybe someone familiar with this PIC can make a very small program using PBP and send the hex file to Christina to validate the circuit she's using.

    J-P
    Last edited by GrandPa; - 13th September 2007 at 20:56.

  6. #6


    Did you find this post helpful? Yes | No

    Smile

    sorry, it is my mistake. I used the 4 pin using an oscillator.

  7. #7
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Talking Good news!

    Quote Originally Posted by christina86 View Post
    sorry, it is my mistake. I used the 4 pin using an oscillator.
    HeHe!

    I'm happy to know that I helped you find the mistake. The good news is that you learned something you will not forget.I should also tell you that I've seen much worst that that. Ever heard of fried PICs?

    BTW Is the program working fine now?

    J-P
    Last edited by GrandPa; - 14th September 2007 at 04:45.

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