having trouble with lpc43xx

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

having trouble with lpc43xx

632 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gil_alon9 on Mon Dec 23 11:01:33 MST 2013
I need help with figuring the pins on the mcb4300 developement board.
meaning: i need to know how to use the functions of
the gpio's :

-like why in the function i can only write to ports 0-4
when there is like (0-F) 15 ports.

-secondly what do i need to place instead of bit_value
so i coud operate on a a specific pin e.g : p0_1,p2_4 and so forth...



[color=#f00]Thanks in advanced for your help. :)  :)  :) [/color]
Labels (1)
0 Kudos
Reply
4 Replies

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Dec 26 12:33:34 MST 2013
It would always be good to know the compiler you have, then it's easier to provide a useful example.
The LPCOpen package provides examples for Keil µVision, for IAR EWARM and for LPCXpresso.
So it's not a bad choice as starting point.

In the Keil environment you also find examples after installation of the toolchain here:

.\Keil\ARM\Boards\Keil\MCB4300

IAR also has an example somewhere in a folder.
0 Kudos
Reply

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wellsk on Thu Dec 26 09:36:00 MST 2013
>give me a link so i could download them
These are the LPCOpen packages for the LCP43xx @ http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages

>Did you ever used some of these functions on that evaluation board ( mcb4300 )?
Grab the package specific to the Keil MBC4300 board at that link above. Pick the LPCXpresso package if you are using the LPCXpresso toolchain or the Keil/IAR package of you are using IAR Embedded Workbench or Keil uVision.

You can get basic quickstart for the LPCopen platforms @ http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quicks...
0 Kudos
Reply

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gil_alon9 on Mon Dec 23 23:24:15 MST 2013
I dont have these kind of functions could you give me a link so i could download them
or at least a web adress i would love it.

Did you ever used some of these functions on that evaluation board ( mcb4300 )?
0 Kudos
Reply

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wells on Mon Dec 23 11:19:00 MST 2013

Quote:
-like why in the function i can only write to ports 0-4
when there is like (0-F) 15 ports.


Can you show the function prototype with comments?


Quote:
-secondly what do i need to place instead of bit_value
so i coud operate on a a specific pin e.g : p0_1,p2_4 and so forth...


I can answer this question for the LPCOpen GPIO functions, but I'm not sure if that is what you are using.
Most LPCOpen functions operate on individual pins or ports.

You can set individual port/pin states with the Chip_GPIO_SetPinState() function.
/**
 * @briefSet a GPIO pin state via the GPIO byte register
 * @parampGPIO: The base of GPIO peripheral on the chip
 * @param port: GPIO Port number where @a pin is located
 * @parampin: GPIO pin to set
 * @paramsetting: true for high, false for low
 * @returnNothing
 * @noteThis function replaces Chip_GPIO_WritePortBit()
 */
STATIC INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting)

Example: Chip_GPIO_SetPinState(LPC_GPIO, 0, 5, true); /* Set PIO0_5 high */


You can set the states of ALL pins in a single port at once using the Chip_GPIO_SetPortValue() function.
/**
 * @briefSet all GPIO raw pin states (regardless of masking)
 * @parampGPIO: The base of GPIO peripheral on the chip
 * @paramport: GPIO Port number where @a pin is located
 * @paramvalue: Value to set all GPIO pin states (0..n) to
 * @returnNothing
 */
STATIC INLINE void Chip_GPIO_SetPortValue(LPC_GPIO_T *pGPIO, uint8_t port, uint32_t value)

Example: Chip_GPIO_SetPortValue(LPC_GPIO, 0, ((1<<5) | (1<<7))); /* Set PIO0_5 and PIO0_7 high, but all others low */


You can set multiple pins in a port high or low with the Chip_GPIO_SetPortOutHigh() and Chip_GPIO_SetPortOutLow() functions.
Chip_GPIO_SetPortOutLow(LPC_GPIO, 1, ((1<<4) | (1<<5) | (1<<9))); /* Set only pins 4, 5, and 9 on port 1 low */
Chip_GPIO_SetPortOutHigh(LPC_GPIO, 1, ((1<<4) | (1<<5) | (1<<9))); /* Set only pins 4, 5, and 9 on port 1 high*/


Likewise, you can get and set individual pin states and directions using the functions in gpio_18xx_43xx.h.
Almost all GPIO functions are inlined so you can see the source code for them in the header file and these use very little memory.
0 Kudos
Reply