Thread: working with flash memory

  1. #1
    Registered User wazilian's Avatar
    Join Date
    Oct 2001
    Posts
    26

    Question working with flash memory

    i need to write to a valid flash memory address in C.
    if anyone has any ideas please lmk. thanx.

  2. #2
    Registered User wazilian's Avatar
    Join Date
    Oct 2001
    Posts
    26

    sorry

    sorry, i guess i should have told you that in the 1st place, well:

    os: windows 2000
    compiler: idea CPU12 with Zap ICD 6812 debugger
    flash: motorola MC68HC912B32 Microcontroller with 32-Kbyte
    Flash EEPROM

    what i am trying to use the flash for is to store data(much in the same way as you would a hard drive).

    thanx in advance.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So it's an embedded application then?

    > os: windows 2000
    This is your host.

    > idea CPU12 with Zap ICD 6812 debugger
    These are your cross-compiler tools, running on win2k, and producing code for your target machine (which you then download).

    > flash: motorola MC68HC912B32 Microcontroller with 32-Kbyte Flash EEPROM
    This is your target

    First thing you need to do is read some documentation to find out where in the memory map this 32K of flash is mapped into the address space of the processor.

    Once you know where it is in the memory map, you can set a pointer to the base with
    Code:
    unsigned char *flash_base = (unsigned char *)0xC000;  // your value here
    Then you need to find out which FLASH device you have. The general principle is the same for most devices, but each has some specifics as well.

    I'm taking a stab at suggesting you have an AMD FLASH device, so how about starting here for looking for a data sheet / programmers reference on the device.

    http://www.amd.com/us-en/FlashMemory...7_1447,00.html

    Then you can access the whole flash as an array running from
    flash_base[0] to flash_base[32767]
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User wazilian's Avatar
    Join Date
    Oct 2001
    Posts
    26

    Talking thanx

    thank you, i greatly appreciate the help. so far the flash is doing what i need it to do, so thanx.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 01-18-2008, 04:06 AM
  2. Replies: 4
    Last Post: 01-13-2008, 02:14 AM
  3. Managing shared memory lookups
    By clancyPC in forum Linux Programming
    Replies: 0
    Last Post: 10-08-2003, 04:44 AM
  4. Accessing Video Memory Information...need help
    By KneeLess in forum C++ Programming
    Replies: 8
    Last Post: 08-24-2003, 03:53 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM