lpcware

[SOLVED] Labtool LPC812 PIO0_1 not usable as GPIO?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by larryvc on Sun Dec 14 21:56:31 MST 2014
This is a very similar problem as the one in the lpc812-pio01-gpio-problem thread and was discovered while helping to solve the problem there.

Concerning the Labtool's LPC812, I would like to know why there is always a clock signal on PIO0_1 even when the board is powered separately, running release software, and there are no debug connections at all.  According to the Labtool schematic PIO0_1 only goes to an internal header and nowhere else.  Isn't PIO0_1 supposed to be GPIO after a chip reset?

My program for testing in LPCOpen is:

(The second include is 'cr_section_macros.h' without the quotes between left and right carets. How do you enter something between left and right carets in the WYSIWYG editor and have it display?  Seems like a bit of a problem for posting C source code. Program source code is attached.)


/*
===============================================================================
Name        : GPIO0_1_Test.c
Author      : $(author)
Version     :
Copyright   : $(copyright)
Description : main definition
===============================================================================
*/

#include "chip.h"
#include <cr_section_macros.h>

const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;

enum PORTS {PORT0};

enum GPIO0PIO  // For the TSSOP20 and SOP20 packages
{PIO0_0,PIO0_1,PIO0_2,PIO0_3,PIO0_4,PIO0_5,PIO0_6,PIO0_7,
PIO0_8,PIO0_9,PIO0_10,PIO0_11,PIO0_12,PIO0_13,PIO0_14,PIO0_15,
PIO0_16,PIO0_17};

enum INOUT {IN, OUT};
enum LOWHIGH {LOW, HIGH};

int main(void) {

SystemCoreClockUpdate();

Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO);

Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, PORT0, PIO0_1);

Chip_GPIO_SetPinState(LPC_GPIO_PORT, PORT0, PIO0_1, LOW);

// GPIO0_1 should be low, but there is a clock signal there. Why?

    // Force the counter to be placed into memory
    volatile static int i = 0 ;
    // Enter an infinite loop, just incrementing a counter
    while(1) {
        i++ ;
    }
    return 0 ;
}

Original Attachment has been moved to: GPIO0_1_Test.c.zip

Outcomes