Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
sec_core1.c
Go to the documentation of this file.
1
17/*
18© [2024] Microchip Technology Inc. and its subsidiaries.
19
20 Subject to your compliance with these terms, you may use Microchip
21 software and any derivatives exclusively with Microchip products.
22 You are responsible for complying with 3rd party license terms
23 applicable to your use of 3rd party software (including open source
24 software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
25 NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
26 SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
27 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
28 WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
29 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
30 KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
31 MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
32 FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
33 TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
34 EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
35 THIS SOFTWARE.
36*/
37
38// FMBXM
39#pragma config MBXM0 = M2S //Mailbox 0 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
40#pragma config MBXM1 = M2S //Mailbox 1 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
41#pragma config MBXM2 = M2S //Mailbox 2 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
42#pragma config MBXM3 = M2S //Mailbox 3 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
43#pragma config MBXM4 = M2S //Mailbox 4 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
44#pragma config MBXM5 = M2S //Mailbox 5 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
45#pragma config MBXM6 = M2S //Mailbox 6 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
46#pragma config MBXM7 = M2S //Mailbox 7 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
47#pragma config MBXM8 = M2S //Mailbox 8 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
48#pragma config MBXM9 = M2S //Mailbox 9 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
49#pragma config MBXM10 = M2S //Mailbox 10 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
50#pragma config MBXM11 = M2S //Mailbox 11 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
51#pragma config MBXM12 = M2S //Mailbox 12 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
52#pragma config MBXM13 = M2S //Mailbox 13 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
53#pragma config MBXM14 = M2S //Mailbox 14 data direction->Mailbox register configured for Main data write (Main to Secondary data transfer)
54#pragma config MBXM15 = S2M //Mailbox 15 data direction->Mailbox register configured for Main data read (Secondary to Main data transfer)
55
56// FMBXHS1
57#pragma config MBXHSA = MBX4 //Mailbox handshake protocol block A register assignment->MSIxMBXD4 assigned to mailbox handshake protocol block A
58#pragma config MBXHSB = MBX14 //Mailbox handshake protocol block B register assignment->MSIxMBXD14 assigned to mailbox handshake protocol block B
59#pragma config MBXHSC = MBX15 //Mailbox handshake protocol block C register assignment->MSIxMBXD15 assigned to mailbox handshake protocol block C
60#pragma config MBXHSD = MBX15 //Mailbox handshake protocol block D register assignment->MSIxMBXD15 assigned to mailbox handshake protocol block D
61
62// FMBXHS2
63#pragma config MBXHSE = MBX15 //Mailbox handshake protocol block E register assignment->MSIxMBXD15 assigned to mailbox handshake protocol block E
64#pragma config MBXHSF = MBX15 //Mailbox handshake protocol block F register assignment->MSIxMBXD15 assigned to mailbox handshake protocol block F
65#pragma config MBXHSG = MBX15 //Mailbox handshake protocol block G register assignment->MSIxMBXD15 assigned to mailbox handshake protocol block G
66#pragma config MBXHSH = MBX15 //Mailbox handshake protocol block H register assignment->MSIxMBXD15 assigned to mailbox handshake protocol block H
67
68// FMBXHSEN
69#pragma config HSAEN = ON //Mailbox A data flow control protocol block enable->Mailbox data flow control handshake protocol block enabled
70#pragma config HSBEN = ON //Mailbox B data flow control protocol block enable->Mailbox data flow control handshake protocol block enabled
71#pragma config HSCEN = OFF //Mailbox C data flow control protocol block enable->Mailbox data flow control handshake protocol block disabled.
72#pragma config HSDEN = OFF //Mailbox D data flow control protocol block enable->Mailbox data flow control handshake protocol block disabled.
73#pragma config HSEEN = OFF //Mailbox E data flow control protocol block enable->Mailbox data flow control handshake protocol block disabled.
74#pragma config HSFEN = OFF //Mailbox F data flow control protocol block enable->Mailbox data flow control handshake protocol block disabled.
75#pragma config HSGEN = OFF //Mailbox G data flow control protocol block enable->Mailbox data flow control handshake protocol block disabled.
76#pragma config HSHEN = OFF //Mailbox H data flow control protocol block enable->Mailbox data flow control handshake protocol block disabled.
77
78// FS1DMTIVTL
79#pragma config S1DMTIVTL = 0x0 //Secondary Dead Man Timer Interval low word
80
81// FS1DMTIVTH
82#pragma config S1DMTIVTH = 0x0 //Secondary Dead Man Timer Interval high word
83
84// FS1DMTCNTL
85#pragma config S1DMTCNTL = 0x0 //Secondary DMT instruction count time-out value low word
86
87// FS1DMTCNTH
88#pragma config S1DMTCNTH = 0x0 //Secondary DMT instruction count time-out value high word
89
90// FS1DMT
91#pragma config S1DMTDIS = OFF //Secondary Dead Man Timer Disable bit->Secondary Dead Man Timer is Disabled and can be enabled by software
92
93// FS1OSCSEL
94#pragma config S1FNOSC = FRCPLL //Oscillator Source Selection->Fast RC Oscillator with divide-by-N with PLL module (FRCPLL)
95#pragma config S1IESO = OFF //Two-speed Oscillator Start-up Enable bit->Start up with user-selected oscillator source
96
97// FS1OSC
98#pragma config S1OSCIOFNC = OFF //Secondary OSC2 Pin Function bit->OSC2 is clock output
99#pragma config S1FCKSM = CSECMD //Clock Switching Mode bits->Clock switching is enabled,Fail-safe Clock Monitor is disabled
100#pragma config S1PLLKEN = S1PLLKEN_ON //S1PLLKEN->S1PLLKEN_ON
101
102// FS1WDT
103#pragma config S1RWDTPS = PS1048576 //Run Mode Watchdog Timer Post Scaler select bits->1:1048576
104#pragma config S1RCLKSEL = LPRC //Watchdog Timer Clock Select bits->Always use LPRC
105#pragma config S1WINDIS = ON //Watchdog Timer Window Enable bit->Watchdog Timer operates in Non-Window mode
106#pragma config S1WDTWIN = WIN25 //Watchdog Timer Window Select bits->WDT Window is 25% of WDT period
107#pragma config S1SWDTPS = PS1048576 //Sleep Mode Watchdog Timer Post Scaler select bits->1:1048576
108#pragma config S1FWDTEN = ON_SW //Watchdog Timer Enable bit->WDT controlled via WDTCON.ON bit
109
110// FS1ICD
111#pragma config S1ICS = PGD2 //ICD Communication Channel Select bits->Communicate on PGC2 and PGD2
112#pragma config S1ISOLAT = ON //Isolate the Secondary core subsystem from the Main subsystem during Debug->The Secondary can operate (in debug mode) even if the SLVEN bit in the MSI is zero.
113#pragma config S1NOBTSWP = OFF //BOOTSWP Instruction Enable/Disable bit->BOOTSWP instruction is disabled
114
115// FS1DEVOPT
116#pragma config S1ALTI2C1 = OFF //Alternate I2C1 Pin bit->I2C1 mapped to SDA1/SCL1 pins
117#pragma config S1SPI1PIN = PPS //S1 SPI1 Pin Select bit->Secondary SPI1 uses I/O remap (PPS) pins
118#pragma config S1SSRE = ON //Secondary Secondary Reset Enable->Secondary generated resets will reset the Secondary Enable Bit in the MSI module
119#pragma config S1MSRE = OFF //Main Secondary Reset Enable->The Main software oriented RESET events (RESET Op-Code, Watchdog timeout, TRAP reset, illegalInstruction) will not cause the Secondary subsystem to reset.
120
121// FS1ALTREG
122#pragma config S1CTXT1 = OFF //Specifies Interrupt Priority Level (IPL) Associated to Alternate Working Register 1 bits->Not Assigned
123#pragma config S1CTXT2 = OFF //Specifies Interrupt Priority Level (IPL) Associated to Alternate Working Register 2 bits->Not Assigned
124#pragma config S1CTXT3 = OFF //Specifies Interrupt Priority Level (IPL) Associated to Alternate Working Register 3 bits->Not Assigned
125#pragma config S1CTXT4 = OFF //Specifies Interrupt Priority Level (IPL) Associated to Alternate Working Register 4 bits->Not Assigned
126
127// FS1POR
128#pragma config S1BISTDIS = DISABLED //Secondary BIST on reset disable bit->Secondary BIST on reset feature disabled
129
130// Section: Included Files
131
132#include <stddef.h>
133#include <libpic30.h>
134#include "../sec_core_types.h"
135#include "../sec_core_interface.h"
136#include "../sec_core1.h"
137//#include "totem_pole_framework_secondary_2024.h"
138
139extern unsigned char dspic33ch_totem_pole_single_phase_secondary_IL[] __attribute__ ((space(psv)));
140#define SECONDARY_IMAGE dspic33ch_totem_pole_single_phase_secondary_IL
141#define SECONDARY_NUMBER 1
142
143/*
144 Backward compatibility DFP package support
145 dsPIC33CH-MP_DFP version: < v1.3.125
146*/
147#ifndef _MTSIRQ
148#define _MTSIRQ _MSTIRQ
149#endif
150
151// Section: File specific functions
152
153// Section: Driver Interface
154
157 .Deinitialize = &SEC_CORE1_Deinitialize,
158 .Program = &SEC_CORE1_Program,
159 .Start = &SEC_CORE1_Start,
160 .InterruptRequestGenerate = &SEC_CORE1_InterruptRequestGenerate,
161 .IsInterruptRequestAcknowledged = &SEC_CORE1_IsInterruptRequestAcknowledged,
162 .InterruptRequestComplete = &SEC_CORE1_InterruptRequestComplete,
163 .IsInterruptRequested = &SEC_CORE1_IsInterruptRequested,
164 .InterruptRequestAcknowledge = &SEC_CORE1_InterruptRequestAcknowledge,
165 .InterruptRequestAcknowledgeComplete= &SEC_CORE1_InterruptRequestAcknowledgeComplete,
166 .GetResetCause = &SEC_CORE1_GetResetCause,
167 .ResetCauseClear = &SEC_CORE1_ResetCauseClear,
168 .SystemStatusGet = &SEC_CORE1_SystemStatusGet,
169 .WriteFIFOEnable = &SEC_CORE1_WriteFIFOEnable,
170 .WriteFIFODisable = &SEC_CORE1_WriteFIFODisable,
171 .ReadFIFOEnable = &SEC_CORE1_ReadFIFOEnable,
172 .ReadFIFODisable = &SEC_CORE1_ReadFIFODisable,
173 .FIFORead = &SEC_CORE1_FIFORead,
174 .FIFOWrite = &SEC_CORE1_FIFOWrite,
175 .FIFOReadIsFull = &SEC_CORE1_FIFOReadIsFull,
176 .FIFOReadIsEmpty = &SEC_CORE1_FIFOReadIsEmpty,
177 .FIFOWriteIsFull = &SEC_CORE1_FIFOWriteIsFull,
178 .FIFOWriteIsEmpty = &SEC_CORE1_FIFOWriteIsEmpty,
179 .ProtocolRead = &SEC_CORE1_ProtocolRead,
180 .ProtocolWrite = &SEC_CORE1_ProtocolWrite,
181 .ProtocolIsFull = &SEC_CORE1_ProtocolIsFull,
182 .ProtocolIsEmpty = &SEC_CORE1_ProtocolIsEmpty,
183 .ProtocolCallbackRegister = NULL,
184 .ReadFIFODataReadyCallbackRegister = NULL,
185 .WriteFIFOEmptyCallbackRegister = NULL,
186 .FIFOOverFLowUnderFlowCallbackRegister = NULL,
187 .SecondaryInitiatedCallbackRegister = NULL,
188 .SecondaryBreakCallbackRegister = NULL,
189 .SecondaryResetCallbackRegister = NULL,
190};
191
192// Section: SEC_CORE1 Module APIs
193
195{
196 //SRSTIE disabled; STMIACK disabled; MSTIRQ disabled; RFITSEL Trigger data valid interrupt when 1st FIFO entry is written by Slave; SLVEN disabled;
197 MSI1CON = 0x0U;
198 //RFEN disabled; WFEN disabled;
199 MSI1FIFOCS = 0x0U;
200
201
202}
203
205{
206 MSI1CON = 0x0U;
207 MSI1FIFOCS = 0x0U;
208
209}
210
212{
213 #if __XC16_VERSION__ < 1700
214
215 /*
216 Backward compatibility support for
217 XC16 version < v1.70
218 dsPIC33CH-MP_DFP version < 1.6.186
219 */
220
221 _start_slave();
222 #else
223 _start_secondary();
224 #endif
225}
226
228{
229 #if __XC16_VERSION__ < 1700
230
231 /*
232 Backward compatibility support for
233 XC16 version < v1.70
234 dsPIC33CH-MP_DFP version < 1.6.186
235 */
236
237 _program_slave(SECONDARY_NUMBER,0,SECONDARY_IMAGE);
238 #else
239 _program_secondary(SECONDARY_NUMBER,0,SECONDARY_IMAGE);
240 #endif
241}
242
244{
245 MSI1CONbits.MTSIRQ = 1U;
246}
247
249{
250 return(MSI1STATbits.MTSIACK);
251
252}
253
255{
256 MSI1CONbits.MTSIRQ = 0U;
257}
258
260{
261 return(MSI1STATbits.STMIRQ);
262}
264{
265 MSI1CONbits.STMIACK = 1U;
266}
267
269{
270 MSI1CONbits.STMIACK = 0U;
271}
272
274{
275 enum SEC_CORE_RESET_CAUSE resetCause;
276
277 if(MSI1STATbits.SLVWDRST)
278 {
280 }
281 else
282 {
284 }
285
286 return resetCause;
287}
288
290{
291 switch(resetCause)
292 {
293 case SEC_CORE_RESET_CAUSE_WATCHDOG : MSI1STATbits.SLVWDRST = 0U;
294 break;
295 default :
296 break;
297 }
298}
299
301{
303
304 if(MSI1STATbits.SLVRST)
305 {
307 }
308 else
309 {
310 switch(MSI1STATbits.SLVPWR)
311 {
313 break;
314 case 1: systemStatus = SEC_CORE_SYSTEM_STATUS_IDLE_MODE;
315 break;
316 case 2: systemStatus = SEC_CORE_SYSTEM_STATUS_SLEEP_MODE;
317 break;
318 default:systemStatus = SEC_CORE_SYSTEM_STATUS_RUNNING_STATE;
319 break;
320 }
321 }
322 return systemStatus;
323}
324
325uint16_t SEC_CORE1_FIFORead(uint16_t *pData, uint16_t wordCount)
326{
327 uint16_t readCountStatus = 0U;
328
329 while(wordCount)
330 {
332 {
333 *pData++ = MRSWFDATA;
334 wordCount--;
335 readCountStatus++;
336 }
337 else
338 {
339 break;
340 }
341 }
342 return readCountStatus;
343}
344
345uint16_t SEC_CORE1_FIFOWrite(uint16_t *pData, uint16_t wordCount)
346{
347 uint16_t writeCountStatus = 0U;
348
349 while(wordCount)
350 {
352 {
353 MWSRFDATA = *pData++;
354 wordCount--;
355 writeCountStatus++;
356 }
357 else
358 {
359 break;
360 }
361 }
362 return writeCountStatus;
363}
364
365bool SEC_CORE1_ProtocolWrite(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
366{
367 bool status = false;
368 switch(protocolName)
369 {
370 case MSI1_ProtocolA:
372 {
373 MSI1MBX0D = pData[0];
374 MSI1MBX1D = pData[1];
375 MSI1MBX2D = pData[2];
376 MSI1MBX3D = pData[3];
377 MSI1MBX4D = pData[4];
378 status = true;
379 }
380 else
381 {
382 status = false;
383 }
384 break;
385 case MSI1_ProtocolB:
387 {
388 MSI1MBX5D = pData[0];
389 MSI1MBX6D = pData[1];
390 MSI1MBX7D = pData[2];
391 MSI1MBX8D = pData[3];
392 MSI1MBX9D = pData[4];
393 MSI1MBX10D = pData[5];
394 MSI1MBX11D = pData[6];
395 MSI1MBX12D = pData[7];
396 MSI1MBX13D = pData[8];
397 MSI1MBX14D = pData[9];
398 status = true;
399 }
400 else
401 {
402 status = false;
403 }
404 break;
405 default:
406 break;
407 }
408 return status;
409}
410
411bool SEC_CORE1_ProtocolRead(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
412{
413 bool status = false;
414 switch(protocolName)
415 {
416 default:
417 break;
418 }
419 return status;
420}
421
422
423
424
This is the generated driver header file for the SEC_CORE1 driver.
This is the generated driver types header file for the SEC_CORE driver.
@ SEC_CORE_RESET_CAUSE_WATCHDOG
@ SEC_CORE_RESET_CAUSE_UNSPECIFIED
@ SEC_CORE_SYSTEM_STATUS_IN_RESET_STATE
@ SEC_CORE_SYSTEM_STATUS_IDLE_MODE
@ SEC_CORE_SYSTEM_STATUS_RUNNING_STATE
@ SEC_CORE_SYSTEM_STATUS_SLEEP_MODE
@ SEC_CORE_SYSTEM_STATUS_NOT_IN_LOW_POWER_MODE
@ MSI1_ProtocolA
@ MSI1_ProtocolB
#define SECONDARY_NUMBER
Definition sec_core1.c:141
#define SECONDARY_IMAGE
Definition sec_core1.c:140
unsigned char dspic33ch_totem_pole_single_phase_secondary_IL[]
size_t status
Definition uart1.c:99
void SEC_CORE1_InterruptRequestGenerate(void)
This routine generates interrupt to SEC_CORE1.
Definition sec_core1.c:243
void SEC_CORE1_InterruptRequestAcknowledge(void)
This routine acknowledges interrupt received from SEC_CORE1.
Definition sec_core1.c:263
uint16_t SEC_CORE1_FIFOWrite(uint16_t *pData, uint16_t wordCount)
This routine transfers FIFO data to SEC_CORE1.
Definition sec_core1.c:345
enum SEC_CORE_RESET_CAUSE SEC_CORE1_GetResetCause(void)
This routine returns the cause for SEC_CORE1 reset.
Definition sec_core1.c:273
SEC_CORE_RESET_CAUSE
Defines the sec_core reset cause enumeration.
static void SEC_CORE1_WriteFIFODisable(void)
This inline function Disables the Write FIFO.
Definition sec_core1.h:373
uint16_t SEC_CORE1_FIFORead(uint16_t *pData, uint16_t wordCount)
This routine reads FIFO data sent from the SEC_CORE1.
Definition sec_core1.c:325
void SEC_CORE1_Program(void)
This routine programs secondary.
Definition sec_core1.c:227
void SEC_CORE1_InterruptRequestComplete(void)
This routine clears interrupt to SEC_CORE1.
Definition sec_core1.c:254
static bool SEC_CORE1_ProtocolIsEmpty(enum SEC_CORE_PROTOCOLS protocolName)
This inline function checks whether mailbox is empty. Returns true if Protocol is empty indicating ma...
Definition sec_core1.h:507
void SEC_CORE1_Start(void)
This routine enables secondary core.
Definition sec_core1.c:211
const struct SEC_CORE_INTERFACE MSIInterface
Structure object of type SEC_CORE_INTERFACE with the custom name given by the user in the Melody Driv...
Definition sec_core1.c:155
void SEC_CORE1_Initialize(void)
This routine initializes the MSI driver. This routine must be called before any other MSI routine is ...
Definition sec_core1.c:194
bool SEC_CORE1_IsInterruptRequested(void)
This routine returns the status of interrupt request from the SEC_CORE1.
Definition sec_core1.c:259
static bool SEC_CORE1_FIFOWriteIsEmpty(void)
This inline function checks whether the status of Write FIFO is Empty. Returns true if last write by ...
Definition sec_core1.h:446
enum SEC_CORE_SYSTEM_STATUS SEC_CORE1_SystemStatusGet(void)
This routine returns Secondary system status.
Definition sec_core1.c:300
bool SEC_CORE1_ProtocolWrite(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine writes data to mailbox.
Definition sec_core1.c:365
bool SEC_CORE1_IsInterruptRequestAcknowledged(void)
This routine returns the status of interrupt request acknowledge from the SEC_CORE1.
Definition sec_core1.c:248
static bool SEC_CORE1_FIFOReadIsEmpty(void)
This inline function checks whether the status of Read FIFO is Empty. Returns true if last read by Ma...
Definition sec_core1.h:420
bool SEC_CORE1_ProtocolRead(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine reads data from mailbox.
Definition sec_core1.c:411
void SEC_CORE1_InterruptRequestAcknowledgeComplete(void)
This routine clears acknowledge for interrupt received from SEC_CORE1.
Definition sec_core1.c:268
SEC_CORE_SYSTEM_STATUS
Defines the status enumeration for sec_core.
static void SEC_CORE1_WriteFIFOEnable(void)
This inline function Enables the Write FIFO.
Definition sec_core1.h:362
SEC_CORE_PROTOCOLS
Defines the list of Protocols configured for SEC_CORE_driver.
static bool SEC_CORE1_ProtocolIsFull(enum SEC_CORE_PROTOCOLS protocolName)
This inline function checks whether mailbox is full. Returns true if new data are ready to read....
Definition sec_core1.h:480
void SEC_CORE1_ResetCauseClear(enum SEC_CORE_RESET_CAUSE resetCause)
This routine clears the cause for SEC_CORE1 reset.
Definition sec_core1.c:289
static bool SEC_CORE1_FIFOWriteIsFull(void)
This inline function checks whether the status of Write FIFO is Full. Returns true if last write by M...
Definition sec_core1.h:433
void SEC_CORE1_Deinitialize(void)
Deinitializes SEC_CORE1 to POR values.
Definition sec_core1.c:204
static bool SEC_CORE1_FIFOReadIsFull(void)
This inline function checks whether the status of Read FIFO is full. last write by Secondary core to ...
Definition sec_core1.h:407
static void SEC_CORE1_ReadFIFODisable(void)
This inline function Disables the Read FIFO.
Definition sec_core1.h:395
static void SEC_CORE1_ReadFIFOEnable(void)
This inline function Enables the Read FIFO.
Definition sec_core1.h:384
Structure containing the function pointers of SEC_CORE driver.
void(* Initialize)(void)
Pointer to SEC_COREx_Initialize e.g. SEC_CORE1_Initialize.