Community
cancel
Showing results for 
Search instead for 
Did you mean: 
FLean
Novice
1,207 Views

It's possible to increase PWM frequency?

Jump to solution

Hello;

 

I'd like to know if it's possible to increase PWM frequency up to 10KHz in Intel Galileo Gen2 WITHOUT using Arduino IDE.

 

Regular PWM using MRAA-Python generates frequencies about 500Hz.

 

I know that regular GPIO has more high frequencies. Using MRAA, I've got 20kHz in the pure wave, but when i tried to manipulate the waveform using usleep, the frequency fell to 1KHz.

 

I'm using intel-iot-devkit-egclib image
1 Solution
asss
Valued Contributor II
113 Views

Hi,

1. Galileo Gen2 hardware design limits a regular PWM's frequency up to 1526 Hz.

2. usleep does not allow to have a stability.

3. Using a lightweight Linux version like https://www.zephyrproject.org/ https://www.zephyrproject.org/ instead of intel-iot-devkit-egclib may provide a better stability.

4. It is better to use an external PWM chip with Gen2. For example like https://datasheets.maximintegrated.com/en/ds/MAX31790.pdf https://datasheets.maximintegrated.com/en/ds/MAX31790.pdf

BR,

xbolshe

View solution in original post

5 Replies
asss
Valued Contributor II
114 Views

Hi,

1. Galileo Gen2 hardware design limits a regular PWM's frequency up to 1526 Hz.

2. usleep does not allow to have a stability.

3. Using a lightweight Linux version like https://www.zephyrproject.org/ https://www.zephyrproject.org/ instead of intel-iot-devkit-egclib may provide a better stability.

4. It is better to use an external PWM chip with Gen2. For example like https://datasheets.maximintegrated.com/en/ds/MAX31790.pdf https://datasheets.maximintegrated.com/en/ds/MAX31790.pdf

BR,

xbolshe

View solution in original post

FLean
Novice
113 Views

Thanks for the answer, xbolshe. I'll discuss with my research group these points.

Another question i have is if it's possible to access the GPIO's registers directly. If it is, how I do that? Via assembly code?

asss
Valued Contributor II
113 Views

Hi,

yes, it is possible. But it will be a little bit harder because of a pin multiplexing.

Actually a language does not matter: Assembler or C.

It is more important to have an experience with a hardware and Linux kernel.

One more way is own PWM kernel driver.

BR,

xbolshe

FLean
Novice
113 Views

Ok.

 

About the mutilplexing:

I could work on the multiplexers in a more high-level language approach, like Linux Shell and then using C/Assembly for specifically work with the GPiO pin and interruptions. Do you think it could work?

idata
Community Manager
113 Views
Reply