Help with 'NO' LPCOpen Board Library Project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with 'NO' LPCOpen Board Library Project

310 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by emimad on Tue Sep 08 13:24:21 MST 2015
Hi,
I have a LPCXpresso 1347A board mounted on my bread board with some leds, 7-segments displays and so on.
When I start a new project selecting LPCOpen Chip Library Project: lpc_chip_13xx and LPCOpen Board Library Project: lpc_board_nxp_lpcxpresso_1347, the board works fine with a homemade delay function.

However, I can't work with PI0_4 because it's configurated as pinmuxing for I2C SCL.


I don't want to work with LPCOpen Board Library because my project board isn't similar, so I thought to not include the board library at setup a new project.
PI0_4 now works fine but when the program goes to the delay function, it stall and stop.


Can you help me to configure my next projects without use LPCOpen Board Library?

My delay function is as below:

#include "chip.h"


volatile uint32_t msTicks;/* counts 1ms timeTicks */

void SysTick_Handler(void)
{
msTicks++;/* increment counter necessary in Delay() */
}

void _delay_ms(uint32_t del)
{
uint32_t curTicks;
curTicks = msTicks;

while ((msTicks - curTicks) < del)
{
__WFI();
}
}

void setSYSTICK(void)// Setup Systick!
{
if (SysTick_Config(SystemCoreClock / 1000))
{ /* Setup SysTick Timer for 1 msec interrupts  */
while (1);                                  /* Capture error */
}

if ( !(SysTick->CTRL & SysTick_CTRL_CLKSOURCE_Msk) );

}


Labels (1)
0 Kudos
1 Reply

270 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by emimad on Wed Sep 09 15:09:21 MST 2015
Solved with last LPCXpresso IDE update.
Only need to add

#if defined (__USE_LPCOPEN)
    SystemCoreClockUpdate();               <---
    setSYSTICK();                                   <---



PI0_4 didn't worked because it's an open drain pin. Just pull up and start playing!
0 Kudos