Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Shift register question.


  • Please log in to reply
8 replies to this topic

#1 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 29 December 2010 - 08:07 PM

Is there a way I can output a PWM signal using a shift register? It doesn't make sense I think.. since shift registers are working with digital data and PWM is analog right? I am not sure... is it possible?

#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 29 December 2010 - 08:34 PM

Is there a way I can output a PWM signal using a shift register? It doesn't make sense I think.. since shift registers are working with digital data and PWM is analog right? I am not sure... is it possible?

PWM is digital, and yes, you can use shift register to output PWM signal. For example, if you continuously write 0x00, 0x01 to the shift register (e.g. in a loop), there will be PWM signal with 50% duty cycle on its output Q0 (or whatever it the name). You can cycle through more values to increase resolution, e.g. array of 256 bytes will give you 8-bit PWM per channel (shift register output pin).

#3 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 29 December 2010 - 09:36 PM

PWM is digital, and yes, you can use shift register to output PWM signal. For example, if you continuously write 0x00, 0x01 to the shift register (e.g. in a loop), there will be PWM signal with 50% duty cycle on its output Q0 (or whatever it the name). You can cycle through more values to increase resolution, e.g. array of 256 bytes will give you 8-bit PWM per channel (shift register output pin).

Thanks,
Do you know if this would work with the netduino though?
http://www.sparkfun.com/products/10136

if not then I can do what you said.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 December 2010 - 05:50 AM

PWM is sometimes considered "analog-like" because it can deliver power a certain percentage of a time (and giving 5V power half the time is equivalent to delivering 2.5V power all the time...in certain circumstances). But it's technically digital as CW2 stated. Chris

#5 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 30 December 2010 - 05:56 AM

PWM is digital, and yes, you can use shift register to output PWM signal. For example, if you continuously write 0x00, 0x01 to the shift register (e.g. in a loop), there will be PWM signal with 50% duty cycle on its output Q0 (or whatever it the name). You can cycle through more values to increase resolution, e.g. array of 256 bytes will give you 8-bit PWM per channel (shift register output pin).


PWM is sometimes considered "analog-like" because it can deliver power a certain percentage of a time (and giving 5V power half the time is equivalent to delivering 2.5V power all the time...in certain circumstances).

But it's technically digital as CW2 stated.

Chris


Thank you both for clearing that up, i initially thought it was digital but then got confused by the arduino's analogWrite - that is like the PWM for the netduino right?

#6 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 30 December 2010 - 09:17 AM

Do you know if this would work with the netduino though?
http://www.sparkfun.com/products/10136

Well, it depends - the IC has serial interface, so it will work with Netduino in general, but it will not be that easy in case you'd want all the advanced functions it provides (for example how to get reference clock for grayscale PWM control). There are several ways how to use this IC, some of them are rather simple (e.g. see TI App Note), but then you are giving away those advanced features (per-channel PWM) and it is basically reduced to a much simpler IC - it makes little sense to have such complex (expensive) IC working this way. Depending on your requirements (per-channel PWM?, constant-current output?, LED diagnostic features?) you may want to select different driver IC that fits better your particular needs.

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 December 2010 - 10:23 AM

Thank you both for clearing that up, i initially thought it was digital but then got confused by the arduino's analogWrite - that is like the PWM for the netduino right?


Yes, exactly.

#8 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 30 December 2010 - 05:55 PM

Well, it depends - the IC has serial interface, so it will work with Netduino in general, but it will not be that easy in case you'd want all the advanced functions it provides (for example how to get reference clock for grayscale PWM control). There are several ways how to use this IC, some of them are rather simple (e.g. see TI App Note), but then you are giving away those advanced features (per-channel PWM) and it is basically reduced to a much simpler IC - it makes little sense to have such complex (expensive) IC working this way. Depending on your requirements (per-channel PWM?, constant-current output?, LED diagnostic features?) you may want to select different driver IC that fits better your particular needs.


You make a good point... but why turn down a challenge? I'll try to get it to work (the advanced PWM stuff). 16 PWM ports is a pretty good deal, I might be able to actually come up with a useful project.

#9 Anshul

Anshul

    Advanced Member

  • Members
  • PipPipPip
  • 50 posts

Posted 25 January 2014 - 01:46 AM

Did you ever get this to work? Thanks.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.