No EEPROM in FlowCode ARM v4

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Odox00
Flowcode v5 User
Posts: 24
Joined: Thu Aug 25, 2011 11:15 am
Contact:

No EEPROM in FlowCode ARM v4

Post by Odox00 »

I cant find the EEPROM icon in the menu in FlowCode ARM v4. The bitmap picture is in the Component folder "ARM_EEPROM.bmp" but no c-file or ocx file are found there.
Jeppe
Don't say oups!? Say Interesting!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: No EEPROM in FlowCode ARM v4

Post by Benj »

Hello,

The supported ARM range of devices do not have EEPROM memory as such. You can however read and write from any spare locations in ROM if you desire.

The C functions to do this are as follows.

Code: Select all

	char read_register(unsigned int address)
	{
		char RetVal;
		volatile char* register_ptr = (char*)address;
		RetVal = *(register_ptr + 0x00200000);		//Add SRAM base address to ICD pointer
		return RetVal;
	}


	void write_register(unsigned int address, char data)
	{
		volatile char* register_ptr = (char*)address;
		*(register_ptr + 0x00200000) = data;		//Add SRAM base address to ICD pointer
	}
Pop the code for the functions into the supplementary code window and then reference the functions by using C code icons.

Or modify one of the custom component C files and then you will be able to call the functions without resorting to C icons.

Odox00
Flowcode v5 User
Posts: 24
Joined: Thu Aug 25, 2011 11:15 am
Contact:

Re: No EEPROM in FlowCode ARM v4

Post by Odox00 »

Tanks!
Think I'm little to much newbie in C (the reason I choose FC) to figure out how to implement those functions. A simple (if there are one) sample code would help me.
Jeppe
Don't say oups!? Say Interesting!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: No EEPROM in FlowCode ARM v4

Post by Benj »

Hello,

Here is the code in the form of a custom component. Copy the C file into your "Flowcode ARM v4/Components" directory before starting Flowcode. Then add the Custom2 component to your program and you should gain access to the functions. Remember that the functions share the program memory space so be careful about which addresses you choose.
Attachments
ARM_Custom2.c
(4.03 KiB) Downloaded 236 times

Odox00
Flowcode v5 User
Posts: 24
Joined: Thu Aug 25, 2011 11:15 am
Contact:

Re: No EEPROM in FlowCode ARM v4

Post by Odox00 »

I't seems to work except the write function. Can't get it to change the value in an address. Every time I read I get the value of (byte)147. I tried many different addresses but still the same value. I attached the program I made to test the function. Am I doing something wrong?
Attachments
mem.fcf_arm
(9 KiB) Downloaded 211 times
Jeppe
Don't say oups!? Say Interesting!

Odox00
Flowcode v5 User
Posts: 24
Joined: Thu Aug 25, 2011 11:15 am
Contact:

Re: No EEPROM in FlowCode ARM v4

Post by Odox00 »

Got it to work now. Don't know what I did wrong.
If I want the data to stay in the memory after power loss. So I can re-read the last stored values up on restart.
Jeppe
Don't say oups!? Say Interesting!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: No EEPROM in FlowCode ARM v4

Post by Benj »

Great, glad its working for you now. Data you store in the ROM should be retained during a power cycle.

Post Reply