Jump to content

Data storage with mios32 and the LPC


Recommended Posts

Question,

For an app that includes storage of a block of data equivalent to an array 48 lines by 16 bytes wide, where latency is not a problem, what is the preferable method of storage, the SD card, the on board eeprom, a bankstick? Each line represents a piston on an organ, and the 16 bytes (128 bits) in binary carry the status of a contact on 128 stop tabs.

Johnc

Link to comment
Share on other sites

That's a matter of taste really :) The internal EEPROM is easy to handle, doesn't require external parts but is in the chip and hard to remove and put somewhere else in case that's something you might wanna do.

The SD card seems like an overkill if you don't have lots of other info to read/write a lot (and possible exchange with a PC)

The EEPOM needs pretty much no extra parts, is easy to handle, is small/tiny* and replaceable. It's still my personal favorite for smallish amounts of data.

*) whee2.JPG

Link to comment
Share on other sites

Thanks Nils

One more question. I have several 8 bit cores and am trying to learn a bit of asm programmming.

If I write a short asm program using basic asm code and compile it. can I load into the pic and run it. I don't anticipate anything very complex, or any mios 8 related stuff.

Is there any thing having to do with mios, that I would have to turn off, disable, etc. to use the basic ports on the 18F452?

Johnc

Link to comment
Share on other sites

Typically not. You can simply use the asm_skelton and code away. Simply set the configuration registers for the port you want to use and you're pretty much there :) Every once in a while you might run into some conflicts with existing modules that try to use the same port, which you could disable (there should be some defines somewhere for that).

Unless you really, really like crawling through the jungle on your hands and knees a lot more than using a helicopter and enjoying the sight, I'd say stick to C tough ;)

Link to comment
Share on other sites

Typically not. You can simply use the asm_skelton and code away. Simply set the configuration registers for the port you want to use and you're pretty much there :) Every once in a while you might run into some conflicts with existing modules that try to use the same port, which you could disable (there should be some defines somewhere for that).

Unless you really, really like crawling through the jungle on your hands and knees a lot more than using a helicopter and enjoying the sight, I'd say stick to C tough ;)

Nils,

Yes I hear you, and have spent almost equal time with C. I figured that knowing and understanding the hard way would give me a greater appreciation for c. I'm not good at "black box" concepts, I want to know what is in the box! at 73, and retired, I have time to "twitel" with the "minusha".

Being an organ geek, my primary interest is in midio128 and how it functions.

thanks for the input.

johnc

Link to comment
Share on other sites

Nils,

If one desires to modify a known app such as midio128, ver.2, or any app for that matter, how do you know if the base program is reserving space in the internal EEPROM, or RAM, or Flash? if you want to dumnp a buffer to the EEPROM, is the starting address 0X00 or some other address?

Also - I'm confused with the terminology "load and latch" the DOUT shift registers. "Load" the shift register means to shift a given number of bites into the shift register, and "latch"

would transfer the loaded bits in the DOUT registers to the output pins. Is this correct?

Thanks,

johnc

Link to comment
Share on other sites

If one desires to modify a known app such as midio128, ver.2, or any app for that matter, how do you know if the base program is reserving space in the internal EEPROM, or RAM, or Flash?

The compiler (or assembler) organises instructions that go into Flash memory according to the Hex file that it generates. The details of what, and where are hidden from the programmer so that they can concentrate on the logic and design of the code. Of course you can always inspect asm listings of compiled code if you are curious or otherwise need to.

Ram addresses are derived by the compiler according to the variables declared in your program, again the details of exactly what goes where is usually preferred to be hidden from sight. It is the instructions in Flash which reference and use the RAM space for varaibles.

Variables to be stored in an external eeprom are under the control of the programmer/coder.

(In general) If you want to modify a program to store data to external eeprom:

-identify the data

-copy it to eeprom using a library routine

-load it from eeprom to the data space

-have a way of controlling when and what is read from/written to eeprom

hope this helps

Link to comment
Share on other sites

The LPCXPRESSO features a 8k EEPROM.

It can be accessed through the $MIOS32_PATH/modules/eeprom routines.

Programming example: http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_kb_v1%2F&#

see especially:

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_kb_v1%2FMakefile (search for EEPROM)

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_kb_v1%2Fsrc%2Fmios32_config.h (search for EEPROM

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_kb_v1%2Fsrc%2Fpresets.c

Note that this is work in progress, future versions will store much more informations in EEPROM, but will also get more complex (therefore harder to understand).

The EEPROM isn't used by the MIOS128 application if this was your question.

If you use a different magic number (EEPROM_MAGIC_NUMBER, defined in mios32_config.h), the EEPROM content will be initialized by preset.c to ensure data consistence.

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...