When we slow down the EIM clock using PRE_PODF bits of CCM_TARGET_ROOT83 register( In our case eim clock source selected is 125 MHz and setting PRE_PODF to divide by 8 ), We observed that sometimes during EIM register initialisation, registers does not get updated by the values we assign to them.
We have used the Map_MemoryWrite() function for peripheral registers and make the mapped variables volatile too. We are using the latest released Toradex CE library.
Please guide us to know the possible reasons of this behaviour.
We have not disable the clock before setting the PRE_PODF and then enable the clock. However we have followed the steps of EIM clock settings as you have mentioned in sample code.
I am not able to understand the link between clock init and the FTM peripheral register init.
As we first init the clock module for ftm( CCM_CCGR22 and CCM_TARGET_ROOT83), then go for the entire FTM register init and that’s how we did in our project also.
We were working on Higher frequencies so far and not facing any issue with this interface.
But now as we need to work on lower frequencies again, we are facing the issue again with EIM register settings.
I am describing the issue again as below:
We are developing a smart device application on Visual studio for i.MX7D device using TORADEX SDK and SOM on Colibri i.MX7 EVK board with Win CE 7.
We are using EIM interface for one of our application and found that, When we slow down the EIM clock using( 3.90625 MHz ) PRE_PODF bits of CCM_TARGET_ROOT83 register( In our case eim clock source selected is 125 MHz and setting PRE_PODF to divide by 8 and BCD to Divide by 4), We observed that sometimes during EIM register initialisation, registers does not get updated by the values we assign to them. In fact with these settings CS0RCR1 or CS0WCR1 gets updated with some different settings.
However if we set the EIM clock to higher frequency 15.625 MHz( eim clock source selected is 125 MHz and setting PRE_PODF to divide by 2 and BCD to Divide by 4 ) then there is no issue with register settings and it works as expected.
The behaviour is unpredictable in first case.
Please find below the EIM Initialization code in attachments for your reference and review:link text
We have also tried your suggestion of previous comment “Clock disable and change PRE_PODF and enable clock” but it didn’t made any difference.