Simulator pada versi ini dibuat terpisah dari IDE-nya, yaitu dibuat menjadi file “SimulatorInDLL.dll”. Dengan begini Anda bisa mengembangkan simulator tersebut agar bekerja sesuai keinginan Anda.
Sebenarnya, simulator ini baru mendukung assembly. Tapi Anda bisa membuat batasan-batasan agar simulator seolah-olah bekerja untuk C. Syaratnya, Anda harus tahu persis bagaimana C membuat programnya. Hal ini mungkin jika Anda seorang multi-programmer, artinya tidak hanya mengerti pemrograman mikrokontroler tapi juga pemrograman yang lain. Anda juga harus cukup mengerti bagaimana SDCC bekerja. Jika tidak, Anda baru bisa menggunakan simulator untuk assembly saja.
Eit, jangan kuatir, meskipun simulator ini baru bisa bekerja dalam bahasa assembly, tapi Microcontroller Project akan mengonversi program yang Anda tulis dengan SDCC menjadi assembly. Jadi program C Anda tetap bisa dicoba dengan simulator. Nah sekarang kita akan bahas penggunaan simulator secara umum.

Tujuh menu utama pada simulator:
- Start. Tentu saja menu ini berfungsi untuk menjalankan simulasi. Menu ini akan berubah menjadi Stop jika sedang berjalan, jadi tentu saja berfungsi untuk menghentikan simulasi.
- Single Step (F7). Menu ini berfungsi untuk menjalankan hanya satu baris instruksi.
- Step Over (F8). Menu ini hampir sama dengan Single Step. Bedanya tampak jika instruksi yang dijalankan adalah instruksi call. Single Step akan melompat ke subprogram yang dipanggil, sedangkan Step Over akan menjalankan subprogram sampai selesai.
- Reset. Menu ini berfungsi halnya kita menekan tombol reset pada rangkaian mikrokontroler. Biasanya saat pertama kali simulator dijalankan, Anda belum bisa menjalankan simulasi sampai Anda klik menu ini. Demikian juga setelah Anda melakukan perubahan opsi.
- View. Menu ini berfungsi untuk memilih window mana saja yang akan ditampilkan. Yaitu window RAM internal, RAM eksternal, Port, SFR, dan Register.
- Option. Nah, yang ini yang benar-benar harus diperhatikan agar bisa menggunakan simulator secara optimal.
- Update External. Kalau menu ini diberi tanda cek, maka setiap akses ke ram eksternal akan menyebabkan isi register pada jendela ram eksternal akan langsung diupdate.
- Update Display. Kalau menu ini diberi tanda cek, maka setiap eksekusi program akan langsung menyebabkan semua jendela diupdate. Anda sebaiknya memberi tanda cek pada menu ini jika Anda ingin melihat setiap perubahan data pada setiap eksekusi program. Tapi hal ini akan menyebabkan jalannya simulasi menjadi jauh lebih lambat. Jadi kalau Anda hanya ingin melihat hasil akhir atau hanya ingin melihat kerja yang ditunjukkan pada port, sebaiknya buang saja tanda ceknya.
- Separate 4 bit biner. Nah kalau menu ini diberi tanda cek, maka bilangan biner pada jendela port, sfr, register, atau ram eksternal akan dipisah dalam dua nibble.
- Com. Nah menu ini termasuk menu yang sangat penting jika Anda sedang mencoba program untuk komunikasi serial. Anda bisa pilih Com1 hingga Com4 jika ingin setiap penulisan pada register SBuf benar-benar dikirim ke port serial di komputer Anda. Selain itu Anda juga bisa menghubungkan SBuf dengan simulator lain melalui window message. Jika Anda pilih link ini, maka data yang diisikan ke SBuf akan dikirim ke window yang dituju dengan data pada wParam. Anda sebelumnya harus mengatur dulu parameter-parameter yang dibutuhkan. Pertama adalah handle dari window yang dituju. Untuk mengisi nilai ini, Anda cukup klik pada tombol Capture Handle, kemudian arahkan pointer mouse ke window yang dituju, lalu klik di window tersebut. Berikutnya adalah message yang dikirim. Jika window simulator yang dituju membutuhkan WM_USER, maka Anda cukup klik pada tombolnya untuk mendapatkan konstanta untuk WM_USER. Demikian juga jika window yang dituju meminta WM_CHAR, maka Anda cukup klik pada tombol WM_CHAR. Anda bisa menggunakan notepad untuk menangkap data karakter yang dikirim melalui SBuf jika message-nya berupa WM_CHAR. Yang terakhir adalah lParam. Parameter yang ini tidak selalu digunakan. Ini mungkin akan penting jika Anda membuat sendiri simulator dan membutuhkan informasi tambahan, misalnya simulator Anda juga ingin berkomunikasi langsung dengan simulator ini. Anda tinggal memberi tanda cek pada “Handle Aplikasi ini” untuk mendapatkan handle dari simulator yang sedang berjalan. Tentu saja keterangan ini hanya akan dipahami oleh Anda yang biasa membuat program di Windows.
- Prioritas Thread. Nah, yang ini Anda harus hati-hati memilihnya. Jika Anda milih prioritas paling tinggi, maka semua waktu CPU hampir-hampir akan dihabiskan hanya untuk menjalankan simulasi ini. Jadi kadang Anda bahkan akan sulit untuk menggerakkan mouse.
- Port. Yang ini berguna untuk mengatur link dari P0 hingga P1. Jika Anda klik pada menu ini, maka Anda akan dibawa ke sebuah jendela untuk mengatur link dari port-port tersebut. Ada empat pilihan link untuk setiap port, yaitu link none, jika Anda ingin port untuk tidak terhubung kemanapun; link port, jika Anda ingin port terhubung ke port fisik, misalnya port paralel, PPI atau port-port fisik lain yang terpasang di komputer Anda; link message, jika data pada port ingin Anda link ke aplikasi yang sedang berjalan atau ke simulator lain; dan yang terakhir adalah link file, yaitu jika data yang dikirim ke port akan dikirimkan ke file. Pengaturan link message bisa dianggap sama dengan pengaturan link message pada COM.
- Reset Port+Com setting on close. Jika menu ini diberi tanda cek, maka pengaturan pada port dan com akan dikembalikan ke keadaan tidak “link none” setelah simulasi ditutup. Sebaliknya, seting akan disimpan pada registry dan akan digunakan untuk mengatur simulator pada saat simulator dijalankan lagi.
- Kecepatan Simulasi. Ini adalah menu terakhir pada menu Option. Ini akan menentukan tundaan setiap eksekusi simulasi. Tentu saja menu ini hanya akan berarti jika menu Update Display diberi tanda cek.
- About. Yang ini tidak begitu penting, hanya terkadang kalau kita membuat program, maka kita juga ingin dikenal. Nah kalau Anda klik menu yang ini, Anda akan melihat logo kebanggaan saya.
Break point
Ada kalanya kita ingin menjalankan simulasi tanpa harus mengawasi setiap langkahnya. Kita hanya ingin tahu keadaan pada baris tertentu, misal keadaan register-register tepat sebelum sebuah subprogram hendak kembali (pada perintah RET). Jika demikian, Anda cukup memberi tanda break point pada baris yang Anda kehendaki sebagai tempat berhentinya simulasi. Caranya, klik ganda pada baris di mana Anda ingin simulasi berhenti. Untuk menghilangkan tanda break point, Anda tinggal klik ganda lagi pada baris tersebut.
Update Point
Jika kita ingin simulasi dijalankan dengan cepat, maka kita harus membuang tanda cek pada menu Option-Update Display. Sayangnya jika ini kita lakukan, maka tampilan pada semua jendela hanya akan diupdate setelah kita menghentikan simulasi. Jadi kita tidak bisa mengamati perubahan yang terjadi pada register-registernya. Kita bisa membuat agar pada titik-titik tertentu, nilai-nilai register diupdate tanpa harus menghentikan simulasi. Nah, jika ini yang Anda kehendaki, maka Anda bisa tambahkan update point pada baris tertentu. Misalnya pada baris setelah sebuah port dimodifikasi sehingga kita bisa mengamati perubahan nilai pada port tersebut. Caranya adalah klik ganda sambil menekan tombol Ctrl pada baris yang ingin Anda tambah update point.

Simulator in this version is made separately from the IDE, which is made into the file “SimulatorInDLL.dll”. This way you can develop a simulator in order to work in your favor.
Actually, this simulator only support assembly. But you can set limits to the simulator as if working for C. Condition, you need to know exactly how C make a program. This is possible if you are a multi-programmer, meaning not only understand microcontroller programming, but also other programming. You also need quite understand how the SDCC works. If not, you can only use the simulator for assembly.
Wait, do not worry, although the simulator is only able to work in assembly language, but Microcontroller Project will convert the program you are writing with SDCC into assembly. So your C program can be tested with the simulator. Well now we will discuss the use of simulators in general.

Seven main menu on the simulator:
- Start. Of course, this menu function is to run the simulation. This menu will change to Stop if it is running, so of course serves to stop the simulation.
- Single Step (F7). This menu function is to execute just one line of instructions.
- Step Over (F8). The menu is almost the same as Single Step. The difference appears if the executed instruction is a call instruction. Single Step will jump to the invoked subprogram, whereas Step Over will execute subprogram to its completion.
- Reset. This menu serves as we hit the reset button on the microcontroller circuit. Usually when you first run the simulator, you can not run the simulation until you click on this menu. Likewise, after you make changes to options.
- View. This menu serves to select a window which will be displayed. i.e window of internal RAM, external RAM, Ports, SFR, and Registers.
- Option. Well, this really must be considered in order to optimally use the simulator.
- External Updates. If the menu is marked with a check, then any access to external ram will cause the contents of registers in the external ram windows will automatically be updated.
- Update Display. If the menu is given a check mark, then every execution of the program will immediately cause all the windows updated. You should uncheck the menu if you want to see every change of the data on each program execution. But this will cause the speed of the simulation becomes much slower. So if you just want to see the final result or just want to see the work shown in the port, you should remove the check mark.
- Separate 4-bit binary. Well if the menu is marked with a check, then the binary number on the window of port, sfr, registers, or external ram will be split in two nibble.
- Com. Well this menu is very important menu if you are trying the program for serial communication. You can select COM1 through COM4 if you want any assignment to the SBUF register actually sent to the serial port on your computer. In addition you can also connect SBUF with other simulator through the window message. If you select this link, then the data loaded into the SBUF will be sent to the destination window with the data in wParam. First you must set the required parameters. The first is the handle of the target window. To fill this value, you simply click on the Capture Handle button, then point the mouse pointer to the destination window, then click on the window. Next is the Message to be sent. If the simulator window target need a WM_USER, then you simply click on the button to get the constants for the WM_USER. Likewise, if the window target want a WM_CHAR, then you simply click on the WM_CHAR button. You can use notepad to capture the character data sent via SBUF if it is a WM_CHAR message. The latter is the lParam. These parameters are not always used. This may be important if you make your own simulator and require additional information, such as if you also want your simulator to communicate directly with this simulator. You can just check the “Handle of this application” to get the handle of the running simulator. Of course this information will only be understood if you are accustomed to make a program in Windows.
- Thread priority. Well, you have to carefully select them. If you choose the highest priority, then all the CPU time will be spent almost just to run this simulation. So sometimes you will even be difficult to move the mouse.
- Port. Which is useful to set a link from P0 to P1. If you click on this menu, then you will be taken to a window to set the link of these ports. There are four options for each port link, i.e. link is none, if you don’t want to connect the port anywhere; link port, if you want to connect the port to physical ports, such as parallel port, PPI or other physical ports installed on your computer; link message, if you want to link the data on the port to the running application or to other simulators, and the last is the link file, ie if the data sent to the port will be sent to a file. Link message settings can be considered the same with the settings on COM link message.
- Reset Port+Com setting on close. If the menu is marked with a check, then the settings on the port and com will be returned to the “link none” state after the simulation is closed. Conversely, the setting will be stored in the registry and will be used to set the simulator when the simulator is run again.
- Simulation speed. This is the last menu in the Options menu. This will determine the delay of any simulated execution. Of course, this menu will only be meaningful if the Display Update menu marked with a check.
- About. Which is not so important, just sometimes when we make a program, then we also want to be known. Well if you click on this menu, you’ll see the logo of my pride.
Break point
There are times when we want to run the simulation without having to watch every step. We just want to know the circumstances of the particular line, eg state of the registers just before a subprogram return back (on the RET command). If so, you simply mark a break point on the line that you want as the cessation of the simulation. The trick, double-click on the line where you want the simulation to stop. To remove the break point, you just double click again on that line.
Update Point
If we want to run simulations quickly, then we must remove the check mark on the Option-Update Display menu. Unfortunately if we do, then all display at the windows will only be updated after we stop the simulation. So we can not observe the changes that occur in the registers. We can make so that at certain points, the values of registers will be updated without having to stop the simulation. Well, if this is what you want, then you can add the update point on certain line. For example on the line after a port is modified so that we can observe changes in the value of the port. The trick is to double click while pressing the Ctrl key on the line you want to add the update point.
mas ada koding nya g??
saya butuh bgt..
koding? maksudnya source code? ya ada lah, wong itu aku yang bikin. tapi aku ga membuat itu untuk publik, jadi aku ga mendokumentasikan dengan baik. cuma aku tulis dan aku pahami sendiri. kalo dll nya sih mang aku gratisin buat diambil siapa saja yang mau 🙂
maaf.. maksud mas sulhan pada komentar di atas source code untuk buat file dllnya simulator y????
boleh dong aq ambil kalo gk keberatan… :->
maz….saya pengen tanya….saat saya jalankan demo program running text ….kenapa di simulasi Mxled.exe gak nampil…tolong di kasih pencerahannya…..
@Budiono: sudah download IDE terbaru kan? Nah, coba jalankan demo dari demo yang pertama hingga yang terakhir. Ikuti petunjuk yang ada di situ (baca help).
ini sama dengan emulator tidak ya mas?
@belajar elektronika: tidak sama, ini hanya menirukan kerja hardware secara software saja. meskipun demikian, percobaan2 yg berhubungan dg hardware sungguhan bisa jg dilaksanakan, misalnya komunikasi serial atau membaca atau mengirim data ke port.
Pak, tadi malam saya beli buku bapak. Kok simulator nya ini gak ada dalam CD ya? Kalau mau download dimana pak?
Terimakasih 😀
Oh ternyata ada di Micro Project nya , hehehe
Yang di cd, simulator menjadi satu dengan micro.exe. Tetapi disarankan untuk menggunakan versi terbaru
salam pak sulhan,, saya sudah pernah menggunakan simulator yang ada dimikro7 dan bisa ( pd komputer saya ), tapi saya copy foldernya ke komputer lain kok pas buka mikro7 ada alarm simulatorInDll.dll not found, dan saya tidak bisa gunakan simulator di komputer tersebut.
apa ada yang perlu di instal ya pak??
makasi.
Coba jalankan micro.exe dengan cara klik kanan, terus pilih Run as administrator.
ok master, makasi