IO Problems on LPC 1343

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

IO Problems on LPC 1343

424 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ub3r on Thu Jun 28 09:55:39 MST 2012
Hi guys,
After three hours of puling my hari and searching for answers, im giving up and asking the question.

Why cant i get, R_PIO1_0, R_PIO1_1, R_PIO1_2 working as a general purpose output?? :confused:

All the other pins i need work except for these pins with the R_.

:confused:

cheers
Tony
0 Kudos
8 Replies

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jookie on Mon Jul 09 00:44:36 MST 2012
The rest of the code was not related to IOCON, so I blurred it out. But you totally nailed it with the LPC_SYSCON->SYSAHBCLKCTRL! I don't know how I missed that thread within the other ones related to IOCON. Thank you Zero! :)
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Jul 08 23:29:06 MST 2012
Unfortunately your picture is blurry :eek: and doesn't show if you switch on IOCON clock :confused:

LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16);//enable IOCON clock
as described already here: http://knowledgebase.nxp.com/showthread.php?t=3248
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jookie on Sun Jul 08 18:39:35 MST 2012
Hello,

I have a similar problem - can't use PIO0_11, PIO1_0, PIO1_1, PIO1_2 because they're in the JTAG mode, but trying to change IOCON values doesn't work. I see the values in debugger as zeros before the write, also after the write of values and I can't change them manualy in the memory view too. This is how it looks in my debugger after running the write to IOCON registers:

https://dl.dropbox.com/u/50798228/debuger.png

I'm not sure if there's just something with my code (I tried to do this in several ways found here in forum), or I got a faulty chip, or I just need to disable the JTAG somehow, or what... Or should I just avoid using these pins?

Miro
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Fri Jun 29 03:01:15 MST 2012
[SIZE=1]uh, I am a genius too[/SIZE] :D
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ub3r on Thu Jun 28 20:19:16 MST 2012
 LPC_IOCON->JTAG_TMS_PIO1_0   = (1<<7)|(1<<6)|(2<<3)|(1<<0);
 LPC_IOCON->JTAG_TDO_PIO1_1   = (1<<7)|(1<<6)|(2<<3)|(1<<0);
 LPC_IOCON->JTAG_nTRST_PIO1_2 = (1<<7)|(1<<6)|(2<<3)|(1<<0);


Zero your a genius.
Whats your address.. i want to send you a case of beer.
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by creafyumi on Thu Jun 28 18:25:20 MST 2012

Quote: ub3r
Hi guys,
After three hours of puling my hari and searching for answers, im giving up and asking the question.

Why cant i get, R_PIO1_0, R_PIO1_1, R_PIO1_2 working as a general purpose output?? :confused:

All the other pins i need work except for these pins with the R_.

:confused:

cheers
Tony



Have you enabled timer32 1 or ADC in your code? Or you are using JTAG?

Three Possible Reasons:
timer32
ADC
JTAG
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jun 28 13:34:09 MST 2012

Quote: atomicdog
I believe the pins with R_ are pins connected to the debug lines swd/jtag...



:confused: I don't believe that

R/PIO1_0/AD1/CT32B1_CAP0
33[5] yes - I; PU R — Reserved. Configure for an alternate function in the IOCONFIG block.
I/O - PIO1_0 — General purpose digital input/output pin.
I - AD1 — A/D converter, input 1.
I - CT32B1_CAP0 — Capture input 0 for 32-bit timer 1.

R/PIO1_1/AD2/CT32B1_MAT0
34[5] yes - I; PU R — Reserved. Configure for an alternate function in the IOCONFIG block.
I/O - PIO1_1 — General purpose digital input/output pin.
I - AD2 — A/D converter, input 2.
O - CT32B1_MAT0 — Match output 0 for 32-bit timer 1.

R/PIO1_2/AD3/CT32B1_MAT1
35[5] yes - I; PU R — Reserved. Configure for an alternate function in the IOCONFIG block.
I/O - PIO1_2 — General purpose digital input/output pin.
I - AD3 — A/D converter, input 3.
O - CT32B1_MAT1 — Match output 1 for 32-bit timer 1.

So just set them up as outputs :eek:
int main(void)
{
 volatile static int i = 0 , status =0;
 LPC_GPIO0->DIR |= (1<<7);            //LED
 //setup function1, pullup, digital
 LPC_IOCON->JTAG_TMS_PIO1_0   = (1<<7)|(1<<6)|(2<<3)|(1<<0);
 LPC_IOCON->JTAG_TDO_PIO1_1   = (1<<7)|(1<<6)|(2<<3)|(1<<0);
 LPC_IOCON->JTAG_nTRST_PIO1_2 = (1<<7)|(1<<6)|(2<<3)|(1<<0);
 LPC_GPIO1->DIR |= (1<<2)|(1<<1)|(1<<0);    //set output
 while(1)
 {
  i++;
  if(i>1E6)                            //long delay
  {
   i =0;
   LPC_GPIO0->DATA ^=(1<<7);        //just toggle LED
   if(status)
   {
    status =0;
    LPC_GPIO1->DATA |= (1<<2)|(1<<1)|(1<<0); //all on
   }
   else
   {
    LPC_GPIO1->DATA &=~((1<<2)|(1<<1)|(1<<0)); //all off
    status=1;
   }
  }
 }
 return 0 ;
}
0 Kudos

351 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Thu Jun 28 12:38:29 MST 2012
I believe the pins with R_ are pins connected to the debug lines swd/jtag and are configured different then the other pins.
What have you tried?
0 Kudos