ACLK output

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

I've been playing with ACLK a little, and was hoping to find an example app that outputs one of the two ACLK's (0 or 1) directly on their pins.

Pins P32 and P33 have the alternate function "Auxiliary clock output: ACLK0" and "Auxiliary clock output: ACLK1" respectively.

Can someone give me some sample code to activate those outputs for ACLK?

I'm using ACLK for PWM output already, so that's working (from the pwm_tones example), I just can't get the direct output on P32/P33 to work.

I think I have disabled PUART on those pins, but you're welcome to give me a definitive method for this as well 🙂

Thanks!

0 Likes
1 Solution
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

This code will bring out 64kHz onto pin 32:

gpio_configurePin(32 /16, 32 % 16, GPIO_KS_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_HIGH);

aclk_configure(64000, ACLK0, LHL_CLK);

Also, set your fine timer interval to 0 and don't start it. My fine timer was interrupting the clock from coming out. Looking into why this is happening.

Jacob

View solution in original post

0 Likes
2 Replies
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

This code will bring out 64kHz onto pin 32:

gpio_configurePin(32 /16, 32 % 16, GPIO_KS_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_HIGH);

aclk_configure(64000, ACLK0, LHL_CLK);

Also, set your fine timer interval to 0 and don't start it. My fine timer was interrupting the clock from coming out. Looking into why this is happening.

Jacob

0 Likes
Anonymous
Not applicable

Thanks, this indeed worked, and the fine timer breaks the output for me too (the output is still there, but is intermittant, ie has long pauses).

0 Likes