AN2836 Freescale Semiconductor / Motorola, AN2836 Datasheet - Page 33

no-image

AN2836

Manufacturer Part Number
AN2836
Description
Web Server Development with MC9S12NE64 and OpenTCP
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
{
}
//============================================================
// Initialize Port for LEDs, Switch, and Buttons
//============================================================
void demoinit(void)
//============================================================
/* main */
//============================================================
void main(void)
{
Freescale Semiconductor
{
}
INT16 len;
/* System clock initialization */
CLKSEL=0;
CLKSEL_PLLSEL = 0;
PLLCTL_PLLON = 0;
SYNR = 0;
REFDV = 0;
PLLCTL = 192;
PLLCTL_PLLON = 1;
while(!CRGFLG_LOCK);
CLKSEL_PLLSEL = 1;
ATDCTL2 =
ATDCTL3_S1C = 8;
ATDCTL3_FIFO = 0;
ATDCTL3_FRZ = 3;
ATDCTL4 =
ATDCTL4 = ATDCTL4 & ~ATDCTL4_SRES8_MASK; //10 bit
ATDCTL5 = ATDCTL5_SCAN_MASK;
DDRG_DDRG0 = 1;
DDRG_DDRG1 = 1;
DDRG_DDRG2 = 1;
DDRG_DDRG3 = 1;
//SWITCH (RUN/LOAD) 0:input
DDRG_DDRG4 = 0;
//BUTTON2
DDRH_DDRH4 = 0;
PIEH_PIEH4 = 1;
DDRH_DDRH5 = 0;
DDRH_DDRH6 = 0;
//LEDS
ATDCTL2_ADPU_MASK | ATDCTL2_AFFC_MASK;
ATDCTL4_PRS2_MASK |ATDCTL4_PRS1_MASK | ATDCTL4_PRS0_MASK;
PTG_PTG0 = 1;//turn off
PTG_PTG1 = 1;//turn off
PTG_PTG2 = 1;//turn off
PTG_PTG3 = 1;//turn off
Web Server Development with MC9S12NE64 and OpenTCP, Rev. 0
// 8 ch seq.
// no FIFO
// Freeze immediately in BDM
//PIEH4 Interrupt Enable
//0:input
//0:input
/* Set the multiplier register */
/* Set the divider register */
/* Select clock source from XTAL */
/* Disable the PLL */
/* Enable the PLL */
/* Wait */
/* Select clock source from PLL */
Overview of a Web Server Developed Using OpenTCP TCP/IP Stack
//1:output
//1:output
//1:output
//1:output
33

Related parts for AN2836