[SOLVED] LPC812 - PIO0_1 gpio problem

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

[SOLVED] LPC812 - PIO0_1 gpio problem

925 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wojtkingson on Sat Dec 13 11:36:52 MST 2014
Hi guys,

I would like to ask you,, if there is some issue with pin PIO0_1 on LPC812. I've tried to use this pin as output, but this pin is all the time in the same voltage level in 1,6V. I have chip version with ISP on pin PIO0_12.

I use LPCopen.

1) Disable fixed pin function

  
 Chip_SWM_Init();
    Chip_SWM_DisableFixedPin(SWM_FIXED_ACMP_I2);   // I've tried to disable only one fixed function without any results
    Chip_SWM_DisableFixedPin(SWM_FIXED_CLKIN);
    Chip_SWM_Deinit();


2) Init GPIO

 
  Chip_GPIO_Init(LPC_GPIO_PORT);


3) Set direction

  
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, 1);


4) Set state

   
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, 1, 1);


Any ideas?
Thanks
Labels (1)
0 Kudos
5 Replies

602 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wojtkingson on Tue Dec 16 17:34:56 MST 2014
Thanks :) Sorry, I'm little bit out of mind at this time..
0 Kudos

602 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Tue Dec 16 17:08:04 MST 2014
havlicek.vojtech, see the solution to this problem in my other thread.

Also the value you used here does not do what you said - PINENABLE = 0x1E3 (XTALIN, XTALOUT, RESET enabled).

PINENABLE = 0x1E3
disables VDDCMP, CLKIN, RESET, XTALOUT,  ACMP_I2, ACMP_I1
enables XTALIN, SWDIO, SWCLK
0 Kudos

602 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sun Dec 14 21:42:32 MST 2014

Quote: havlicek.vojtech
Thats only piece of test code, where I tested PIO0_1 functionality. I would like to know how I should work with this pin, because I need debug...



I do not think that is possible. Read UM10601 rev 1.6 --  2 April 2014 chapter 26: LPC81x Debugging as it seems to explain what is occurring in section 26.4 a portion of which I have provided here:
The SWD functions are assigned to pins through the switch matrix. The SWD functions
are fixed-pin functions that are enabled through the switch matrix and can only be
assigned to special pins on the package. The SWD functions are enabled by default.


It would be nice to get NXP_Support or Embedded Artists to clarify this to make it a bit more clear.   :quest:   Is GPIO0_1 after a chip reset a GPIO pin or not?

0 Kudos

602 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wojtkingson on Sun Dec 14 05:31:16 MST 2014
I have LPCXpresso LPC812 Rev B.

I tried to look at PINEANNABLE0 in swm and there was by default value 0x182, which is binary 110000010 (disabled ACMP_I2, CLKIN, VDDCMP).

I've tried lot of configuration and I found out, that when you disable SWDIO and SWCLK and board runs in normal mode (without debug), the pin works fine, but in debug mode there is 1,6V. I used PINENABLE = 0x1E3 (XTALIN, XTALOUT, RESET enabled).

        Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);

LPC_SWM->PINENABLE0 = 0x1E3;

Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);


        Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO);

LPC_IOCON->PIO0[IOCON_PIO1] = 0x98;

Chip_SYSCTL_PeriphReset(RESET_GPIO);


Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, 1);
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, 1, true);




Thats only piece of test code, where I tested PIO0_1 functionality. I would like to know how I should work with this pin, because I need debug...
0 Kudos

602 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sat Dec 13 13:58:17 MST 2014
You should not have to do anything regarding the SWM as GPIO function PIO0_1 is the default.  What board are you using for testing the LPC812?

I have verified the same results while using the LPC812 on the Labtool.  For testing I commented out all of the SWM code.  I was able to confirm that the code works fine on PIO0_4 but not on PIO0_1.  PIO0_1 terminates at J15 pin 1 on the Labtool with no other connections noted.

I am a bit stumped here as well.  Sorry I couldn't be of more help.

Let's see if anyone else has any ideas.
0 Kudos