Hello,
I’m using the MPC5777C micro in an NXP EVB and I’m trying to activate an EMIOS channel in DAOC mode, I think I have followed the directions of the user manual, but I can not make it to work. For me at this moment seems like DAOC is not enabled in this microcontroller.
I have some basic experience with EMIOS, because I have successfully enabled EMIOS channels in these modes: MC, SAOC, OPWFM, SAIC, IPM, IPWM, but this mode is not working for me.
If possible please let me know your thoughts of what is wrong with my configuration or understanding of this EMIOS mode.
The specific features and configurations details:
This test software is done for the NXP EVB and is configured to use the 16 MHz Internal RC Oscillator (IRC), this means the nominal per_clk operating frequency is 8 MHz or 125 microseconds period, this is the sys-clock for EMIOS-0.
CONFIG-0: Set eMIOS 0 channel 23 with these settings:
Configured in MC mode, with these specific settings
•Modulus Counter = 0x10
•Up mode
•Internal counter
•With clear on match start
•Interrupt enabled.
•Only one flag generated on A match
•For 200 Hz operating frequency, with an input clock of 8MHz, the required counts for REG-A = 8MHz/200Hz = 40000 counts = 0x9C40 counts.
CONFIG-1: Set eMIOS 0 channel 21 with these settings:
Configured in DAOC mode, with these specific settings
•Pulse polarity: Positive Pulse = EDPOL= 1
•Use Global Counter Bus A.
•Rising edge shall be 1 millisecond after enabling the global time base, this means REG-A is initialized to 1msec/125microsec = 8000 = 0x1F40 counts (I think this value is valid because is smaller than EMIOS0-CH23-REG-A=0x9C40)
•Falling edge shall be 3 milliseconds after enabling the global time base, this means REG-B is initialized to 3msec/125microsec = 24000 = 0x5DC0 counts (I think this value is valid because is smaller than EMIOS0-CH23-REG-A=0x9C40)
•Interrupt enabled.
•Only one flag generated on B match
CONFIG-2: Set PCR200 /EMIOS0-CH21 pin port with these settings:
•In primary mode (EMIOS)
•Output mode
CONFIG-3: Set PCR199 pin port with these settings:
•In GPIO mode
•Output mode
CONFIG-4: Set PCR201 pin port with these settings:
•In GPIO mode
•Output mode
CONFIG-5: eMIOS0-> CH21 & eMIOS0-> CH23 ISRs are:
•Configured
•Enabled
•Lowest priority set: 1
Detailed functional description and sequence of events
1.Global prescaler is disabled
2.PCR199 pin port configured as CONFIG-3
3.PCR201 pin port configured as CONFIG-4
4.PCR200 pin port configured as CONFIG-2
5.EMIOS0-CH23 is configured as CONFIG-0
6.EMIOS0-CH21 is configured as CONFIG-1
7.ISRs for EMIOS0-CH23 & EMIOS0-CH21 are configured as CONFIG-5
a.GPIO201 configured to toggle high and low whenever the EMIOS0-CH23-ISR is executed.
b.GPIO199 configured to toggle high and low whenever the EMIOS0-CH21-ISR is executed.
8.Enable global prescaler and global time base
9.No other interrupts or functions are executed.
The expected result:
EMIOS0-CH21 working on DAOC mode with a single positive pulse of 2 milliseconds
EMIOS0-CH21 toggling at the falling edge of EMIOS0-CH21->DAOC pulse
GPIO201 is toggling at 200 Hz because is toggled by EMIOS0-CH23-ISR in MC up mode at 200 Hz frequency.
The actual test results:
EMIOS0-CH21 always stays high after the DAOC mode is enabled.
GPIO201 is toggling at 200 Hz (EMIOS0-CH23 in MC up mode at 200 Hz frequency).
Other tests I have done:
1.I tested different values for EMIOS0-21 REG-A and REG-B, with no difference.
2.I tested to use the internal counter as counter bus for the EMIOS0-21 but did not make any difference.
3.I tested successfully other EMIO mode (OPWFM) in the same pin port, this means the pin port is working fine and is properly configured.
4.I tested the same software with different values for EMIOS0-CH21.IC->EDPOL and EDSEL registers but there was no actual difference.
I attached:
1.Register values of EMIOS and SIU after the software is ran for some time. (registers.txt)
2.Oscilloscope snapshots (tek00000-00005.png) of the initial time when the software is executed, this is the meaning of the channels:
a.CHANNEL-1= GPIO201
b.CHANNEL-2=EMIOS0-CH21
c.CHANNEL-3=GPIO199
In the scope images is clear that:
EMIOS0-CH23 is working fine in MC up mode at 200 Hz.
EMIOS0-CH21 is just in active high right after this EMIOS-DAOC channel is enabled by the global plescaler and global enabler.
Additional details:
1.The EVB hardware setup we are using:
a.Daughter board: 700-28088 REV C, SCH-28088 REV D
b.Mother board: 700-27237 REV D, SCH-27237 REV C
2.The used microcontroller user manual: “MPC5777C Reference Manual, Rev. 3, 02/2015”
3.The microcontroller has this label in the package: “SPC5777CDMM03 3N45H CTA01738D”