Why no peripherals like ADC are enabled in Pins for twrkm35z75m_meterlibph_test example?!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why no peripherals like ADC are enabled in Pins for twrkm35z75m_meterlibph_test example?!

898 Views
GanesanGuru
Contributor IV

Hi all,

I've trying to learn the twrkm35z75m_meterlibFFT1ph_test applcaitiion example project using TWR-KM35Z75M board. After imported, I wanted to check the IO pins that are being used to sense V & I like ADC,SD-DAC,etc; so went for Pin view. Ther to my surprise, only UART pins are enabled, why is it so?!

Screenshot from 2023-10-20 13-09-37.png

 

Also, the metering example would be using AFE peripherals ans as per AN4265 doc, Page#21, there is a line "necessary hardware initialization, including the AFE, is performed in the main() function" - yet neither AFE is enabled nor I can see any funtion calls like AFE_ EndOfConvISR(), depicting the end of AFE sensing in anyfiles in the project. Hence, how to configure a working project from twrkm35z75m_meterlibph_test example using any metering algo's like AN4255/65?!

0 Kudos
Reply
3 Replies

842 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

For the AFE pins of KM35, the AFE analog pins are dedicated pins, they are not multiplexed with the other function, so there is not register to assign the pin.

For example:

For 100LQFP KM35, the pin33 is AFE_SD_ADP0, the pin 34 is AFE_SD_ADM0, they are dedicated pins, so there is not register to define the pin function or enable it.

But for the ADC analog pin, they are multiplexed with the other function, so you have to configure MUX bits as zero for the PORTx register, for detailed inf, pls refer to section 11.5 Memory map and register definition in KM35 sub-family reference manual:

https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mc...

 

Hope it can help you

BR

XiangJun Rong

xiangjun_rong_0-1698202367489.png

 

826 Views
GanesanGuru
Contributor IV

Hi @xiangjun_rong ,

Thats really nice. The TWRboard used - MKM35Z512VLQ7 in 144pin, where 45/46 -- acts as defatult AFE pins.

image.png

 

as given below,

GanesanGuru_0-1698218178966.png

 

Yet, what fascinates me is this line ::: phase V / I samples are read from AFE and passed to the metering algorithm via METERLIB1PH_ProcSamples().

Yet, I can't find any AFE converted values are being used in twrkm35z75m_meterlibph_test examples, as in contrast, in twrkm35z75m_afe_polling example project - I can see API's like AFE_Init, AFE_SetChannelConfig, AFE_DoSoftwareTriggerChannel,AFE_GetChannelConversionValue,etc.

Even though being a AFE default function in KM35 in 144pin package, the result from AFE should be read with the aid of AFE_GetChannelConversionValue funtion, which is what missing in twrkm35z75m_meterlibFFT1ph_test example!!! Why is it so?!

As a matter of fact, in example,twrkm35z75m_meterlibFFT1ph_test even the fsl_afe driver is not added. Why is it so? Without driver for AFE, how can the meter example has been developed?!

0 Kudos
Reply

817 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Unfortunately, I have not the twrkm35z75m_meterlibFFT1ph project, can you post it in the community and tell us the tools to open it so that I can have a review and check if it is a simulator or actual project with which all the current/voltage are sampled from AFE.

BR

XiangJun Rong

0 Kudos
Reply