Skip to content

Some microcontroller definitions may be incorrect. #839

@nopnop2002

Description

@nopnop2002

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions