Code to read and write to EPROM

Posted on 2006-05-01
Last Modified: 2010-04-15

Can someone help me with a snippet or code that will allow us to read and write data to an EPROM in either C or C++

Question by:birenshukla
    LVL 19

    Expert Comment

    What type of EEPROM?


    Author Comment

    EEPROM is Atmel 24C family.

    Basically, we are going to use hte i square C protocol to program the EEPROM. It is a hardware device that attaches to a computer's USB that serves as a license key.
    LVL 55

    Expert Comment

    by:Jaime Olivares
    Appears to be you are trying to crack a license dongle.
    Besides this, code to read the EPROM will be useless because it is protected by USB logic, you will need to learn how to "talk" to the device through the USB driver. That's not a trivial task if you are not the device's designer.

    Author Comment

    We are designing the device. We are the manufacturer. I just want to know how to achieve this task of being able to read and write to the EEPROM on the device(which is USB) when the software wants to check to see if the client has the license hardware or not.
    LVL 55

    Expert Comment

    by:Jaime Olivares
    well, in that case you have to choose a microcontroller to manage the memory, have you did it?
    The secuence is:
    You have to build a device with a USB enabled microcontroller or a standard microcontroller with an USB controller device, plus memory.
    Write the software (or firmware) for the microcontroller.
    Write the specific USB driver for windows
    Write the code portion to talk to the device through the driver.

    LVL 5

    Assisted Solution


    Check O-Reilly publications..

    They have book on Embedded systems programming..Also.. check this.

    Might give you some idea.

    LVL 8

    Accepted Solution

    "Write the software (or firmware) for the microcontroller."
    1. Likely there will be support for I2C protocol in microcontroler (simple instructions like I2CSTART, I2CSTOP, I2CWRITEBYTE, I2CREADBYTE)
    2. You wil have to handle USB endpoint to exchange data with windows driver

    "Write the specific USB driver for windows"
    Probabely there will be some generic windows driver for microcontroler (read data, write data). This will spare you writing your own dirver.
    LVL 55

    Assisted Solution

    by:Jaime Olivares
    If you really want to spare LOTS of time, I suggest you to buy this book:
    USB Complete
    By Jan Axelson

    I have the book, it has the basics to design both sides of USB (PC and device).

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now