MIAC ROM

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

MIAC ROM

Post by Dave @Harper Adams »

Hi

Is there any way of increasing the ROM size in the MIAC.
I'm using it with an advanced module and serial module and programming it in Flowcode 5.
I think that because I'm using it with the add-on modules it uses up a lot of code space and the program so far uses 23332 bytes of ROM.
Can the MIAC be retrofitted with a PIC18F4550 or will there still be a problem because flowcode will still think it is programming a MIAC with a PIC18F4455.

Regards Dave

Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

Re: MIAC ROM

Post by Dave @Harper Adams »

Hi

I don't know much about C code, but looking throughthe complied C code there looks like there are lots of macros associated with functions for the MIAC unit and the add-on modules which I'm not using. Such as void FCD_MIAC0_RelayON(char RelayID) and the code immediately below it, and FCD_MIAC(0)_InputANALOG(char InputID)
Is it possible to delete these macros and save program memory.
On the MIAC unit I'm using the buttons, display, one output (A), and the CAN to talk to the add-on modules.
On the Advanced unit I'm using the RS232 input (T12), TTL outputs T1-T5 & T7-T11, and the Real Time Clock.
On the Serial unit I'm using the RS232 input (T12), TTL ouptuts T7-T11, and the SD card.
When flowcode compiles does it compile it all and then put up a message saying there is insufficient ROM for the MIAC, or does it just compile as much as it can for 100% ROM.
If it is the former can I complete my code, complie it to C and them strip out unwanted macros for functions that I am not using?

Regards Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MIAC ROM

Post by LeighM »

The processor chip is surface mounted so would be tricky to update, but not impossible.

Any unreferenced functions are removed by the linker so should not affect ROM code size.

To reconfigure Flowcode V5 for the larger chip:
Find the “MIAC System.fcd” file, usually in C:\Program Files (x86)\Flowcode\v5\FCD
Make a copy of it to say “MIAC 32K System.fcd”
Edit the following parameters:
ChipName=18F4550
FlashSize=32768
Re-start Flowcode and change your project to “MIAC 32K System”

Nb. The MIAC (V2) is now shipping with the 18F4550
Regards,
Leigh

Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

Re: MIAC ROM

Post by Dave @Harper Adams »

Hi Leigh

Thanks for the reply.
I think I will probably buy a new MIAC for this project then. Are all the new MIACs V2s, as the website still has the MIAC down as having the 18F4455 chip, or it the V2 a special order?
The data on the website also says the MIAC has 12K of ROM when the compler report for my program thinks the MIAC has 22K of ROM!

I've made a copy of the FCD file. How do I actually edit it so that I can change the chip name and flash size? Do I need a specific program?

Thanks
Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MIAC ROM

Post by LeighM »

Hi Dave

Sorry, the web site is wrong on both, just cannot keep up with our developments :O)

MIAC s now being shipped from the factory are all V2.
Previous MIAC had 24K ROM, minus the boot loader space.

You can use any text editor, e.g. Notepad, just make sure the extension stays as .fcd

Regards,
Leigh

Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

Re: MIAC ROM

Post by Dave @Harper Adams »

Hi Leigh

I've modified the FCD file and re-started flowcode and then changed the build to the MIAC 32K System.
I've tried compiling the code and I get a messages at the start telling me that "One of the pins of the component FAT16(0) are not connected to the microcontroller" or "One of the pins of the component LED(0) are not connected to the microcontroller", and then asks me to check the component is connected or remove it from the flowchart. When I press the OK box the program appears to compile. It only shows one of the messages each time and the messages alternate the next time I try to compile. I've checked the components are connected within the flowcode and even tried disconnecting and reconnecting them. Obviously I can't see if the program really works or not until I get a new MIAC.

Any Ideas?

Regards Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MIAC ROM

Post by LeighM »

Hi Dave,

In the FAT component “Connections” dialog box, can you check that you have selected “Connect to: Module: MIAC_Serial(0)”

Regards,
Leigh

Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

Re: MIAC ROM

Post by Dave @Harper Adams »

Hi

I connected inthe new MIAC today (V2) and downloaded my latest program (with the build set for a 32K system). It still told me that the FAT16 component and LED (0) were not connected when the program complied.
The program appeared to log to the SD card on the serial expansion unit, but non of the outputs worked on the Advanced or Serial expansion units.
I check the flowcode and all outputs had become disconnected so I reconnected them. When complied the message about the LED being disconnected had gone but the message about the FAT16 component was still comming up.
I've tried checking the connection to the FAT 16 component and tried deleting and then adding it back in, but it still comes up with the message. When the component was deleted the FAT16 icon still remained but it is no longer possible to highlight it when I click on it. It's as if Flowcode Can't see it.
The program appear to work correctly but I'm going to leave it running and logging data to the SD card for 24 hrs.

Regards Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MIAC ROM

Post by LeighM »

Hi Dave,

Good to hear that the program is working.
Strange about the connections.
Could you tell me what version of Flowcode you have? (Help -> About Flowcode)
Could you attach your fcf file, or PM it to me, so I can investigate further?

Thanks
Leigh

Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

Re: MIAC ROM

Post by Dave @Harper Adams »

Hi Leigh

I'm running Professional Version V5.5.2.1.

Regards Dave

Dave @Harper Adams
Posts: 33
Joined: Tue May 21, 2013 4:21 pm
Been thanked: 1 time
Contact:

Re: MIAC ROM

Post by Dave @Harper Adams »

Hi Leigh

My program has been running and logging to the SD card for just over 24hrs (over 200K data points)
I've stopped it and looked at the data and it appears to be writing to the SD card alright. There are the occasional odd or missing figures, but I think this is to do with mis-read data on the serial data reading not the writing to the SD card.
I'll make the assumption for the mean time that even though it flags up a fault with the FAT component, the compile to C is okay.

I'm using a 2G SD card and FAT16. Does the component support FAT 32 if I had a bigger SD card, and in which case does it support long files names (longer that 8.3 filenames)

Thanks
Dave

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: MIAC ROM

Post by LeighM »

Hi Dave,
Good progress.
The component currently only supports FAT16 and 8.3 filenames.
Leigh

Post Reply