00:03This video will demonstrate how to turn on the LEDs in Multisim and CCS for programming purposes.
00:09First, we need to see if the correct library exists for the PIC 16F84, which
00:15Multisim only has two microcontrollers, the most common and widely used being the 16F84, and
00:21the 16F84A. There is also the PIC 8052 or the 8051 from the Atmel family, among others.
00:37We then performed the programming on the 16F84 microcontroller, writing numeric include
00:4316F84.h for the library.
00:52Next we write the fuses; in CCS, fuses are compilation directives that
00:56They control the fundamental behavior of the microcontroller; necessary abbreviations
01:01for the operation of the microcontroller. We also write numeric use of lightclock
01:07equal to 1000. This corresponds to the fuses, or hardware configuration, it defines the
01:13Clock speed. Here it says one kilohertz, the internal oscillation speed of the microcontroller.
01:21Next, we write to the registers, numeral byte portp equal to 0x06, assigning it the name
01:27portp to memory address 0x06, then numeral byte trifigual to 0x86, this register
01:41decide which pins are inputs and which are outputs.
01:51In the function section, we write `void mine`, which is the entry point. Everything that is
01:57within its keys, is what the chip's brain will execute.
02:06Next we write, set underscore tris underscore B, 0x00, configure all pins
02:11From port B as outputs, the value 0 means output, 1 means input, and we establish,
02:21Setting portp equal to 0 ensures that when the circuit is powered on, all pins of port B start
02:26off, 0 volts.
02:35We create an infinite loop with while true, which is why we use a loop that is always true.
02:46We write, output underscore IG, pin underscore B, 0, sends 5 volts to pin 6 of the chip
02:51B, 0, then an I-MS wait, 30, the processor waits, 30 milliseconds,
03:12We write the output, output underscore low, pin underscore B, 0, sends 0 volts to
03:18Pin B, 0, the LED turns off, and we return to a 30 millisecond delay.
03:26Once the programming was finished, we compiled it, and it turned out to be fine.
03:35In Multisim, we go to the place menu and select the components to simulate, then we click on
03:41MUC, we have the following chips, we choose the 16F84, we double-click on the component
03:47It's important to leave the first box as the default; this is the area where the data will be saved.
03:52work. We assign a name, task, we click next, here another menu appears, in
03:58The first box, very relevant here. We choose files.hex, for hexadecimal files, the
04:05In the last box we choose a project name, 123, we click next, and we're ready to go.
04:11select a hexadecimal file to be able to simulate in Multisim.
04:16Next, we go to BASIC, here we choose the 220 and 330 ohm resistors.
04:31In the SOURCE section, we select the sources and the ground connection.
04:44In the components GROUP we click on INDICATORS, we select YELLOW PROBE, it will be the LED or
04:50indicator to be used.
04:59We close the connections.
05:08The PROBE voltage will be less than 1.5 volts relative to the 5 volt DC source.
05:25The internal oscillator of the microcontroller is important here; it must match the programming.
05:30This is in 1 kilohertz.
05:41We double-click and select the .ex file in the box.
05:53And we press play to simulate and it is observed that it is correct.
06:05That's all. If you found the video helpful, don't forget to subscribe.
06:08First of all, see you at a shed.
06:12And right now, we'll see you in the next video.
06:12And right now, let's do it.
06:13First, let's go to BASIC, here we have to remember.
06:13Thank you.
Comentarios