element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum How to write dspic33FJ128GP802 flash memory?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 2 replies
  • Subscribers 464 subscribers
  • Views 278 views
  • Users 0 members are here
  • write dspic33fj128gp802 flash memory
Related

How to write dspic33FJ128GP802 flash memory?

zhjoy
zhjoy over 5 years ago

Hi ,

I am working on a project which is using dsPIC33FJ128GP802. I am using MPLAB X IDE, XC16 compiler, pickit3.

I need to write flash memory, I thought I have done all procedures, but the code doesn't work.I attached my code here, please help to see where I missed, and how to improve.

In the code, I tried to write flash memory address 0x01000 with data 0x123456.

 

Please help.

 

Thanks a lot!

Joy

Attachments:
main.c.zip
  • Sign in to reply
  • Cancel
Parents
  • zhjoy
    zhjoy over 5 years ago

    Hi,

    I just found a bug in my code, and fixed it, before it is #1000,I changed it to #0x1000. After the modification, temp.i[0] can get 0xFFFF1234, but if I check program memory, address 0x01000, it is still 0xFFFFFF. and if I reset the processor, the first time step here, temp.i[0] is 0xFFFFFFFF again. So, flash memory wasn't written.

    asm("MOV #0x1000,W0"); //an example program memory address

    Where am I wrong, please help.

     

    Thanks a lot,

    Joy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • zhjoy
    zhjoy over 5 years ago

    Hi,

    I just found a bug in my code, and fixed it, before it is #1000,I changed it to #0x1000. After the modification, temp.i[0] can get 0xFFFF1234, but if I check program memory, address 0x01000, it is still 0xFFFFFF. and if I reset the processor, the first time step here, temp.i[0] is 0xFFFFFFFF again. So, flash memory wasn't written.

    asm("MOV #0x1000,W0"); //an example program memory address

    Where am I wrong, please help.

     

    Thanks a lot,

    Joy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • zhjoy
    zhjoy over 5 years ago in reply to zhjoy

    Hi,

    I thought the code works now, it is my verification way is wrong. After I downloaded my code to the processor and run it in debug mode, my expectation was to see in MPLAB X IDE,  the  Program Memory window, in address 0x01000, the data is changed to the new data. I think this is wrong, When I export the data which in temp.i[0] over CAN, the output value is proper.

     

    Thanks,

    Joy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube