lpc1114fn28 breakout - ytsuboi's wiki

























lpc1114fn28 breakout

http://www.ytsuboi.org/dokuwiki/lpc1114fn28_breakout?rev=1348830807&vecdo=cite 


Contributors of www.ytsuboi.org, "lpc1114fn28_breakout", ytsuboi's wiki, 

http://www.ytsuboi.org/dokuwiki/doku.php?id=lpc1114fn28_breakout&rev=1348830807

 (Accessed July 15, 2013).

.END

LED blink example by vilaca

Programming the LPC1114FN28 - Created 19 Dec 2012, last modified: 14 May 2013

http://vilaca.eu/lpc1114/

http://vilaca.eu/lpc1114/vilaca.eu.lpc1114_102_led_blink.zip

#include <LPC11xx.h> /* LPC11xx Peripheral Registers */
#include "system_LPC11xx.h"

#define LED       (1<<9)      /* LED D1 connect to PIO1_9 */

int main(void)
{
LPC_SYSCON ->SYSAHBCLKCTRL |= (1 << 8); // Enable Clock for TMR1
LPC_IOCON ->PIO1_9 |= (1 << 0); // PIN1_9 = CT16B1_MAT0
LPC_TMR16B1 ->MR0 = 2000; // 50% Duty Cycle
LPC_TMR16B1 ->PR = 12000;
LPC_TMR16B1 ->MR3 = 4000; // Cycle Length
LPC_TMR16B1 ->MCR |= (1 << 10); // TC Reset on MR3 Match
LPC_TMR16B1 ->PWMC |= (1 << 0); // PWM Mode
LPC_TMR16B1 ->TCR |= (1 << 0); // GO
while (1);

// unreachable
return 0;
}

Programming the LPC1114FN28 - Created 19 Dec 2012, last modified: 14 May 2013

http://vilaca.eu/lpc1114/

The LPC1114FN28 is a breadboard friendly MCU that most hobbyists will like and a great chip to get started in ARM embedded development.

It is sold in a DIP package and has a Bootloader installed, so programing it is very easy, requiring virtually zero supporting components.

Unlike most 32 bit MCUs this one can be easily placed in a breadboard, PCB or Perfboard without having to use any special tools or equipment.

Overall features: 32 bits, 50MHz, ARM Cortex M0 family, DIP package, Built-in serial Bootloader, 1.8-3.6v, up to 50 MHz, 8KB SRAM, SPI, I2C, USART, 10 bit ADC, 16 & 32 bit timers, ISP, Internal Oscillator and many more.

Plugging it in for programming

You don't need a fancy development kit to test your code: a simple breadboard and a USB to TTL adapter will be enough as only 5 pins are necessary for this task

Pins 21 and 22 should be connected to your power source, usually a voltage regulator, possibly a LM117, or your USB to TTL adapter 3.3V pin.

Pins 16 and 17 should be connected to your UART pins TX and RX respectively; RX on the MCU should be connected to TX on the UART and TX to RX.

Pin 24 should be connected to GND. When the MCU boots, this pin is tested and, if it is connected to GND, the program in flash memory will run. Connecting it to GND [Vdd?] makes the chip run the boot-loader, allowing a program to be written to the MCU internal Flash memory.

Example program

Download and unzip the file vilaca.eu.lpc1114_102_led_blink.

This file is an example program that can be uploaded to the LPC1114 using the previous circuit.

It is a very simple program that uses PWM to blink a led on pin 18 every second. The led stays ON for exactly 1/2 second.

Once you upload it to the LPC1114 you can switch to the circuit bellow to run the program.

You can also download the full Keil project for this example.

http://vilaca.eu/lpc1114/vilaca.eu.lpc1114_102_led_blink.zip

Uploading the program with Flash magic

Flash magic is a free and easy to use tool that can upload program files to a large variety of microcontrollers.

Make sure you select the correct COM port where the USB to TTL UART is connected in your computer. In the screenshot above COM 5 is selected.

Flash Magic can only handle files in the .hex format and can be downloaded from: http://www.flashmagictool.com/

If you're using Linux there's a very good article on how to program this MCU using open tools at http://www.meatandnetworking.com.

Simple circuit for blinking led
The following is a simple circuit to make a led blink.

Since the MCU already has an internal oscillator very few parts are needed

Pins 18 is connected to a generic Led and resistor. I used a 330 Ω resistor for this setup.

Pins 22 and 23 should be connected to your power source.

This setup is enough to run a program blinking the LED and you can adapt it to your needs.

In this example pin 18 was selected because it is one of the timer output pins. In the sample program we set timer to do PWM with a cycle length of around 1HZ, that is one blink per second.

LPC1114 Pin reference

PIN GPIO AD Timers SPI I2C UART Other

1 PIO0_8 CT16B0_MAT0 MISO0
2 PIO0_9 CT16B0_MAT1 MOSI0
3 PIO0_10 CT16B0_MAT2 SCK0 SWCLK
4 PIO0_11 AD0 CT32B0_MAT3
5 PIO0_5 SDA
6 PIO0_6
7 VDDA
8 VSSA
9 PIO1_0 AD1 CT32B1_CAP0
10 PIO1_1 AD2 CT32B1_MAT0
11 PIO1_2 AD3 CT32B1_MAT1
12 PIO1_3 AD4 CT32B1_MAT2 SWDIO
13 PIO1_4 AD5 CT32B1_MAT3 WAKEUP
14 PIO1_5 CT32B0_CAP0 RTS
15 PIO1_6 CT32B0_MAT0 RXD
16 PIO1_7 CT32B0_MAT1 TXD
17 PIO1_8 CT16B1_CAP0
18 PIO1_9 CT16B1_MAT0
19 XTALOUT
20 XTALIN
21 VDD
22 VSS
23 PIO0_0 RESET
24 PIO0_1 CT32B0_MAT2 CLKOUT
25 PIO0_2 CT16B0_CAP0 SSEL0
26 PIO0_3
27 PIO0_4 SCL
28 PIO0_7 CTS

LPC1114 Pinout Diagram

Useful downloads

If you haven't already, you can go to the NXP website and download a free version of the Keil environment and start coding: http://www.keil.com/dd/chip/6526.htm

To upload your finished program to the MCU you can use: 

http://www.flashmagictool.com/

External links

NXP product page for LPC1114FN28/102 

http://www.nxp.com/products/microcontrollers/cortex_m0/lpc1100_x_l/LPC1114FN28.html

IPS (Polytechnic Institute of Setúbal, Portugal) is a public institution of higher education, which employs approximately 650 personnel and has app. 6 500 students.

.END

FlashMagic Failed to Autobaud problem

Topic: Failed To Autobaud  (Read 49020 times) Andy Ayre ESAcademy Staff Sr. Member Posts: 1826
 
http://forum.flashmagictool.com/index.php?topic=3628.0

Failed To Autobaud  « on: July 07, 2009, 09:55:29 PM »

If you are reading this you probably received an error message from Flash Magic telling you that autobauding failed. This is by far the most common problem that people run into and this post will provide some pointers.

Read this post entirely before posting a new topic or contacting us for help.

Because hardware and microcontrollers vary I will first give you the bad news - there is no magic one-size-fits-all answer to your problem. The solution depends on your situation and you will have to do a bit of investigating and understand what is happening. This is always the case when hardware is involved.

For People in India

We have a lot of people in India who have difficultly with autobauding. From trying to solve this problem with several people we have come to the conclusion that there are small shops selling microcontrollers that are not brand new and might have an unknown past. Only puchase brand new microcontrollers from authorized NXP distributors, otherwise you might be wasting a lot of your time.

Overview of Autobauding

What is autobauding? When the ISP bootloader in the microcontroller is started it waits for a special character (called the autobaud character) to be received on UART0. The character used varies depending on the device. Generally 8051 and XA devices use a 'U' while ARM devices use a '?'.

When the character is received the bootloader uses it to measure the baudrate you are using in Flash Magic. It then configures UART0 to use the same baudrate. Finally it sends a response back to Flash Magic.

In 99.9% of cases the error you are getting is caused by Flash Magic not receiving a response from the microcontroller. What could cause this? Some possible reasons are:

Using wrong COM port

Serial cable is faulty or not connected to PC and RS232 transceiver on your hardware

You are using a USB to RS232 cable which doesn't work properly

A USB driver is causing problems

There is a bad solder joint on your hardware stopping the autobaud character from arriving at UART0 RXD

The ISP bootloader failed to start

The microcontroller cannot execute code because of no running oscillator, insufficient power supply, glitches on the power supply, etc.

The baud rate you are using is too high or too low

You are using a P89V51Rx2 or P89LV51Rx2 and the autobaud character is not being sent in time

Let's examine each of these in turn and how you can check them. They are in no particular order.

Using wrong COM port

Make sure you are using the correct COM port. If you are using a USB to RS232 cable or Future Designs USB interface then unplug the cable, go to Control Panel -> System -> Hardware-> Device Manager  -> Ports (COM & LPT) and see which COM ports are available. Then plug your cable back in and see which new one appears.

Serial cable is faulty or not connected to PC and RS232 transceiver on your hardware

Put an oscilloscope on the RIN pin of the RS232 transceiver. Click on Start in Flash Magic and watch for the autobaud character. If it doesn't appear then try a different PC and serial cable. Try putting the oscilloscope on the COM port connector on your PC and checking there.

Check for an electrical connection between the ground, TXD and RXD pins of the cable at each end. Note that a problem with the ground can stop communications from working (Thanks Jan for this one).

If you don't have an oscilloscope then get one. They are required for developing with embedded systems and are necessary to see what is happening in the circuit. Without one you will run into constant problems and frustration that will waste days of your life.

You are using a USB to RS232 cable which doesn't work properly

We have had a LOT of reports of problems with these cables. Some work well and some don't. There is no list of what does and doesn't work. This would be one one of the things we would suspect. Obtain a PC with a COM port. It is also possible to buy PCI cards with COM ports for desktop PCs.

A USB driver is causing problems

If you are using a USB to RS232 cable or Future Designs USB interface and you have tried the above, then try the following steps:

Go to Control Panel -> System -> Hardware Tab -> Device Manager

Expand Ports (COM & LPT) in the list

Right click over the COM port assigned to your USB cable

Choose "Uninstall" from the menu

Unplug the cable and plug it back in

Go through the driver installation steps

If that doesn't help then try:

Go to Control Panel -> System -> Hardware Tab -> Device Manager

Expand Ports (COM & LPT) in the list

Right click over the COM port assigned to your USB cable

Choose "Properties" from the menu

Click on the Port Settings tab then Advanced...

Choose a new COM port number, for example COM17. Don't pick one that it says is in use, even if it really isn't in use.

Click on OK then OK.

Unplug your USB cable and plug it back in.

Make sure the cable is assigned the new COM port number

There is a bad solder joint on your hardware stopping the autobaud character from arriving at UART0 RXD

Put an oscilloscope on the RXD pin of the microcontroller. If the pin is not accessible put the scope on the RXD signal as close as possible to the pin. Click on Start in Flash Magic and watch for the autobaud character. If it doesn't appear then start checking at various points in the circuit working your way from the microcontroller to the RS232 transceiver.

The ISP bootloader failed to start

This is a common cause. The user manual for your device will describe all the conditions necessary to start the bootloader. You must check and make sure all of them are being met. Measure voltages and timing at the pins of the microcontroller.

The microcontroller cannot execute code because of no running oscillator, insufficient power supply, glitches on the power supply, etc.

Check all electrical aspects with an oscilloscope and make sure your circuit meets the AC and DC specifications in the data sheet for the microcontroller.

The baud rate you are using is too high or too low

The baud rates that can be used to communicate with the bootloader vary depending on the frequency of the oscillator being used. It is recommended to use at least 10MHz and 9600 baud. Try different baud rates. However the bootloader will only attempt to autobaud once after a reset so be sure to reset it between attempts.

You are using a P89V51Rx2 or P89LV51Rx2 and the autobaud character is not being sent in time

These devices are different in how the bootloader is activated and it is important to understand these differences. They are not like other devices with similar names. Do not make assumptions about any particular device and how it works based only on the part number. Read the data sheet and user manual.

These devices must receive the autobaud character within a specific time after reset to enable the bootloader. Flash Magic can reset the device for you (with support in the hardware) or you must do it manually. This setting can be found in Options -> Advanced Options -> Hardware Config. Uncheck/untick the "Use DTR to control RST" for manual resets. When clicking on the Start button a window will open telling you to reset the device. While the window is open Flash Magic is sending out a constant stream of autobaud characters. This is when you reset the device.

Before attempting to use the DTR option get it working without DTR. This simplifies the situation and reduces the potential for problems.

If you still cannot get one of these devices to communicate with Flash Magic then use an oscilloscope to check that a constant stream of 'U's are arriving at the RXD pin of the microcontroller. This will look like a square wave. Then check if anything is being output on the TXD pin.

Additional Notes

Get the User Manual for your device from http://www.nxp.com/microcontrollers

Try communicating with the device using Hyperterminal. Use 8 bits, no parity, 1 stop bit, no flow control. Send the autobaud character and see if anything is echoed back. If it isn't then the problem is likely not with Flash Magic.

If communications work with Hyperterminal but not with Flash Magic then a possible cause is in how DTR and RTS are used. For example the Keil MCB900 board requires proper control of DTR to enable the outputs of the RS232 transceiver. Other boards may do something similar. Check the schematic diagram for your board and understand the requirements. Contact the vendor of the board if needed. In Flash Magic under Options -> Advanced Options -> Hardware Config try checking/ticking and unchecking/unticking the "Assert DTR and RTS while COM port open" option to see if that helps.

Some users have reported having PCs where DTR and RTS are inverted for some reason. It is always worth trying another PC of a different make or model to see if the problem appears there.

A good way of getting to a "known state" is to buy a tried and tested board from places like www.lpctools.com. These boards are low cost and if you buy a Keil board then typically the schematic diagrams are available on www.keil.com. Contact Keil for details on the diagrams. We typically use Keil boards in-house for developing and testing Flash Magic. If you contact us with a problem the first thing we will usually do is grab the appropriate Keil board and test with it.

Ultimately the best person in a position to track down and solve the problem is you. You have the PC, microcontroller, cables and hardware in front of you.

If you have gone through and checked everything in this posting and still feel you need help then we need a detailed email or posting on this forum with everything you know and understand about the problem. It is difficult for us to diagnose problems remotely and without detailed information your request for help will likely only result in us asking questions.
« Last Edit: April 30, 2010, 03:10:44 PM by Andy Ayre »

Logged

Embedded Systems Academy, Inc.

support at esacademy dot com

Andy Ayre


Posts: 1826
 
Re: Failed To Autobaud

« Reply #1 on: May 12, 2010, 05:02:06 PM »

These are from Steve H (thanks Steve!):

Loopback check serial cable

Jumper pins 2 and 3 together then run Hyperterminal and see if you get an echo. If so, most likely your serial port and cabling are working fine.

Verify if you need a null modem or straight through cable

Some boards will require a null modem, while others need a straight though. It should be stated in the documentation. You sort of allude to this in the "additional notes" section, but you don't come right out and say it.

.END

Somy USB serial cable driver installation record




















Somy USB serial cable driver installation record.

.END

J-LINK and USB to serial driver installation notes





































Earlier when I setup the jlink, I found that I need to do the following to run the Somy demo program.

1. Power up Somy board first.

2. Then power up J-LINK

Since the Somy board is running, so I thought jlink is plug and play and so there is no need to install any driver.  But just now I checked Windows installation manager and found that jlink is not installed successfully.  I read the Keil manual which advises to install the driver under Keil's directory listed below.

c:/Keil/ARM/Seggar/USBdriver/x86

I found there is another driver x64.  I forgot what is x64, but I think x86 is for Intel.  Perhaps x64 is for AMD.

So I checked that J-LINK is successfully installed.  Now I have more confidence to download a program.

.END

FlashMagic learning notes

























FlashMagic learning notes

.END








USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi - Adafruit

USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi 

http://www.adafruit.com/products/954

The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB<->Serial conversion chip and at the end of the 36" cable are four wire - red power, black ground, white RX into USB port, and green TX out of the USB port. The power pin provides the 5V @ 500mA direct from the USB port and the RX/TX pins are 3.3V level for interfacing with the most common 3.3V logic level chipsets.

Because of the separated pin plugs, this cable is ideal for powering and connecting up to the debug/login console on the Raspberry Pi or BeagleBone Black. Connect the pins as shown to power the Pi or BBB and establish the RX/TX link. Then install the Windows XP/Vista/7 or MacOS X PL2303HX.A drivers on your computer and connect with a terminal program at 115200 baud. Windows 8 is not supported.

Also handy for hacking WiFi routers to install alternate OS's, or nearly any other TTL port. This is easier to use than an FTDI cable in many cases because the wires are separated

This cable is not good for Arduino re-programming such as a Boarduino, MENTA, Monochron, etc. because it does not have the DTR/RTS wire necessary for initiating the bootloader reboot sequence. For that we suggest an FTDI cable or FTDI friend.


Downloads

Windows XP/Vista/7/8 or MacOS X PL2303HX.D drivers

PL2303HX.D datasheet

.END



USB FTDI TTL-232 cable - TTL-232R 3.3V

http://www.adafruit.com/products/70

This is a FTDI FT232RL usb/serial chip embedded in a cable that has a 6-pin socket at the end. These are perfect for use with a Boarduino, Meggy's, or other Arduino clones, and Fuzeboxen. Useful whenever you want to communicate with a TTL serial device, such as an XPort, GPS, XBee or SIM module through a breakout board.

The version we have is the 3.3V. The data signals are at 3V and the power line provides 5V. We suggest this for any product that needs FTDI cables. Because the cable is 5V compliant, you can use it with 3v or 5v logic just fine - no level shifting required!.

If you have a device that is running at 5V logic and requires 5V power, this cable will work fine.
If you want to tweak the voltages and signals a little, you should also check out the FTDI friend

You can download the drivers and datasheet direct from FTDI




How to Find Hidden COM Ports There, under a rock! Its a gaggle of COM ports!

http://www.adafruit.com/products/70#Learn

This mini tutorial will show you how you can find and uninstall all those extra COM ports you may have registered from years of microcontroller-hacking.

You may have noticed that every time a new FTDI-based board is plugged in, you get a new COM port. You might also get new COM port assignment with adapters, etc. Eventually you can get into pretty high COM port numbers and that can be really annoying! For example, on my 6-month old Windows 7 install I'm already up to COM38!

At some point you may want to figure out what were all those other COM ports and perhaps uninstall the "ghost" devices. Under windows this isn't particularly easy unless you know how. Luckily, this tutorial will show you how and its really easy once you know!

First up, you'll have to open up a Command Prompt and in Windows 7 it has to be run as administrator. Open up the start menu and start typing in "Command" until the black C:\ icon appears. Right click and select Run as Administrator If you have some other version of Windows, you may not have to run as admin.

Now type in set devmgr_show_nonpresent_devices=1 (which is the magic command to show ghost devices) followed by start devmgmt.msc (which starts up the device manager)

Now you're almost done, select Show hidden devices from the View menu

Voila! You can now see every COM port you've ever made, and you can also now select which ones you want to uninstall so the COM port number can be recycled


USB to Serial Cable

http://item.taobao.com/item.htm?spm=a230r.1.0.201.lNNxlZ&id=10346178579

简介

USB to Serial是一款小型的USB转TTL电平信号的转接板。集成了CP2103芯片,有用体积小,低价好用等特点。可直接插入USB host接口使用。

这款USB to TTL转换板的接口兼容APC220无线数传、蓝牙无线数传模块,也可以用于STC单片机程序下载或者其他USB转TTL的串口通讯场合。

技术规格

USB端口供电:5v

硬件接口:支持USB 2.0接口,最高速度12Mbps

UART接口支持5-8bit数据位,1-2停止位,奇偶校验位和无校验

集成EEPROM,提供Vendor ID,product ID,串口号以及版本号

板载LED状态指示灯

支持Windows, MAC(OSX-9以上版本) and Linux(2.4 kernel以上版本)操作系统

兼容Bluetooth V3和APC220直插通讯接口

支持对STC单片机程序下载

尺寸:38x18mm

配送清单

USB to Serial 1块

相关下载:

驱动程序

CP2103芯片数据手册

CP2103芯片驱动(Windows)


USB转串口线(九针)USB TO RS232转换器 9针串口转换线

http://item.taobao.com/item.htm?spm=a230r.1.0.221.lNNxlZ&id=15337481663

通用串行总线RS 232串行电缆,让你连接串口设备到您的电脑笔记本电脑或台式计算机通过通用串行总线端口,好像电脑提供了一个机载db9m连接器。它可能是一个成本效益的解决方案,桥梁之间的差距的兼容性现代计算机和传统串行外围。

规格:

简单的安装和操作提供了强大的串行连接到传统个人电脑

拔电源总线的省麻烦携带的外部电源适配器,该附加串口

广泛名单兼容操作系统使该装置适合几乎任何RS 232应用

通用串行总线RS 232串口适配器直通

易于安装和安装

Description:

The USB to RS232 Serial Cable lets you connect RS232 serial devices to your PC laptop or desktop computer through a USB port, as though the computer offered an onboard DB9M connector. It may be a cost-effective solution that bridges the compatibility gap between modern computers and legacy serial peripherals.

Specifications:

Simple installation and operation provides robust serial connectivity to legacy PCs

Drawing power from the USB bus saves the hassle of carrying an external power adapter for this add-on serial port

Extensive list of compatible operating systems makes this device perfect for almost any RS232 application

USB to Straight-Through RS232 Serial Adapter

Easy to setup and install


USB转TTL 3.3V PL2303 可用于蓝牙模块调试板 USB to UART串口线

http://item.taobao.com/item.htm?spm=a230r.1.14.37.Ti4U3O&id=22143428289

USB转TTL小板

送4根杜邦线,用于连接蓝牙模块和USB转TTL小板。

蓝色版/绿色版随机发

一、资料

资料下载地址:

http://www.modiatek.com/down/html/?10.html

注意:淘宝不支持外链接,需要拷贝上述网址到地址栏回车后才能下载;

二、连线顺序

蓝牙通信只需要接3根杜邦线:GND RXD TXD,不需要接VCC;但蓝牙芯片本身工作需要外部供给3.3V VCC电源。

TTL小板   蓝牙模块

3.3V<===>VCC

RXD<===>UART-TX

TXD<===>UART-RX

GND<===>GND

注:有关电平匹配解释,本商品UART接口既可以接3.3V,也可以接5V的,不会用的,用什么表量下来说什么不匹配的评价,不要乱写。不专业的,请联络我们技术支持。

三、发货清单

1、USB-TTL模块    1块

2、杜邦线           4条

3、驱动、测试软件 提供网址下载

五、产品应用和特点

产品应用:

1.各种无线串行透明传输

2.各种行业无线数据传输

3.各种蓝牙SPP通信要求与PC通信,TTL接蓝牙,PC接USB

4.电子爱好者可以用到的USB信号转TTL信号 与蓝牙相连

4.蓝牙模块AT命令修改模块名称,模块密码等。

产品特点:

4.预留3.3V与5V插针接口,方便蓝牙模块直接取电---本条暂不支持,开发中。

2.接口排针与板子平行,而非与板子成垂直安装,方便刷机时引出杜邦线

六、相关问题

针对买家常关心的问题,本店做了总结,归纳为以下几点,请您耐心看完:

1、小板支持win7系统么?

答:usb转ttl的小板支持win7系统的,本店提供的驱动程序有直接在WIN7下测试通过。

3、你的小板为什么联机没反应?

答:首先本店保证每一块小板都经过测试没问题才发货,店主要求客户收到小板后严格按本店介绍的小板测试方法先测试,确定没问题再进行刷机。“为什么联机没反应”基本上都是新手的提问,涉及到端口(com口)的设置、端口的选择、软件参数的设置、数据的正确性以及机器的好坏,请买家先耐心找寻原因。

八、应用举例--单片机与蓝牙传输连接演示

下图使用TTL模块给蓝牙主从模块连接传递数据给单片机演示。

(图中蓝牙模块需要另买,点击上面蓝牙模块链接一并购买即可)。


.END