Quadrature Decoder initialization issues

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

cross mob
RoFe_2541336
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

I am trying to use HAL functions to init a quadrature decoder on the CY8CPROTO-062-4343W board. I have created a custom BSP based on the generic PSoC6 as in docs, and can build and program my code successfully. My problem is in choosing pins for cyhal_quaddec_init. There seem to be no pins available on the proto board that can be used with the 32-bit TCPWMs, and no way to direct the init function to choose one of the other 16-bit TCPWMs. The 16-bit ones do have available pins on the proto board, but the init function seems to just choose the first open TCPWM, rather than try to find an available TCPWM that can access the pins given as arguments to ...init().

I have started to look at the PDL functions instead, thinking that the HAL layer is just not finished yet, but even in the PDL I don't see a way to specify which type of TCPWM (16-bit or 32-bit) should be used.

I obviously am missing something, hope you can clear it up for me.

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @RoFe_2541336

I was able to recreate the issue. Quadrature Decoder HAL initialization fails for valid TCPWM1 pin combinations. I have informed the team regarding this issue. I will be creating an internal ticket once they confirm the issue. Thank you very much for pointing out this issue. 

As for PDL, you will have to specify the pins and the TCPWM block to be used in the Device Configurator. You can find the Device Configurator tool in the Quick Panel under Tools.

The CY8CPROTO-062-4343W BSP is available directly and you need not have to create a custom BSP in this case. Can you please let me know if you are using a custom board?

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
2 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @RoFe_2541336

I was able to recreate the issue. Quadrature Decoder HAL initialization fails for valid TCPWM1 pin combinations. I have informed the team regarding this issue. I will be creating an internal ticket once they confirm the issue. Thank you very much for pointing out this issue. 

As for PDL, you will have to specify the pins and the TCPWM block to be used in the Device Configurator. You can find the Device Configurator tool in the Quick Panel under Tools.

The CY8CPROTO-062-4343W BSP is available directly and you need not have to create a custom BSP in this case. Can you please let me know if you are using a custom board?

Thanks and Regards,
Rakshith M B
0 Likes

I tried both with the protoboard's BSP, a BSP made from it, and a BSP made with generic PSoC6 plus two different devices.

Thanks for the reminder about the Device Configurator tool being used with PDL.

0 Likes