Thread: Microsoft Visual C++ and I2C(I Squared C) interface

  1. #1
    Registered User
    Join Date
    Aug 2014
    Posts
    14

    Question Microsoft Visual C++ and I2C(I Squared C) interface

    Hello All,

    I am attempting to write up a program using Microsoft Visual C++ to control an I2C(I Squared C) interface. The I2C interface has a RS-232 connection. I want to use this setup to transfer a hex file to a ATMEL AT24C01B. The hex file will be transferred to the EEPROM slave address of: A2. The program should ask the user to input a number(must be 3 digits) that is associated with a certain hex file and also another number selection(must be 8 digits).

    I am rusty in C++, more so than I initially thought. Plus, I am not familiar with the I2C hardware. Can anyone help me out with this?

    Thank you in advance.

    Boston357

  2. #2
    Registered User
    Join Date
    Aug 2014
    Posts
    14
    One of my main concerns is how to write my hex file to the location on the chip by using the I2C as described above. I don't know how to code that. If I get that bit, I can do the rest.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > The I2C interface has a RS-232 connection.
    The first thing you need to figure out is how the RS232 to I2C conversion takes place.

    For example, does waggling the RS232 CTS/RTS lines directly drive the I2C interface, or is it something more complex, like sending an ASCII string for a single I2C command, then sending "go"?
    You need to find the specs for the particular interface you're using to find this out.

    Then you should read this, to find out how I2C is used for the particular device.
    AT24C01B

    As far as opening the serial port at the windows end, read
    CreateFile function (Windows)
    scroll down to "Communications Resources".
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Aug 2014
    Posts
    14
    Thank you, I will look into that. I know how the I2C is used to read and write to the AT24C01B. I can do that manually through the interface(GUI). I made my own harness for that. I just need to know how to do it in C++ so that an operator can use it and never see the interface, just the window generated by C++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to work with visual interface in C++?
    By vikkydonlad in forum C++ Programming
    Replies: 2
    Last Post: 06-17-2013, 05:38 AM
  2. A good tutorial for a visual interface?
    By manugarciac in forum Windows Programming
    Replies: 2
    Last Post: 04-28-2007, 06:28 AM
  3. Replies: 1
    Last Post: 04-20-2002, 06:49 AM
  4. Microsoft Visual C++
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 03-07-2002, 12:03 PM