PWM modulation of I/O port, IC needed

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

in my design I have two stepper motors connected to one of the AtMega32's ports, each motor driver connected to four port leads. Now I need to PWM modulate the port in order to sink the current consumption of the motor at low speeds, so I need an IC like this:

I know I can get 74HC08 with four AND gates and connect one of the inputs of each gate, but I want to avoid as much wiring as possible and in future I'm going to need this circuit several times.

Does anybody know which IC has the described functionality? It can also be an 8-channel IC, or two 4-channel ones in a single package.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about a CD4066 Tie all the enables aka (Controls) together

Or may be a 74HC367 - Non inverting 368 -- Inverting

"We look for things.. Things that make us go."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, 74HC367 seems to be suitable. CD4066 would be about the same as 74xx08 in terms of the extent of external wiring.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just simply add the PWM to your code and do not use this additional chip.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MBedder wrote:
Just simply add the PWM to your code and do not use this additional chip.

??
I suppose you mean some kind of software PWM, which requires a lot of CPU time.

I would like to use one of the built-in Timer/Counters to generate the PWM waveform.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mega32 has exactly 4 Output Compare (OC) modules which gives you 4 PWM channels with no CPU overhead. Moreover, a smart 4-channel software PWM implementation shouldn't grab more than a few percents of CPU time at low to medium frequences (0.5..5 kHz).

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MBedder wrote:
Mega32 has exactly 4 Output Compare (OC) modules which gives you 4 PWM channels with no CPU overhead. Moreover, a smart 4-channel software PWM implementation shouldn't grab more than a few percents of CPU time at low to medium frequences (0.5..5 kHz).

The second options applies to me, since I have two stepper motors connected, each having 4 leads. 1 kHz is OK for me. I'm thinking about creating a task in my RTOS, that would periodically clear and restore the value of PORTD register. However, the other task, which controls the stepper could write PORTD while the PWM task is in the blocked state.

I kinda started to like this idea, but have to think these details over.