NXP S32K118Q048 Red LED blinking Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

NXP S32K118Q048 Red LED blinking Problem

跳至解决方案
1,096 次查看
yousefdessouki123
Contributor II

am currently working with the S32K118Q048 Evaluation Board (EVB). I have successfully configured and toggled the blue LED on the board using the standard driver interface. However, I am encountering issues when attempting to control the red and green LEDs.

The red LED is connected to pin PTD16, and the green LED is connected to PTD15. According to the standard driver configuration, the corresponding channel addresses should be:

  • Red LED (PTD16): 0x0070

  • Green LED (PTD15): 0x006F

Despite configuring these channel addresses correctly, neither LED responds when I attempt to toggle them. I have verified the configuration using the S32 Design Studio's Pin Settings and Pin Configuration tool—both PTD15 and PTD16 are set as GPIO outputs. I have also cross checked it in the debugger section by reading the respective PCR registers.

I have also implemented a for loop to iterate over a range of channel addresses, including 0x006F and 0x0070, in an attempt to detect any response from the LEDs. However, no visible output was observed.

The question is now why does this happen? Am I missing on a specfic constraint?

标记 (1)
0 项奖励
回复
1 解答
1,072 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @yousefdessouki123 

According to the information provided, the pin assignments for the RGB_LED are correct.

However, I am confused about the section of code where you toggle the pin state. The Dio_WriteChannel() function requires two parameters: the channel ID and the desired logic level. For reference, the channel ID for PTD15 is 0x006F and for PTD16 is 0x0070, which you have correctly identified.

That said, in your code, the variable "i" is used to iterate from trial (0x0000) to 0x009E, and its value is passed as the channel ID to Dio_WriteChannel(). Could you clarify if this is the intended behavior? It seems that each LED color is being toggled only once during this loop. If your goal is to toggle specific LEDs, I would recommend passing the known channel IDs (e.g., 0x006F, 0x0070) directly to the function, rather than using "i" as the channel ID, since you already know the exact values you want to control.

Additionally, I am not sure which version of the RTD you are using, but since you are working with S32DS, please ensure that the pins are properly configured in both the Pin Tool and the Peripheral Tool.

 

BR, VaneB

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,073 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @yousefdessouki123 

According to the information provided, the pin assignments for the RGB_LED are correct.

However, I am confused about the section of code where you toggle the pin state. The Dio_WriteChannel() function requires two parameters: the channel ID and the desired logic level. For reference, the channel ID for PTD15 is 0x006F and for PTD16 is 0x0070, which you have correctly identified.

That said, in your code, the variable "i" is used to iterate from trial (0x0000) to 0x009E, and its value is passed as the channel ID to Dio_WriteChannel(). Could you clarify if this is the intended behavior? It seems that each LED color is being toggled only once during this loop. If your goal is to toggle specific LEDs, I would recommend passing the known channel IDs (e.g., 0x006F, 0x0070) directly to the function, rather than using "i" as the channel ID, since you already know the exact values you want to control.

Additionally, I am not sure which version of the RTD you are using, but since you are working with S32DS, please ensure that the pins are properly configured in both the Pin Tool and the Peripheral Tool.

 

BR, VaneB

0 项奖励
回复