How to initialize large Array

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times

How to initialize large Array

Post by Alkaline »

Hi

I need to initialize very large array, up to 2048 value.

The data are in this format

ARRAY [] =
0x00, 0x00, 0x00, 0x00, 0x00,
0xFE, 0xE0, 0x00, 0x00, 0x00
0xFF, 0x5C, 0x00, 0x00, 0x00,
0xFF, 0xF5, 0x08, 0x20, 0x00,
0xFF, 0x38, 0x00, 0x00, 0x00,
0xFF, 0x80, 0x00, 0x00, 0x00,

I initialized the array with the C code using this instruction
array [430] = {0x00, 0xFF ....};
but without success.

The compilation does not report errors, but the array is not initialized

any suggestions?

Thanks in advance

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: How to initialize large Array

Post by kersing »

What is your target device? The Lookup component is probably what you are looking for.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times

Re: How to initialize large Array

Post by Alkaline »

Hi Kersing

my target devide is dsp, specifically the ram.
I need to perform several configuration writes, but for the two larger ones, which are the program and the parameters I need two different arrays.

By checking the forum I saw that they were postponed for the lookuptable but I can not figure out how to make it work.

Data from these arrays must be transmitted via i2c.

I have already tried to communicate a single byte with the dsp and it works correctly, as I have tested the sending of a small array and that has worked too.

How do I pass the values ​​of this lookup table to the i2c macro?

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: How to initialize large Array

Post by kersing »

For target device I mean which controller do you want to use? PIC 8 bit, PIC 16 bit, ARM, Atmel?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times

Re: How to initialize large Array

Post by Alkaline »

I currently use a pic32 mx470f512h

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times

Re: How to initialize large Array

Post by Alkaline »

Hello everyone

I update you about the initialization of a large array.

I was able , through the use a lookup table, to initialize an array and to program the external memory!

Post Reply