lpcware

lpc1311 trouble

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ursus_inL on Wed Jan 22 03:07:27 MST 2014
Hi!
I decided try out lpc1311 as i find it prefect for undemanding projects because of size/cost. This is my first time dealing with cortex processors (previously i used arm7 procs like LPC2148 and atmegas).
i've designed a simple board (sch attached: lpc1311_sch_ursus.pdf).
I can successfully flash the device using flashmagic (write hex, read flash data...),[u] but gpio pins are always at 2.2V[/u] (as if they where inputs).

Here is the example of the code i tryed:

#include "LPC13xx.h"

int main(void) {

     LPC_SYSCON->SYSAHBCLKCTRL  |= (1<<6);    //GPIO clk en
     LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16);              //IOCON clk en
     LPC_SYSCON->SYSAHBCLKCTRL   |= 0x7ffff;        //en all clk


     LPC_IOCON->PIO0_7            = 0xD;            //pin function : 0011010000=> 0x0D0
     LPC_GPIO0->DIR              |= (1<<7);                     //pin direction

     LPC_GPIO0->DATA           &= ~(1<<7);                   //set pin low

  /*   while(1){                      // loop - commented out for now...

          LPC_GPIO0->DATA           |= (1<<7);    //set pin high
          for(i=0; i<0x10000; ++i);            
          LPC_GPIO0->DATA           &= ~(1<<7);   //set pin low
          for(i=0; i<0x10000; ++i);             

     } //end while
*/
} //end main



Did i miss something when designing HW or is it a software problem? It looks to me as if the processor does not reach the main function code.

Thank you for your help

Attachments

Outcomes