Skip to main content

How to use c language in multisim for 8051

Multisim is best simulator for electronics circuits and MCU devices with high accuracy. but there is a problem for microcontroller with mutisim, that is they  not give any user manual for 8051 with c language. this post give a basic idea how to use c language in multisim for 805x mcu devices.


Header file: multisim use a different header file for 8051 & 8051 [reg51.h and reg51x.h used in keil ]
 it use htc.h with automatically include 805x.h to your program as need... so use this at top of code.
                          
#include<htc.h>


 you can also use #include<805x.h> but i think htc.h is best. Rest of things is remain same as c language
               



  some of tips for newbies

  • use 'unsigned char' instead of char data type 
  • use 'unsigned int' instead of  int data type
  • use P00 to define port bit instead of P0.0 [ P0.0 is used in asm]
  • #define NewPinName P11 to define port bit
  • const unsigned char array[ ] to declare array and store it in  ROM . its value should not changed in program else it cause error
  • multisim use HI-TECH c compiler and it manual can be find  at C:\Program Files (x86)\HI-TECH Software\HC51\lite\9.60\docs folder [ in windows 7 for me, some where else for you ]
If you face some problem you can contact me or leave a comment







Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Do you work with 8051 interrupts in Multisim?

    ReplyDelete
  3. i am a beginner.can you please give me step by step instructions to simulate the output?how to see the output for led blinking using STM32F103?

    ReplyDelete
  4. i try all what you mention in your post
    can i send to you my code to try find a solution

    ReplyDelete

Post a Comment