Skip to content

Conversation

@bebenlebricolo
Copy link
Owner

Rationale about Driver/Module distinction

Implementing PWM driver/module. I find it difficult to distinguish between driver/module because to me the concept of a module relies on the fact that it does not directly interact with hardware peripheral, but rather uses drivers to achieve higher level functionalities.

The PWM module fits this description, as it does not interact with hardware peripherals directly but builds on top of hardware Timer's drivers and Timebase Module (which also wraps up hardware timer functionalities).
However, the level of detail of this PWM Module makes me think that in terms of pure functionality, it mostly appears as a driver, due to its intrinsic complexity.

What this driver / module is all about

Software based PWM, with customizable event generation (events still need to be implemented)

PWM driver provides the ability to synthesize PWM signals either using pure software resources or hardware resources instead.
Software generated PWMs are very well suited for low frequencies signals, and I plan to implement software events generation (user-customizable callbacks) which can be used in the software to perform very specific tasks while retaining the asynchronous aspect of the driver.

Hardware based PWMs, highly accurate PWM generation mode

On the other hand, the hardware handling (which is by far the trickiest) allows to easily configure a hardware timer, in order to achieve both frequency and / or duty cycle using full hardware capabilities of the timers themselves.
Hardware PWMs are, by design, very well suited for high frequencies applications where frequency and duty cycle accuracy are a priority.
Note that because Avr timers are quite limited by design, some limitations are to be expected.
For instance, 8 bit timer families can either achieve desired frequency, or duty cycle but not for each channel at the same time.
This can be achieved if we don't mind sacrificing the 'A' channel, in order to exploit the full time's potential for Channel B.

Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
…ig time

Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
…hing

Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
@bebenlebricolo
Copy link
Owner Author

The commit (e86269f) implements a basic software base PWM event generation and handling (still needs to be tested).
Closes #2

Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
… #warnings)

Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PWM soft] : Add support for event generation within software based PWM

2 participants