PDA

View Full Version : HPWM and variable 10-12khz outputs with a 48mhz osc possible?



awdgsx
- 25th April 2012, 16:37
Is this possible? I'm taking a changing 0-5v input signal and converting it to either a 10 to 3000hz variable or a 2 to 12khz variable output with a lookup table. I believe I need to use HPWM because I need the output to be run and updated continously while the rest of the code in the MCU is ran. I can also put the output I want from the lookup table into the "frequency" variable of the HPWM command and have it updated each time the loop is performed. From what I've read I can not output a frequency that low with my 48MHZ osc. I believe i need to use this speed for USB because I'm using a PIC18f14K50.

Any ideas?

Ramius
- 25th April 2012, 17:19
Hi awdgsx!
Have you considered running at a higher frequency and then take the HPWM output and run it through a "decade counter" such as an SN7490A? This is a divide by 10 device so you can do an HPWM at say 300,000hz, run it through 2 divide by 10's and now you are at 3,000hz. Best, Ed

awdgsx
- 25th April 2012, 20:11
I could but when I used my circuit for applications needing the 2 to 12khz scale I would run into the 16000hz celing of the hpwm command. Space on my circuit is very limited so I would like to find a solution that doesn't require and more componebts

Ramius
- 26th April 2012, 03:17
I understand and I am running a 20mhz resonator on an 18F1320 with a HPWM of 32.768khz. (hpwm 1, 127, 32768) I am not familar with the PIC you are using or it's limitations. It just seems strange that the ceiling would be 16000hz?

awdgsx
- 26th April 2012, 14:12
I believe the hpwm max on any pic is 32,000 hz?

Ramius
- 27th April 2012, 12:35
No sure about this limit, I only know that mine is running at 32,768. You may wish to call MicroEngineering Labs 1-719-520-5323 they are great people and very helpful.

Ramius
- 28th April 2012, 01:42
Hi Awdgsx!
Take a look at http://www.picbasic.co.uk/forum/showthread.php?t=7831 . If you read down thru the post PBPL does NOT have a 32767 limit.