adafruit / seesaw

I2C friend to expand capabilities of other chips.
Other
76 stars 34 forks source link

board_config.h ignored for PA08 and PA09 #20

Closed wallarug closed 5 years ago

wallarug commented 5 years ago

Issue: Robo HAT SeeSaw SERVO 7 & 8 not working

I have not been able to set PA08 and PA09 as PWM outputs. They appear to be floating like INPUTs.

I can measure other pins with my multimeter (e.g. PA10, PA11) and they are sitting at a nice 0.00V while PA08/PA09 are sitting at 0.15V like other inputs on the board. ALL other PWM pins are all sitting at 0.00V when measured. All Inputs, communication or un-configured pins are sitting at 0.15V (like my problem pins).

I have triple checked that I am using the correct timers and pads.

When trying to use the seesaw library to turn a servo, it does not work on PA08/PA09. Software appears to be all ok in the libraries - the pins all match up and no errors are produced by Python.

I believe I have narrowed this down to SeeSaw using PA08 and PA09 as some sort of communication port that cannot be configured using the board_config.h file.

Reason: I tested the servo out capability of the pin(s) with CircuitPython running native on the board and had no issues with any pins.

Already tried:

Is there anyway to narrow down what part of SeeSaw is taking control of PA08 and PA09? Maybe I just need some fresh eyes on this issue. 😪

board_config.h

#define CONFIG_TIMER_PWM_OUT0 1
#define CONFIG_TIMER_PWM_OUT0_IS_TCC
#define CONFIG_TIMER_PWM_OUT0_TC NOT_ON_TC
#define CONFIG_TIMER_PWM_OUT0_TCC TCC0
#define CONFIG_TIMER_PWM_OUT0_WO 0
#define CONFIG_TIMER_PWM_OUT0_PIN 8    //PA08 - SERVO_08

#define CONFIG_TIMER_PWM_OUT1 1
#define CONFIG_TIMER_PWM_OUT1_IS_TCC
#define CONFIG_TIMER_PWM_OUT1_TC NOT_ON_TC
#define CONFIG_TIMER_PWM_OUT1_TCC TCC0
#define CONFIG_TIMER_PWM_OUT1_WO 1
#define CONFIG_TIMER_PWM_OUT1_PIN 9    //PA09 - SERVO_07

Datasheet Extract

image

wallarug commented 5 years ago

This should be marked as a duplicate for issue #17 . It is the same problem that impacts both TCC0 and TCC1 when using the "F" function.

image

Note this screenshot below. All functions in the red and yellow box are blocked by the problem code above.

image

I like the idea of the check, but it needs to take into account what pin as well to prevent blocks like I am experiencing.