Current setup:
LPC2468 uVision3 V3.1.0.903 with flash magic LPC2300.s as the start up file
We have a simple C file to set GPIO's as outputs and set them high. It compiled correctly and was programmed into the ARM successfully. The voltage measured on these GPIO's was a strange 2.3v where it should have been 3.3V. Some of the GPIO's do have a correct 3.3v, but not all of them. We then used a LPC2400.s startup file from the trial version of uVision4 to compile and program. The same issue persisted and, in addition, the software debugger would throw an error executing the startup file.
Using the above C file along with the trial verison of uVision4 and the LPC2400.s startup file, the GPIO's behave as expected.
We are using uVision3 because that is what our license covers and we have gone over the file size limits of the trial version. Our small school budget does not allow us to renew our license.
-Students from the University of Florida
void init_PLL(void) {
SCS &= ~0x0010; // Select main oscillator range SCS |= 0x0020; // Enable main oscillator PLLCON &= 0x0002; // Disconect the PLL PLLFEED = 0x00AA; // First Feed Sequence PLLFEED = 0x0055; // Second Feed Seq. PLLCON &= ~0x0001; // Diasable the PLL PLLFEED = 0x00AA; // First Feed Sequence PLLFEED = 0x0055; // Second Feed Seq. while(!(SCS&0x0040)); // Wait until main clock is stable CLKSRCSEL = 0x0001; // Set Main osc as input to PLL PLLCFG = 0x0013; // M = 20, N = 1 yields IF of 480MHz PLLFEED = 0x00AA; // First Feed Sequence PLLFEED = 0x0055; // Second Feed Seq. PLLCON = 0x0001; // Enable PLL PLLFEED = 0x00AA; // First Feed Sequence PLLFEED = 0x0055; // Second Feed Seq. USBCLKCFG = 0x009; // Set USBclk to 48MHz CCLKCFG = 0x0007; // Set cclk to 60MHz while(!(PLLSTAT & 0x04000000)); // Wait Until PLL Freq. is Locked PLLCON = 0x0003; // Start PLL PLLFEED = 0x00AA; // Update PLL Registers PLLFEED = 0x0055; } // End init_PLL()
void init_VPBclock(void) { PCLKSEL0 = 0xAAAAAAAA; // Set all Peripherals to 30MHz PCLKSEL1 = 0x22AAA8AA; // Set all Peripherals to 30MHz } // End init_VPBclock()
void init_MAM(void) { MAMTIM =0x0003; // Max FLASH Fetch->20MHz: Pclk->60MHz: Therefore set MAM Timing to 3 MAMCR = 0x0002; // Turn MAM Fully On } // End init_MAM()
void init_GPIO() { SCS |= 0x1; PINSEL0 = 0x00000000;
FIO0MASK = 0x00000000;
FIO0DIR0 |= 0x3;
FIO0PIN0 |= 0x3; }