Shop OBEX P1 Docs P2 Docs Learn Events
PWMPAL frequencies and duty cycles. What works? — Parallax Forums

PWMPAL frequencies and duty cycles. What works?

Frpe82Frpe82 Posts: 1
edited 2011-10-09 01:10 in BASIC Stamp
Hi! This is my first post on the forum. I am none the less a novice when it comes to the programming and hardware.

I have some questions which I really can't find the answer for (and I have searched thoroughly, maybe not with the right keywords...).

I have a couple of projects that are interfacing with each other, and I will add some more components to the already complicated setup. The project has two BS2px and two PWMPAL's. The PWMPAL's are mounted in separate sockets (I need as many pins as I can on the BS2's). It is not (re)built yet. I have only written the software for the new/altered setup, but the response to the questions will change quite a lot in the code in certain cases.

I am generating a PWM signal on the PWMPAL of 400hz with variable pulsewidth in a simple way:
PWMonTime = ThrottlePower
PWMoffTime = 100 - ThrottlePower

(Throttle power being a value between 0-100)

Does the PWMPAL work ok in both of the extremes? 100 on-time and 0 off-time, and vice versa?
["!PWMM", PWMchan, OnTime0, OnTime1, OffTime0, OffTime1]

I am also using the PWMPAL's as standalone counters for different high-frequency sources (voltage-to-frequency converted signals). What is the maximum input frequency that the counters can handle?

I came to think of another question also... When periodically updating the duty-cycle for the PWMPAL, it sets the duty-cycle immediately (within resonable time), right?

Thank you so much for your help!

Greetings from a Gothenburg that is starting to get cold :tongue:
Sign In or Register to comment.