element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum Shift Register Help
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 7 replies
  • Subscribers 473 subscribers
  • Views 550 views
  • Users 0 members are here
Related

Shift Register Help

Former Member
Former Member over 15 years ago

Hi all,

I'm using 2 x 14 pin 74HC164Ns, cascaded together, to operate an LCD, 3 LEDs and a Piezo sounder. Controlled by a PIC16F874. Running at 4MHz.

My problem is: when I write to the shift registers, I get a clicking  sound on the Piezo, and flashing on the LEDs. The LCD is unaffected as  I'm driving the en input directly from the PIC.

The PCB has already been designed and manufactured, so I am a bit stuck.  Even toggling the clear input on the shift register doesn't solve the  problem.

Ideally I should have used a shift register with tri state outputs such  as the 595. However I am stuck with making what I have here work.

Possible solutions:

a) run the PIC at a higher speed?
b) fit a small filter to my LED and Piezo outputs (which are on flying leads) so they ignore these very short signals?

I'd appreciate your comments on the above - many thanks.

Phil

  • Sign in to reply
  • Cancel
  • firatkocak
    0 firatkocak over 15 years ago

    Hi,

     

    If you may give us the pieace of code and schematics of your software and hardware then we may be more helpfull.

     

    Firat

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 15 years ago in reply to firatkocak

    Hello.

     

    At first you have to analyse if your problem comes from the harware or from the software.

     

    1. Re-solder the pic-pins (what are connected to LED, Piezo, ...) from PCB, or if you use a socket just pull them out of it and curve them in the air.

    2. Take a look with the oscilloscope at a. the pic-pins b. the solder points on the PCB

     

    After this measurement you know where you have to search for the fault!

     

    Please post the result of these test.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 15 years ago

    Hi Phil.

     

    Well, if I'm right, you use these shiftregisters as an kind of port expander.

     

    If you are changing some values, you have to schift the whole 28 bits. And there's the problem.

    The other bits rattle over the output pins which drives the piezo and the leds. So if the speed is

    not high enought, you will see or hear this.

     

    So I have two possible solutions for this.:

     

    1)    try to increase the speed of the writing to the registers

     

    2)    solder a socket instead of the 74HC164Ns into your PCB. If you have good luck, you will find a pincompatible ic with an extra output enable pin, which you can connect to an free pin of the PIC, lcd enable pin or maybe to the last output bit of thes registers.

     

    I hope I helped you with this.

     

    yours woolf

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 15 years ago in reply to Former Member

    I think that woolfs error analyze is good, I think he's right.

     

    But I also think that the solution isn't the best.

     

    If you increase the speed you don't remove the fault you just hide it! I don't like to solve problems like this way.

     

    I think you have to edit your project basically to get a perfect result.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • KennyMillar
    0 KennyMillar over 15 years ago

    I looked at the datasheet for the 164 and see that it has no latch for the outputs.

    I couldn't find a pin compatible shift register with an output latch.

     

    A latch would enable you to clock in all the bits, without them rippling over the outputs, then when you are ready latch the data to the outputs.

    Such a chip would be something like the 74hc595 - but it's not pin compatible.

     

    Running the pic at a higher rate might mitigate the problem, but it's a bit of a cludge I'm afraid.

     

    Your best work around might be to fit a filter on the leads to the leds/piezo.

     

    In the long-run you need to redesign the device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 15 years ago in reply to KennyMillar

    Guys, thanks for your help - you are abolutely right. I have just raised the PIC speed from 4MHz to 8MHz, and the problem has reduced but not gone away.

     

    Could anyone suggest a simple filter circuit for the LEDs and sounder? Filters not my strong suit! The LEDs and sounders are running at 12v. There is already a 220R resistor in series with each of the 3 LEDs. The piezo sounder is running straight off the 12v. I am using a the shift registers to drive a ULN2003 darlington IC. Each of the LEDs and sounders gets 12v, then I pull the other side down to 0v via the darlington.

     

    Ideally I would like to run the PIC back at 4MHz so as to leave my other timings unaffected. It takes me approx 12 - 13 clock cycles to clock a bit down through the shift register.

     

    Many thanks,

     

    Phil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 15 years ago in reply to Former Member

    It depends how big the pulse width of the "click" is - ie the time when the signal is in a changing state. Try to put a capacitor from the IC side of the 220R resistor to ground. Something like 100nF, and test results.

     

    Without the schematic I am not sure about this, but it may be possible to swap the position of LCD, buzzer and LED.

     

    Put the LCD connections at the lower bits of the shift register, as these change more frequently. The enable pin on the LCD means these changes will not effect the function. Put the LED and buzzer up on the higher bits of the shift register as these change less frequently. Maybe your circuit is already like this? Without a schematic I cannot say.

     

    Good luck.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube