This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

can i write c51 programs in VC++

Hi,
i have to develop a configuration control for a microcontroller. For this i developd GUI using VC++ and µc controller programs are written in Keil. I have to send data from GUI to µc programs which are written in keil, where both programs are running on same pc.But i am not able to make communication between VC and µc, and i got an idea that can i write keil programs in VC, then i did that but vc is not supportng data types of keil, is it possible to write c51 in vc compiler?
Thanking you

Parents
  • "i will try to explain again"

    I'm afraid you're just adding to the confusion:

    "in µc program i have
    sfr oep1 = 0xB2;
    sfr p1 = 0x80;
    and i like to make this intialisation part from GUI"


    Those are not initialisations!

    Those are symbol definitions!

    See: http://www.keil.com/support/man/docs/c51/c51_le_sfrs.htm

    sfr oep1 = 0xB2;
    defines the symbol 'oep1' to represent the SFR (Special Function Register) located at address 0xB2.

    The "0xB2" defines the address of 'oep1' - not its value!

    With the above definition, 'oep1' now behaves just like an ordinary 'C' variable:
    oep1 = 23; // Write the value 23 to the SFR
    
    x = ope1;  // Reads the value from the SFR into variable 'x'


    SFR addresses are fixed by the microcontroller hardware - you cannot just change them willy-nilly!

    Or are you designing some kind of configurable processor based on programmable logic...?

    Can't you get your embedded guy(s) to explain it?

Reply
  • "i will try to explain again"

    I'm afraid you're just adding to the confusion:

    "in µc program i have
    sfr oep1 = 0xB2;
    sfr p1 = 0x80;
    and i like to make this intialisation part from GUI"


    Those are not initialisations!

    Those are symbol definitions!

    See: http://www.keil.com/support/man/docs/c51/c51_le_sfrs.htm

    sfr oep1 = 0xB2;
    defines the symbol 'oep1' to represent the SFR (Special Function Register) located at address 0xB2.

    The "0xB2" defines the address of 'oep1' - not its value!

    With the above definition, 'oep1' now behaves just like an ordinary 'C' variable:
    oep1 = 23; // Write the value 23 to the SFR
    
    x = ope1;  // Reads the value from the SFR into variable 'x'


    SFR addresses are fixed by the microcontroller hardware - you cannot just change them willy-nilly!

    Or are you designing some kind of configurable processor based on programmable logic...?

    Can't you get your embedded guy(s) to explain it?

Children
  • Or are you designing some kind of configurable processor based on programmable logic...?"

    Yes am developing a configurable processor, in this user has to configure the µprocessor using GUI, so am saving user selected configuration data in .txt file and i µvision programs has to read that .txt file.

  • "Yes am developing a configurable processor, in this user has to configure the µprocessor using GUI, so am saving user selected configuration data in .txt file and i µvision programs has to read that .txt file."

    Then, again, I suggest that you have your GUI generate 'C' source files - say config.c and config.h
    Your uVision Project then uses these files to gain access to the configurable items.

    This is the method that Triscend used for their configurable processor; it is also the approach used by Code Architect.