Shiftin pic18f452


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    92

    Default Shiftin pic18f452

    Hi,

    I am using pic18f452 and want to connect a 4021B shift register to it.

    The shift reg is paralell input (switches) and serial output ----> to the pic.

    Now I see that in the pic manual the pic would accept two parameters from the shift register; clock and data.

    *However, the 4021B shift register also has a "Latch" pin. Would I just connect the 4021's latch pin to a pin on the pic, and make that pin on the pic toggle high or low?

    Thanks for any help.

    TonyA

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Here is a snippet.

    In this case the Load would be the same as your Latch.

    Code:
    Clock   var PORTB.7
    Load    var PORTB.6
    Data_1  var PORTB.5
    '###########
    pulsout Load,1
    shiftin Data_1,Clock,MSBPre,[keys]
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Ok, I see. Thanks very much.

  4. #4
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    It's been awhile since I worked with picbasic pro. I get an error with:

    Clock var PORTB.7
    Load var PORTB.6
    Data_1 var PORTB.5


    Don't know why.

    Thanks.

  5. #5
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Fixed, I think. I had some kind of conflict with the pin assignments. (I think).

    Thanks again.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What is the error?
    is there more to your code? do you like guessing games?

    Yes, I am a smart _ _ _ ..

    EDIT>>>
    I need to see if a post was made while I am typing. Or type faster...
    Last edited by mackrackit; - 12th August 2009 at 23:09.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Sorry. I have it all fixed now using your code above. I was pasting it into some old code and wasn't paying attention.

    I'll post my code when I get it finished.

    Thanks for your help, I appreciate it very much.

Similar Threads

  1. Shiftin question
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th November 2007, 19:09
  2. communicating pic18f452 with pic16f877a
    By tamersoss in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th July 2007, 19:54
  3. SHIFTIN problem
    By champion in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th January 2007, 03:31
  4. Using SHIFTIN
    By TonyA in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st May 2006, 15:38
  5. PIC18F458 Shiftin / Out
    By pberhin in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th May 2006, 20:36

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