PDA

View Full Version : 4 Low Speed PWM & HSERIN



MasterSparky
- 8th October 2007, 17:28
I need to send and receive commands using the HSERIN commands as well as control 4 different pwms at 200Hz. I've seen the code on pbpgroup.com and wondered how the resources allocated by this code affect the use of HSERIN commands?

Is there a better way to complete this project? Multiple PICS utilizing a single hardware pwm module?

MasterSparky

Charles Linquis
- 8th October 2007, 17:48
If you need 8 bits of resolution, your PWM clock needs to be 256 X 200Hz = 51,200Hz. That is pretty fast for software.

I would choose a PIC that has 4 or 5 channels of PWM (18F8722 for example). With that part, you can "set and forget" the PWM registers. Everything would happen in the background, and there would be no issues or conflicts with HSERIN.

MasterSparky
- 8th October 2007, 18:03
Charles,

Thanks. I have considered this, but hate to use a part with 70 I/O just for 4 pwms. Was hoping there was a more elegant cost effective solution.

mister_e
- 8th October 2007, 18:29
Which article do you refer to? The original or the new one bellow
http://darreltaylor.com/DT_INTS-14/SPWM.html

You may try with a lower frequency and see what happen

MasterSparky
- 8th October 2007, 19:12
Hadn't seen this newer version. Looks like he's made some improvements. I read a post 'somewhere' that there is an issue when utilizing the hardware serial uart. Any experience with this?

My problem is I'm designing my architecture around whether this will work. Perhaps getting an eval kit would alleviate this issue. That way I can hook it up to the pc and send down serial commands to adjust the pwms.

The real question is whether or not there is any resource conflicts using this code with the hserin commands?

Thanks for all the help, gents ;)