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

Popular posts from this blog

Multiplex 4 Seven Segment Display With 8051 In Assembly

Multiplexing is very essential part while working with 8051 because of its limited number of ports. which offer 32 pins for connecting external devices. 32 seems large but when you working with seven segment, keypad, LCD, ADC etc. or if you project have many parts to operate simultaneously then you definitely need to multiplex some of ports.

LCD Interfacing with 8051 in 4 bit mode : assembly tutorial

Hello friends, in this tutorial we are going to interface LCD with 8051 microcontroller but in 4 bit mode. we already interfaced LCD with 8051 in 8 bit and also done scrolling of text in previous tutorials.

how to get 7805 in multisim - Replacement of 7805 in multisim

  finding some parts in multisim is really tough work because multisim  not provide all general purpose component like 7085 and other voltage regulator. one more  bad information is that manufacturer of these component also not provide any PSPICE because output of these component are predetermined and not changed according to the circuit.