Content originally posted in LPCWare by Vit_Ciola on Wed Nov 23 09:10:20 MST 2011
Quote: Zero
No. it's not. But I would strongly suggest to include it, if you are drawing your own board. A small SMD crystal and 2 caps are not very space consuming.
And if you don't need it today, just don't solder it in. Perhaps you are happy some day that there's a place for them left on your board...
[SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]
[/COLOR][/SIZE][/COLOR][/SIZE]
Quote: Rob65
No, you do not need an external crystal - that's the nice thing on these chips: you can use either internal RC oscillator or external resonator/crystal. Just make sure that your software environment does not try to use the main (crystal) oscillator.
Ok. In my board I didnt put the cristal (schematic is attached), so it should work the SWD debug.
But it's not.
Im using the LPCXpresso v 4.0.5, when I try to debug the software apparently is downloaded to the micro, with the following messages in the console:
[SIZE=2][COLOR=red] [/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=red]set remotetimeout 60000[/COLOR][/SIZE][/LEFT]
[COLOR=#ff0000][COLOR=#ff0000][LEFT][SIZE=2]mon ondisconnect cont[/SIZE][/LEFT]
[SIZE=2]set arm force-mode thumb[/SIZE]
[/COLOR][/COLOR]
But when I analyze the signals in the port, they are not the same as in the LPCXpresso 1114 target.
PS: I physically cut the communication between the LPC-Link and Target.
Quote: Zero
Just read UM10398 Chapter 7: LPC111x/LPC11Cxx I/O configuration (IOCONFIG)
Default pin function isn't always GPIO, so don't forget to set I/O configuration registers :eek:
Quote: Rob65
Not giving us enough info to answer?
I can't find any function named GPIOSetDir in my CMSIS project and on my chip I/O pins are either input or output, not IO.
Please explain what you are trying to do.
I read the chapter 7, and I understood that I have to change the register IOCONFIG, but I couldnt found this register in the software...
What I did was to use the function GPIOSetDir ( which I took from the gpio.c file, blink example). To select some ports as Input and others as Output.
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [B]GPIOSetDir[/B]( [/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint32_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] portNum, [/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint32_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] bitPosi, [/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint32_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dir )
{
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](dir)
[U]LPC_GPIO[/U][portNum]->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]DIR[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= 1<<bitPosi;
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/LEFT]
[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]LPC_GPIO[portNum]->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]DIR[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= ~(1<<bitPosi);
}[/LEFT]
[/SIZE][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][B]#endif[/B]
[SIZE=3][COLOR=black]This is not part of the IOCONFIG register right?[/COLOR][/SIZE]
[/COLOR][/SIZE][/COLOR][/SIZE]