Help: how to store a hexadecimal file in flash memory


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2007
    Posts
    4

    Default Help: how to store a hexadecimal file in flash memory

    Hello,

    I have just started with pic's. I am using pic18f258. It has 32k of flash memory. I would like to store a file in a determined space. I tried to find for functions in pdf's, but I couldn't. If anyone could help me!?

    I am using MPLAB IDE V7.30 and C programming.
    This is a file to send by CAN communication.

    Thanks,

    Rodrigo Sakai

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sakai View Post
    I have just started with pic's.
    This is the key phrase right here. What have you done with PIC's so far? What have you done with MCU's in general? What do you really want to do with the '258? Storing a file is a very vague statement. There's a lot of ways to store a file, and a lot of places to store it.

    I am using MPLAB IDE V7.30 and C programming
    And you might want to find yourself a nice C forum to help you out with it all.

  3. #3
    Join Date
    Apr 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    >>This is the key phrase right here. What have you done with PIC's so far?

    Just sent some CAN messages (J1939 Standard)

    >>What have you done with MCU's in general?

    I am trying to buid a CANbus with some Nodes..

    >>What do you really want to do with the '258?

    People from my lab was using 258 for CAN communication and embedded systems pourposes..

    >>Storing a file is a very vague statement. There's a lot of ways to store a file, and a lot of places to store it.

    I need to send data from one node (pic) to another one. This data is in a file (hexadecimal) and is about 15k long. I don't know how to save this "big" array of data in flash memory, or another better place..

    Thanks
    Regards

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sakai View Post
    I am using MPLAB IDE V7.30 and C programming
    ????????????????

  5. #5
    Join Date
    Apr 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Ok, thanks

  6. #6
    Join Date
    Apr 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Contribution

    Ok, here is one way to solve my problem:

    ------------
    #pragma romdata const_table

    const rom unsigned char my_const_array [] = {
    0,0,0,1,1,232,3,0,0,0,
    1,0,28,8,0,173,0,0,232,3,
    ...
    82,0,0,0,0,0,0,0,0,0,
    0,128,63,0,0,2,0};

    #pragma romdata
    ---------------------

    This array of data is from a .txt file (notepad).

    Bye

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    #pragma romdata const_table

    const rom unsigned char my_const_array [] = {
    0,0,0,1,1,232,3,0,0,0,
    1,0,28,8,0,173,0,0,232,3,
    ...
    82,0,0,0,0,0,0,0,0,0,
    0,128,63,0,0,2,0};

    #pragma romdata
    I don't recognize any of those commands or statements...I'll bet PBP doesn't either.

Similar Threads

  1. Storing data in Flash (Program) memory
    By MikeBZH in forum General
    Replies: 9
    Last Post: - 4th March 2014, 15:38
  2. USB to USB flash Drive File Copier
    By emildownloads in forum General
    Replies: 222
    Last Post: - 27th October 2011, 01:23
  3. Flash Memory Cards, USB sticks and Excel
    By timmers in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 4th October 2008, 22:46
  4. The ultimate include file
    By bearpawz in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th January 2007, 19:35
  5. using Flash Program Memory ?
    By muskut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th October 2006, 15:17

Members who have read this thread : 0

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

Posting Permissions

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