Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some microcontroller definitions may be incorrect. #839

Open
nopnop2002 opened this issue Jun 4, 2024 · 0 comments
Open

Some microcontroller definitions may be incorrect. #839

nopnop2002 opened this issue Jun 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nopnop2002
Copy link
Contributor

nopnop2002 commented Jun 4, 2024

Board Name

microcontroller/rockchip

Steps

I've been looking into hardware PWM and found a few flaws.

Description

This is what the tutorial below says:

https://learn.adafruit.com/adding-a-single-board-computer-to-blinka/adding-more-features

To add natively supported PWM, you'll first need to add pwmOuts to your Chip file such as:

pwmOuts = (
  ((0, 0), PWM1),
  ((1, 0), PWM2),
  ((2, 0), PWM3),
)
The first parameter is a tuple and consists of the PWM chip number and the PWM channel of that chip.

The second parameter is the PWM pin and can be found by either a web search or referring to the manufacturer data.

But some chip definitions are not like that.

All PWM chip numbers and PWM channels are the same.
https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/rockchip/rk3399/pin.py#L225
https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/rockchip/rk3568/pin.py#L238

It is a list instead of a tuple.
https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/rockchip/rk3566/pin.py#L186

PWM chip number and the PWM channel may be reversed
https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/rockchip/rk3588/pin.py#L288

Additional information

I don't have these boards, so I can't check the exact contents.

@nopnop2002 nopnop2002 added the bug Something isn't working label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant