LPC8xx ROM API

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC8xx ROM API

827 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by mister_T on Sat Mar 26 05:18:21 MST 2016
NXP LPC810 part can be very handy in DIY projects and also in low cost professional projects where the low pin count is sufficient. However, the internal flash size prevents its use quite often with LPCXpresso and ready made LPCOpen examples. These generally take about 8kb of flash while 810 only has 4kb. To address this issue a very good start is LPC810 codebase which can be found here: https://github.com/microbuilder/LPC810_CodeBase. This is a low memory project template to start work on. However, it does not take advantage of the ROM API included in many LPC parts and does not include I2C drivers.

I decided to move a bit further and use the abovementioned LPC810 codebase and LPCopen and combine these to reduce memory consumption even further. The lower memory requirements are achieved with ROM drivers for PLL, UART and I2C. LPC ROM API is a bit daunting to get into. These files should help with that considerably. You can find all necessary files in the attachment with readme.

The template is most easily used under Linux environments. Just navigate to the src folder and type, 'make clean' and then 'make'. Naturally you need arm gcc compiler installed. A good editor for Linux is Geany which has good integration with gcc.

LPCXpresso is a very good IDE. For easy integration I included LPC8x_ROM_LPCXpresso.zip file. This is an LPCXpresso project archive. Import it to LPCXpresso by clicking 'import projects' from the bottom left quickstart section. This has only been tested with Linux version of LPCXpresso but probably works in Windows as well.

For the example application to work, connect LM75 temperature sensor IC as follows.
PIO0.2=SCL
PIO0.3=SDA
A0=gnd
A1=gnd
A2=gnd

And very importantly, add pullup resistors from PIO0.2 and PIO0.3 to 3V3. Resistor value 1k-10k should be okay. If the example does not work, try reducing I2C bitrate in i2c.h file.

Original Attachment has been moved to: LPC8x_ROM_LPCXpresso.zip

Original Attachment has been moved to: LPC8x_ROM_template_0.zip

Labels (1)
0 Kudos
7 Replies

107 Views
NXP Employee
NXP Employee
bump
0 Kudos

107 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Sat Apr 16 12:33:22 MST 2016
NEVER write the program to EPROM. EEPROMs are designed for persistent storage of small amounts of data (typically a few Kbytes) they are not meant for storing code, and if you tried, either it wouldn't run, or would be very slow.
0 Kudos

107 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by HammingBird on Fri Apr 15 14:18:53 MST 2016
Hallo mister_T,

Thanks, now it  go.  I would like to ask a silly question. I saw somewhere in the internet that, writing prog to EEPROM.  And here your have prog for  ROM.  EEPROM and ROM both are non-volatile.

  in LPC810, there is no EEPROM, it has Boot ROM API support. see more :

   http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc-cor...   

now my question is,
When  write program to EEPROM   and   when to ROM ?

Thank you  
0 Kudos

107 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by mister_T on Fri Apr 08 10:07:33 MST 2016
Thanks for the info. In LPCXpresso one extra project import must be made to the workspace before the LPC8x_ROM_LPCXpresso.zip compiles and links.

To add the required files:
-click "import projects" in quickstart window
-add a project to the workspace called "CMSIS_CORE". I have it in the same folder as LPCOpen. This should be in the default path where LPCXpresso looks for projects.
-select CMSIS_CORE_LPC8xx in the following window and press finish.

Finally in the quickstart window, click "clean rom_template" and "build rom_template". It should build without errors.

-sendI2CMaster is for sending data to a specific register.
-SendReadI2CMaster is for reading data from specific register. It first sets the register where to read, and then reads the data.
-readI2CMaster reads data from the current register active in the I2C chip.

Hope this helps.
0 Kudos

107 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by HammingBird on Mon Apr 04 12:47:18 MST 2016
Hallo mister_T,
the "LPC8x_ROM_LPCXpresso.zip" does not work.
problem 1.

Problems Description : "fatal error : core_cmInstr.h:No such file or directory"

problem 2. in main prog you wrote :
"
sendI2CMaster(I2C_ADDR_7BIT, LM75_REG_CONF, LM75_POWERDOWN);
mrtDelay(5000);
sendI2CMaster(I2C_ADDR_7BIT, LM75_REG_CONF, LM75_POWERUP);
//tempValue = readI2CMaster(I2C_ADDR_7BIT, 2);//read from current address
tempValue = SendReadI2CMaster(I2C_ADDR_7BIT, LM75_REG_TEMP, 2);//read from given address
tempValue = (tempValue & 0x7F);  "

But in "i2c.h" file the command "sendI2CMaster" is used for transmitting data. But how you used it for reading data from "LM75_REG_CONF"   ?

how could I solve these  problem ? I just want  to see the i2c signal(scl, sda)  on oscilloscope.
 
0 Kudos

107 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by mister_T on Sun Apr 03 03:12:16 MST 2016
I hope you'll find it useful. There's no repo at the moment.
0 Kudos

107 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by changchao on Mon Mar 28 20:05:11 MST 2016
Thanks for the great work,will look into it.
Is there a github repo?
0 Kudos