LPC1114 PIO1_0 function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1114 PIO1_0 function

4,178件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Wed May 25 04:21:14 MST 2011
Hi everybody,

I'm new to cortex M0 controllers and have some problems from the beginning.
I can't change the function of the PIO1_0 pin. My code is following:

    LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 6);
    LPC_IOCON->R_PIO1_0 = 0xC9;        // Function PIO1_0

    LPC_GPIO1->DIR |= (1 << 0);        // PIO1_0 output
    LPC_GPIO1->DATA |= (1 << 0);    // Set PIO1_0
    LPC_GPIO1->DATA &= ~(1 << 0);    // Clear PIO1_0

But when I debug this code, the function is still set to "TMS" and did not changed.
Are there some debugger setting should be set? Or what is wrong with this code?

Best regards
Alex
0 件の賞賛
返信
13 返答(返信)

4,118件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu May 26 00:02:43 MST 2011

Quote: Rob65

Furthermore there is no TMS pin according to the user manual.
Yes, I know the schematics of the LPCXpresso board show that the pin is also TMS but this function cannot be programmed using the iocon registers.

How could the LPCXpresso IDE tell us the pin is in TMS mode where this is not specified by NXP ???



It shows up as TMS in debug peripheral view in the IDE.:confused:

I'm a little late with this.:)

I confirmed that his code does not change to GPIO mode.  I do not know why yet.

It does work like Zero said earlier when just the few lines of code are entered into a new project.
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Thu May 26 00:01:24 MST 2011
So it looks in my IDE:
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Wed May 25 23:46:59 MST 2011
Sorry, I was wrong, the LPCXpresso LPC 1768 Board is disconnected from the LPC Link (which is on the same PCB) and instead of it my Testboard with LPC1114 is connected to LPC-Link now
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed May 25 23:40:04 MST 2011
Hm,

Freefly is asking about the lpc1114 PIO 1.0 pin and then tells us he is working with an lpc1768 :confused:

Furthermore there is no TMS pin according to the user manual.
Yes, I know the schematics of the LPCXpresso board show that the pin is also TMS but this function cannot be programmed using the iocon registers.

I'm currently traveling and have no access to an lpc1114/LPCXpresso environment but this surely is strange. How could the LPCXpresso IDE tell us the pin is in TMS mode where this is not specified by NXP ???

And how did freefly connect his 1114 board via SWD to the 1768 board?
Im either using my 1114 or 1768 connected to an LPC-Link but never two LPC boards connected together.

Rob
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 25 23:15:38 MST 2011

Quote: Zero

BTW: which LPCXpresso are you working with?



Maybe I'm wrong, but I think Zero might have been asking about which version of the LPCXpresso IDE you are using.
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Wed May 25 23:01:06 MST 2011
Here is the schematic of the testboard
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Wed May 25 22:51:23 MST 2011
It is connected via SWD to my Testboard :)
0 件の賞賛
返信

4,115件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed May 25 22:45:53 MST 2011

Quote: Freefly

P.S. I'm working with LPCXpresso LPC1768 REV A



?? You started this thread with a LPC1114
0 件の賞賛
返信

4,113件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Wed May 25 22:31:14 MST 2011
there it is :)

I tested it also with the new address define, but still the same problem :-(

P.S. I'm working with LPCXpresso LPC1768 REV A
0 件の賞賛
返信

4,113件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 25 13:08:10 MST 2011
To test the right register address you can also define an address:

#define D_RPIO1_0 (*(volatile unsigned int*)0x40044078)

 D_RPIO1_0 = 0xC9;
0 件の賞賛
返信

4,113件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 25 12:29:22 MST 2011
Sorry, can't believe that :eek:

This line is working without problems here :)

Can you zip and post your project?

BTW: which LPCXpresso are you working with?
0 件の賞賛
返信

4,113件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Freefly on Wed May 25 12:24:31 MST 2011
Yes, I set one before the LPC_IOCON->R_PIO1_0 = 0xC9  instruction and then just did step debugging.
0 件の賞賛
返信

4,113件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 25 04:58:25 MST 2011
Your setting is valid  :), so changing to PIO1_0 should work.

Did you set a breakpoint before and behind?
0 件の賞賛
返信