Today 13:33
Forum: The Lounge
Starter: charliecoultas
Views: 0
Replies: 6
Today 13:29
Forum: Website / Forum Issues
Starter: hadv215
Views: 0
Replies: 7
Today 07:40
Forum: WIKI Discussion
Starter: AlbertoFS
Views: 0
Replies: 9
Yesterday 22:26
Forum: The Lounge
Starter: normnet
Views: 0
Replies: 0
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member geoff_c's Avatar
    Join Date
    Oct 2002
    Posts
    184
    Thumbs Up
    Received: 0
    Given: 3
    Total Downloaded
    381.21 MB

    0 Not allowed!

    Default Modification of program code by data in external memory

    For the past several years farmers have been using a product I designed for a customer to measure moisture in grain. Within the code there are different polynomial equations for each different grain tested. My customer has been getting requests for grains that are not common and therefor not in the meter. He would like to able to load some custom grains into a meter without adding them to all meters or making separate code for each meter which would be a disaster for making updates. We have extra external FRAM that we use to store parameters and calibrations on board. So my thought is we could save the data on the Fram and with a couple keystrokes copy it from FRAM to program memory. Not sure exactly how I would do everything as I have never used a bootloader or done anything like this so im wondering if anyone has done this or has any ideas on how I can accomplish this. If it was just a bunch of variables it would be easy but I need to get whole equations in.

    Thanks
    Geoff

  2. #2
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,380
    Thumbs Up
    Received: 306
    Given: 117
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Modification of program code by data in external memory

    Not as easy as it sounds Geoff. But there are several mechanisms.

    1. Create a bootloader that reads from an SD card or FRAM etc, and bootloads the full program, but with different equations. This will require the external flash memory to be large enough to store the program on the microcontroller.
    2. Place the expression parts of the program in a dedicated address, as their underlying asm routines, and bootload new asm routines into there.
    3. Create an expression parser that reads a text based equation and transfers that to the underlying compiler. i.e. an interpreter written in Proton.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  3. #3
    Member geoff_c's Avatar
    Join Date
    Oct 2002
    Posts
    184
    Thumbs Up
    Received: 0
    Given: 3
    Total Downloaded
    381.21 MB

    0 Not allowed!

    Default Re: Modification of program code by data in external memory

    Thanks for the reply Les, appreciate the help. Yes that doesn't sound easy at all and a bit above my programming capabilities. Ill check with my customer to see if we could come up with say less than 10 generic equations then on the FRAM store just which equation number plus the equation constants. So when a person selects one of these custom commodities that we have programmed into the fram the program will goto a location in the FRAM and get a equation number and all the constants for that equation. Then the program will goto that equation in code and run it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. EEPROM Program Memory data retention.
    By Ken_K in forum The Lounge
    Replies: 5
    Last Post: 1st January 2017, 07:25
  2. Replies: 7
    Last Post: 17th October 2011, 15:23
  3. User data in program memory
    By minim in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 9th October 2007, 17:18
  4. Using external program memory?
    By shunt010 in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 30th November 2005, 18:26
  5. External code memory?
    By shunt010 in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 30th April 2005, 16:40

Members who have read this thread since 6th June 2018, 13:07 : 1

Actions :  (Set Date)  (Clear Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts