LPC 1112 LED

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

LPC 1112 LED

6,179 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Kaveh.t on Fri Mar 13 03:46:06 MST 2015

Hi there, i have The LPC 1112 on my own PCB and associated  a LED  to Pin 22 .

This Pin 22 is Named    R/PIO1_0/AD1/CT32B1_CAP0    on the Pin Layout.

Now I want to configure the GPIO Funktion for the System.In The user Manual  there are several Modes for this Pin.

I want to create a GPIO Funktion in this Case i have to set bit 2:0  to the Value  01x for Selecting   PIO1_0  .

When I Debug there are no Errors but the LED is not Blinking.

I load the created Hexa File on my Flash Magic. without Problems.

Can you Please help me out which configuration I have to generate in my source code to make it work.

Console Output Screenshot and Source code are added as attachement.


Best Regards

Kaveh


1:38:32 **** Incremental Build of configuration Debug for project Blinky ****
make -r all
Building file: ../src/blinky.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -I"C:\nxp\workspace\CMSIS_CORE_LPC11xx\inc" -I"C:\nxp\workspace\Blinky\Common\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"src/blinky.d" -MT"src/blinky.o" -MT"src/blinky.d" -o "src/blinky.o" "../src/blinky.c"
Finished building: ../src/blinky.c

Building target: Blinky.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\nxp\workspace\CMSIS_CORE_LPC11xx\Debug" -Xlinker -Map="Blinky.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "Blinky_Debug.ld" -o "Blinky.axf"  ./src/blinky.o ./src/cr_startup_lpc11.o  ./Common/src/clkconfig.o ./Common/src/gpio.o ./Common/src/timer16.o   -lCMSIS_CORE_LPC11xx
Finished building target: Blinky.axf

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-objcopy -O ihex Blinky.axf Blinky.hex;


11:38:33 Build Finished (took 436ms)



Original Attachment has been moved to: LPC_Blinky_GPIO_Confguration.zip

0 Kudos
Reply
9 Replies

6,058 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Mar 17 12:15:43 MST 2015

Quote: Kaveh.t
Yes I changed, this



No, you did not  J)

Must be a language problem, let's try it in germanski:

[color=#f00]Es gibt keine Pin Funktion 4 nicht !!!!!!!![/color]

LPC_IOCON->R_PIO1_0 |= (0x1<<2); // Set Port 1 Pin 0 as GPIO1_0 


Das ist Unsinn, also ist dein Pin immer noch nicht GPIO und folglich kannst du ihn auch nicht als Ausgang verwenden...

Also: im User Manual nachsehen, welche PIN Funktion GPIO ist und dann im IOCON Register setzen 
0 Kudos
Reply

6,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Kaveh.t on Tue Mar 17 11:30:51 MST 2015
Yes I changed, this

i want to  know how i can set the value from pin 22 to 0.
the pin 22 is constant on 3,3 V.

the LED has a Resistor associated in Serie.



18:57:58 **** Incremental Build of configuration Debug for project Blinky ****
make -r all
Building file: ../src/blinky.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -I"C:\nxp\workspace\CMSIS_CORE_LPC11xx\inc" -I"C:\nxp\workspace\Blinky\Common\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"src/blinky.d" -MT"src/blinky.o" -MT"src/blinky.d" -o "src/blinky.o" "../src/blinky.c"
Finished building: ../src/blinky.c

Building target: Blinky.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\nxp\workspace\CMSIS_CORE_LPC11xx\Debug" -Xlinker -Map="Blinky.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "Blinky_Debug.ld" -o "Blinky.axf"  ./src/blinky.o ./src/cr_startup_lpc11.o  ./Common/src/clkconfig.o ./Common/src/gpio.o ./Common/src/timer16.o   -lCMSIS_CORE_LPC11xx
Finished building target: Blinky.axf

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-objcopy -O ihex Blinky.axf Blinky.hex;


18:57:59 Build Finished (took 733ms)
0 Kudos
Reply

6,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Tue Mar 17 00:52:49 MST 2015
Following the datasheet only PIO0_7 can drive a normal led. Is your led a low power device?
0 Kudos
Reply

6,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Mar 16 08:24:01 MST 2015
:quest:

And did you change your errors of #4 :quest:

There is no PIO1_0 function 4  |(  This line is nonsense....

Bit 19 of SYSAHBCLKCTRL is reserved, so what are you enabling here  |(   This line is nonsense, too...

BTW: Are you using your LED with resistor or is it a 3.3V LED :quest:
0 Kudos
Reply

6,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Kaveh.t on Mon Mar 16 07:52:16 MST 2015
Pin 19 is the SWDCLK_PIO_1 on the LPC 1112.

Funktion 4 of the IO is open drain Mode but i didnt need it.

I connected the Pin 22 to the LED an the other end of the LED to + 3,3 V.
when i want to switch it on i need to set the pin value from pin 22 to 0.
Now  i can measure with my Oscilloskope the signals and i have on bouth sides of the LED a 3,3 V Signal.

This means the µC generates 3,3V to pin 22 instead of 0.

I tried to set the state of pin 22 to 0 but it didnt worked out. there are 3,3 V konstantly and i couldnt delete it.

I wrote a new source code to set pin value 22 to 0 and the Flashing the LPC with Flash magic but this also didnt worked, the 3,3 V are permanently on pin 22..

How can i set the value of pin 22 back to 0 ?
0 Kudos
Reply

6,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Mar 14 02:40:04 MST 2015

Quote: Kaveh.t
I want to create a GPIO Funktion in this Case i have to set bit 2:0  to the Value  01x for Selecting   PIO1_0  .



Yes, you should do that 

LPC_IOCON->R_PIO1_0 |= [color=#f00](0x1<<2)[/color]; // Set Port 1 Pin 0 as GPIO1_0


I'm not sure what function 4 of R_PIO1_0 is in detail? Is it Bluetooth  :quest:   

LPC_SYSCON->SYSAHBCLKCTRL   |= (1<<19);


Which unknown feature are you enabling here? WLAN  :quest:
0 Kudos
Reply

6,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Mar 14 01:52:20 MST 2015

Quote: Kaveh.t
I changed  LPC_SYSCON and enabled pin 19 for SYSAHBCLKCTRL because pin 6 was wrong.
Can you please explain me how i can get access to the SYSAHBCLKCTRL  to see if it is enabled ...) .




Quote: Kaveh.t
When I Debug...



Look in your Peripherals view  :O
0 Kudos
Reply

6,056 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Kaveh.t on Sat Mar 14 01:40:26 MST 2015
I changed  LPC_SYSCON and enabled pin 19 for SYSAHBCLKCTRL because pin 6 was wrong.

Can you please explain me how i can get access to the SYSAHBCLKCTRL  to see if it is enabled or can you please adjust my source code for the LED so that i can test it on my PCB to make it Blink, that would be very nice from you  :) .




09:32:53 **** Incremental Build of configuration Debug for project Blinky ****
make -r all
Building file: ../src/blinky.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -I"C:\nxp\workspace\CMSIS_CORE_LPC11xx\inc" -I"C:\nxp\workspace\Blinky\Common\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"src/blinky.d" -MT"src/blinky.o" -MT"src/blinky.d" -o "src/blinky.o" "../src/blinky.c"
Finished building: ../src/blinky.c

Building target: Blinky.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\nxp\workspace\CMSIS_CORE_LPC11xx\Debug" -Xlinker -Map="Blinky.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "Blinky_Debug.ld" -o "Blinky.axf"  ./src/blinky.o ./src/cr_startup_lpc11.o  ./Common/src/clkconfig.o ./Common/src/gpio.o ./Common/src/timer16.o   -lCMSIS_CORE_LPC11xx
Finished building target: Blinky.axf

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-objcopy -O ihex Blinky.axf Blinky.hex;


09:32:53 Build Finished (took 490ms)
0 Kudos
Reply

6,056 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Mar 13 03:59:38 MST 2015

Quote: Kaveh.t
When I Debug there are no Errors but the LED is not Blinking.



Look in your SYSAHBCLKCTRL: is IOCON enabled?
0 Kudos
Reply