01-17-2013 09:27 AM
Hi I am new to Multisim , also to Micro controller. i tried to light led many times with Pic16f84 with C language . Can Plz someone send me the led example ,or guide me ?
01-22-2013 10:39 AM
Hello,
If you care to look in the samples bundled in Multisim (the blue folder icon next to the "Open" icon), you'll find a few examples with c code in it. Follow these examples to get an understanding of Multisim.
I also found a few tutorials online that you can check out. Try the link below for one of them.
http://www.tentuts.com/2012/01/how-to-use-c-language-in-multisim-for.html
Also look into the MCU manuals for an idea of how to use circuit and MCU cosimulation.
http://www.ni.com/pdf/manuals/371752b.pdf
Cheers,
01-26-2013 12:15 AM
hi
Miguel
Can u plz give me simple example of Multisim C with Pic16f84 like led blinking or powering led which can simulate in multisim 11. it will be helpful to me
01-28-2013 10:04 AM
Here is a simple program I made that turns on specific ports for the PIC mcu.
#include "pic.h"
#define bitset(var,bitno) ((var) |= 1 << (bitno))
#define bitclr(var,bitno) ((var) &= ~(1 << (bitno))
void initialize(void){
bitclr(STATUS, RP0); //set bank 0
PORTA = 0x00; //initialize
PORTB = 0x00;
bitset(STATUS, RP0); //set bank 1
TRISA = 0xFF; //set port a pins to input
TRISB = 0x00; //set port b pins to output
}
void main(){ //main program
initialize(); //run initialization
while (1){ //continuous run
if (RA0 == 0){ //if singal is low then only turn on some port b pins
PORTB = 0b00111100;
}
else{ //otherwise all on
PORTB = 0xFF;
}
}
}
Just connect a VDD source to the MCU, and to the MCLR pin. Also connect a VDD source to a switch. The other side of the switch should connect to the pin RA0 and VSS (place a 10k resistor between VSS and the switch). Make sure the PIC is also powered (VDD and VSS) and connect and LED to all the RB# pins. With the code above, it should work.
Cheers,
01-28-2013 10:07 AM
Also check out this tutorial for MCU Co-simulation.
http://www.ni.com/white-paper/5629/en
02-07-2013 09:49 AM
Hi Miguel V
I tried it in Multisim 12 but it's not working before i makeing post here i got one program from the forum that one also not working .is there any setting problem
i am attaching my file .
Can youplease go through the file and guide