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
Check if the addresses for the GPIO registers are correct in the header file for the processor. Same for all registers used to control if pins are GPIO or mapped to peripherial devices like I2C, SPI, ...
2.3V is a possible value if the GPIO is set as input and with internal pull-up/pull-down deactivated.
Since you do have a working setup and a non-working setup, it should be possible to compare the contents of the header files to see what changes there are.
You don't tell what GPIO works and what GPIO doesn't work, so it's hard to tell what potential register accesses that may be involved.
Colin; This has nothing to do with your particular problem but I wish to make a suggestion. Be pro-active and contact the Keil Sales people in the US. I'm not talking about a distributor but the actual Keil sales force. In the past, Keil has been very supportative of University programs with reduced license fees. I hope they still continue with their educational support. Bradford
We have pins P2.24 and P2.25 configured as working GPIO's given the current setup(uVision3 with LPC2300.s startup file). We are using the same header file between the two setups, but the startup file differs. The startup files did have different variables and code, but the repeated variables in both startup files had the same equate values. Thanks for the help!
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; }
int main(void) { init_PLL(); // Set PLL for 60MHz init_VPBclock(); // Set Peripherals for 30MHZ init_MAM(); // Turn MAM Fully On init_GPIO(); // sets the pinselects and iodirections while(1) { FIO0PIN |= 0x00000003; }
I am using the above code to try to turn on P0.0 and P0.1 on a LPC2468 Dev board, but the voltages are incorrect. Is there something obvious that i am overlooking?
We were given a student rate of $490.00 US which is well above our budget for a software IDE.
Colin; I can understand the cost problem as a student but a 90% discount for the U of F seems quite generous to me. After all that's less than the cost of one football helmut! Bradford
Are US universities really that impoverished??
As already noted, that's very much in the same ballpark as other disciplines would need to expect to pay for the equipment necessary to their studies - sports equipment, musical instruments, etc, etc,...
However, if cash really is that tight, then you should be looking at the free options available based on GCC, etc. They will probably take longer to set up but, once that's done, can produce perfectly acceptable results. Could be a student project there...