![]() | ![]() | ![]() |
| | #91 |
|
Jason, you can control the startup.s file through a GUI, in case you haven't noticed.
| |
| |
| | #92 |
|
yeah i noticed it... i disabled all PLL stuff and doing it in CODE. Simpler to me. Code: void init_PLL(void)
{
PLLCFG = 0x00000024; //Set Multiplier and Divider of PLL to give 60MHz
PLLCON = 0x00000001; //Enable the PLL
PLLFEED = 0x000000AA; //Update PLL registers with feed sequence
PLLFEED = 0x00000055;
while(!(PLLSTAT & 0x00000400)); //Test Lock bit
PLLCON = 0x00000003; //Connect the PLL
PLLFEED = 0x000000AA; //Update PLL registers with feed sequence
PLLFEED = 0x00000055;
VPBDIV = 0x00000002; //Set the VLSI peripheral bus to 30MHz
}
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics | |
| |
| | #93 |
|
Small nice BLINK.C ... i made the delays they seem to work as supposed to but not 100% sure ![]() Code: #include <LPC210x.h>
#define LED 0
void SetPin(unsigned long tPin){
IOPIN = IOPIN | (1<<tPin);
}
void ClrPin(unsigned long tPin){
IOPIN = IOPIN & ~(1<<tPin);
}
void delayus(unsigned int time){
unsigned int x, delay;
for(x=0;x<time;x++){
for(delay=0;delay<8;delay++){
;
}
}
}
void delayms(unsigned int time){
unsigned int x, delay;
for(x=0;x<time;x++){
for(delay=0;delay<7540;delay++){
;
}
}
}
void init_PLL(void){
PLLCFG = 0x00000024; //Set Multiplier and Divider of PLL to give 60MHz
PLLCON = 0x00000001; //Enable the PLL
PLLFEED = 0x000000AA; //Update PLL registers with feed sequence
PLLFEED = 0x00000055;
while(!(PLLSTAT & 0x00000400)); //Test Lock bit
PLLCON = 0x00000003; //Connect the PLL
PLLFEED = 0x000000AA; //Update PLL registers with feed sequence
PLLFEED = 0x00000055;
VPBDIV = 0x00000002; //Set the VLSI peripheral bus to 30MHz
}
int main(void){
init_PLL();
PINSEL0 = 0x00000000;
IODIR = 0xFFFFFFFF;
while(1){
SetPin(LED);
delayms(300);
ClrPin(LED);
delayms(300);
}
}
__________________ AtomSofts eBay Store AtomSoftTech: C18 TIPS & TRICKS v9 PDF Nokia 6100 Driver/Software My Name: Jason Lopez http://atomsofttech.info/ | My YouTube Videos! My Favorite Store: dipmicro Electronics Last edited by AtomSoft; 24th June 2009 at 02:22 PM. | |
| |
|
| Tags |
| arm, cortex |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| ARM Cortex Microcontrollers? | dknguyen | Micro Controllers | 0 | 10th February 2009 12:37 AM |
| ARM Cortex-M3 DSP | dknguyen | Micro Controllers | 1 | 2nd February 2009 04:47 PM |