Count Up Wrap function of SmartIO using Divided Clock for CY8CKIT-145-40XX

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

cross mob
lock attach
Attachments are accessible only for community members.
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

This sample code implements SmartIO's Count Up Wrap function using a Divided Clock.

The Clock component is connected to the clock of SmartIO2.

YoIs_1298666_0-1639962806370.png

YoIs_1298666_2-1639962844223.png

GND is connected to TR0 (rst) and VDD is connected to TR1 (en) of Count Up Wrap, but since it cannot be directly connected, it goes through LUT0 and LUT1, respectively.

DU is a Count Up Wrap function, and the counter outputs a pulse with 6 counts match of 8bit counter.

YoIs_1298666_4-1639962984351.png

The output of DU is registered out to gpio6 with LUT6 .

YoIs_1298666_3-1639962932175.png

2_1 is connected to VDD and P2_0 is connected to GND by external wiring.

YoIs_1298666_5-1639963022828.png

The following waveforms can be observed after programming.

YoIs_1298666_6-1639963084762.png

Pin_PWM_CLK (P3_6) is a clock for waveform observation with an oscilloscope.

And note that the Clock component output is divided by two.

Best regards,

Yocchi

 

0 Likes
0 Replies