LPC12227 programming

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC12227 programming

8,832 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Wed Jul 15 22:10:36 MST 2015
Hello,

I have a PCB with my first LPC project. On PCB I have a LPC1227 and connect over cabel to LPCLINK from LPCxpresso 1114.
I have a connect on a J4 connector, because I don't have small header for a J5.

When a programming in LPCxpresso, Program Flash -> Select file (myproject.axf)  and then click OK.

I get a program flash message:
Ni: LPCXpresso Debug Driver v7.8 (May 28 2015 02:56:34 - crt_emu_lpc11_13_nxp.exe build 181)
Pc: (  0) Reading remote configuration
Pc: (  5) Remote configuration complete
Pc: ( 30) Emulator Connected
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: Emu(0): Conn&Reset. CpuID: 410CC200. Info: HID64HS12
Nc: Debug protocol: SWD Frequency 250 KHz. RTCK: Disabled. Vector catch: Disabled.
Nc: loaded v.2 On-chip Flash Memory LPC11_12_13_128K_8K.cfx
Nc: image 'LPC11_12_13 (128K Flash, min 8K RAM) May 21 2015 09:32:41'
Nc: NXP: LPC1227/301  Part ID: 0x00000000
Pc: ( 65) Chip Setup Complete
Nt: Connected: was_reset=false. was_stopped=false
Cr:v LPCXpresso Free License - Download limit is 256K
Pc: ( 70) License Check Complete
Nt: Loading ELF file 'remote.axf' at location 00000000
Nt: Writing 996 bytes to address 0x00000000 in Flash
Pb: 1 of 1 (  0) Writing pages 0-0 at 0x00000000 with 996 bytes
Ps: (  0) at 00000000: 0 bytes - 0/996
Ps: (411) at 00000000: 4096 bytes - 4096/996
Nc: Progress meter completed at over 100% (4096/996 bytes)
Nt: Erased/Wrote page  0-0 with 996 bytes in 215msec
Pb: (100) Finished writing Flash successfully.
Nt: Flash Write Done
Nt: Loaded 0x3E4 bytes in 428ms (about 2kB/s)
Nt: Reset target
Nc: nSRST assert (if available)
Nc: Executing in user flash.
Wc: SWD Frequency (Final): 250 KHz. 


It is this message OK or not OK, because on my PCB with my schem nothhing.

I have on my LPC 3.3V normal connect all. But for LED blinking not working. I don't know why ?

Schem in the attachments
标签 (1)
0 项奖励
回复
21 回复数

8,368 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 22:15:55 MST 2015
Yes I double click on left side of number of line and set breakpoints then I get up Error.

But still I don't know where I have a error.
0 项奖励
回复

8,368 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jul 20 08:49:06 MST 2015
It looks like this is an internal Java error that is reported when running in a Pure IPv6 environment on Windows only.
https://bugs.openjdk.java.net/browse/JDK-8046500?page=com.atlassian.jira.plugin.system.issuetabpanel...

Does this sound like it applies to you?

How are you actually setting the breakpoint? You can just double-click on the margin in the left to set a breakpoint.
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 05:52:01 MST 2015
I get warnings Breakpoint installation failed: Unknown breakpint type.

I just click on my line number two time for add brekapoint. I have a brekapint type C/C++ type

An then clikc on Debug button (spider)

I get this:

An internal error occurred during: "Launching remote Debug".
IP Helper Library GetIpAddrTable function failed
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon Jul 20 05:49:03 MST 2015

Quote:
If I run debugger and set breakpoint I have a problem with breakpoint .I get error.



Give us a clue - what error?
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 05:37:53 MST 2015
i have a include file IO
This file working without problems for other PIN.
Just for 1.0 no.
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 05:36:13 MST 2015
void GPIOSetValue( uint32_t portNum, uint32_t bitPosi, uint32_t bitVal )
{
  if (bitVal == 0)
  {
  switch (portNum) {
case 0:
LPC_GPIO0->CLR = (1<<bitPosi);
break;
case 1:
LPC_GPIO1->CLR = (1<<bitPosi);
break;
case 2:
LPC_GPIO2 -> CLR = (1<<bitPosi);
default:
break;
}
  }
  else if (bitVal >= 1)
  {
  switch (portNum){
  case 0:
  LPC_GPIO0 -> SET = (1<<bitPosi);
  break;
  case 1:
  LPC_GPIO1 -> SET = (1<<bitPosi);
  break;
  case 2:
  LPC_GPIO2 -> SET = (1<<bitPosi);
  break;
  }
  }
}

void GPIOSetDir( uint32_t portNum, uint32_t bitPosi, uint32_t dir )
{
  if(dir)
  switch (portNum) {
case 0:
LPC_GPIO0-> DIR |= 1<<bitPosi;
break;
case 1:
LPC_GPIO1-> DIR |= 1<<bitPosi;
break;
case 2:
LPC_GPIO2 -> DIR |= 1<<bitPosi;
break;
default:
break;
}
  else
  switch (portNum) {
case 0:
LPC_GPIO0->DIR &= ~(1<<bitPosi);
break;
case 1:
LPC_GPIO1->DIR &= ~(1<<bitPosi);
break;
case 2:
LPC_GPIO2->DIR &= ~(1<<bitPosi);
break;
default:
break;
}
}
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 05:09:32 MST 2015
If I run debugger and set breakpoint I have a problem with breakpoint .I get error.

If run debugging without brekapoint I have not get error.
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jul 20 05:05:50 MST 2015

Quote: drvrh
I don't know where is the problem.



Then use the debugger to find it...
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 04:55:18 MST 2015
I don't know where is the problem.
No working. On pin I have a 1.84 V.
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jul 20 04:31:40 MST 2015

Quote: drvrh
LPC_IOCON -> R_PIO1_0 =  (1 << 1) | (1 << 4) | (1 << 7);

But No working.



Then debugging...
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 04:23:54 MST 2015
OK sorry, this code is noob code.

Now I will write more transparent:

LPC_IOCON -> R_PIO1_0 =  (1 << 1) | (1 << 4) | (1 << 7);

But No working.
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jul 20 04:20:03 MST 2015

Quote: drvrh
For first I would like
set FUNC PIO1.0
then set pull up
and then set digital mode.



LPC_IOCON->R_PIO1_0 = 0x01;


And setting R_PIO1_0 register to 0x01 is doing that  :quest:

Did you read the user manual?

Or is this a language or coding problem  :quest: 
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 04:14:27 MST 2015
For first I would like
set FUNC PIO1.0
then set pull up
and then set digital mode.

0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jul 20 03:40:37 MST 2015

Quote: drvrh

LPC_IOCON -> R_PIO1_0 =  0xb8;
LPC_IOCON->R_PIO1_0 = 0x01;



What are you trying to do here  :quest:

Read user manual Chapter 6.4.46 R_PIO1_0 register...
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 03:03:26 MST 2015
Yes, R_PIO1_0 is.

But no working if I set:


LPC_SYSCON->SYSAHBCLKCTRL |= 1 << 16;
LPC_SYSCON->SYSAHBCLKCTRL |= 1 << 31;

LPC_IOCON -> R_PIO1_0 =  0xb8;
LPC_IOCON->R_PIO1_0 = 0x01;

GPIOSetDir(1, 0, OUTPUT);
GPIOSetValue(1, 0, HIGH);
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jul 20 02:14:46 MST 2015

Quote: drvrh
This is my code I get error IOCON has no member, why and how then set.



:~

Because IOCON has no 'PIO1_0' member  :O

So look in your IOCON struct and find the correct member (name)...
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 20 01:31:32 MST 2015
I would like set PIN 1.0 but I cannot.

This is my code I get error IOCON has no member, why and how then set.


[u]LPC_IOCON -> PIO1_0 = (1 << 7);[/u]
GPIOSetDir(1, 0, OUTPUT);
GPIOSetValue(1, 0, HIGH);
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Sun Jul 19 23:38:54 MST 2015
Hello,
here is my solution:

Where I have a Led, pin 1.0, is reserved and with this program not working.

I change the program for 0.16 pin and then working all, here I have connect second LED.

I have a questions; how correct configure pin 1.0, 0.31 and 0.30 reserved pin? For input pin?

0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Sun Jul 19 22:39:23 MST 2015
Anyone's help?
0 项奖励
回复

8,393 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Thu Jul 16 00:35:56 MST 2015
If I click on debug, debugging normal without Error and Warning.

I can press on Play button, but notthing.

Here is my code:

#ifdef __USE_CMSIS
#include "LPC122x.h"
#endif

#include <cr_section_macros.h>
#include <NXP/crp.h>

// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
//__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;

volatile uint32_t msTicks=0;

// ****************
//  SysTick_Handler
void SysTick_Handler(void)
{
msTicks++;
}

int main(void)
{
/* Enable all three GPIO blocks and IOCON */
LPC_SYSCON->SYSAHBCLKCTRL |= 0xE001001FUL;
LPC_GPIO1->DIR = 1 << 0;
LPC_GPIO1->SET = 1 << 0;

/* Generate 1ms Ticks */
SysTick_Config(SystemCoreClock / 1000);

while (1)
{
switch (msTicks)
{
case 500:
msTicks = 0;
LPC_GPIO1->CLR = 1 << 0;
break;
case 100:
case 200:
case 300:
LPC_GPIO1->NOT = 1 << 0;
break;
}
__WFI();
}
}


I don't have a quartz on pcb, and I setting in system_LPC122x.c
SYSPLLCLKSEL and MAINCLKSEL
#define MAINCLKSEL_Val        0x00000000
#define SYSPLLCLKSEL_Val      0x00000000


for Internal oscilator

my LED connect on P1.0 pin with resistor before --- anode ---- cathode ---- gnd

if I measure voltage on my LED I have a 1.88V.

On CLKOUT pin I don't have nothing just 3,04 V.Measure with Osciloscope

Supply voltage is 3,12V is OK?

0 项奖励
回复