1. The PinSettings PE component affects PWM output with uncertainty.
I set pin PTB5 as PWM output in FTM2. But, I didn’t get PWM output initially. When I
checked the FTM tab in Pin1Settings module, I clicked the channel 5 pin
selection for PTB5, which was already there. I then regenerated PE and I got
PWM output. This didn’t happen to PMW pin only. It happened to GPIO pins as
well.
My question is what’s the functionality of PinSettings generated module? Why do I have to
confirm pin selections when they appear to be selected already?
2. I initialized one ADC channels in ADC0 module. But, PinSettings module shows 5
channels. I have no option to change the pin selections in PinSettings module.
My question is: how PinSettings module affect ADC channel selection?
3. I selected 4 ADC channels from pin PTB0, PTA6, PTA1, and PTA0 in A/D channel
list. And, I created a “Static sample groups” that including samples of the 4
ADC channels. But, I got the channel readings that do not match physical
voltage on these pins.
My question is: how to make the “Static sample groups” working?
4. Casting from an address not 16-bit aligned in physical memory, causes MCU exception.
For example
Struct
{
uint8 b0; uint8 b1; uint8 b2; uint8 b3; uint8 b4;
uint8 b5; uint8 b6; uint8 b7;
}
FooStruct;
FooStruct
zData;
uint16*
pu16Ptr;
pu16Ptr = (uint16*)zData.b3;
<<----- this causes MCU exception.
My question is: It is very hard to patch source code to dodge this issue. Is it possible
changed some compiler setting to avoid this issue?
5. . I could not see the peripheral registers in KDS 3.0.0 when I debug software. How can I see them?
Thanks,
John
Hello John,
1. After you configure the PinSettings PE component , click generate processor expert code ,
you can find the configure code in the cup.c file.
And about the PWM , you can also use the PWM_LDD component :
2. About change ADC channel pins , please in the ADC component :
3. Could you please show the code or configure about how do you
created a “Static sample groups” that including samples of the 4
ADC channels ?
4 . Which chip do you use ?
5. You can check the registers here :
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------