00:06This video simulates a two-way traffic light; for this we wrote
00:10numeral, including that we include the PIC16F48, then we write fuses, sonos, fusibles
00:20or hardware configuration, we write numeric BytePort equal to 0x06.
00:30It assigns the name PORT to the memory address 0x06, we write numeric BytePort equal
00:360x86, assigns the name PORT to the address 0x86, here is the record definition.
00:45Next, it's not here, but it's written, numeral USD like, clock equal to 1000 define
00:50the speed of the clock.
00:51Here it says one kilohertz, this is to define registers, already in the main function, mine.
01:04VoidMine is the entry point.
01:06Everything that's inside your keys is what the chip's brain will execute.
01:13We write, set-tris-b, 0x00, sets all pins of port B as outputs, the value
01:200 means output, 1 means input, port equals 0 here.
01:25Ensure that when the circuit is turned on, all pins of port B start off, 0 volts.
01:35Next, in the section on the infinite while true loop, a microcontroller must not leave
01:40When executing code, it repeats indefinitely.
01:46We write, output-i, pin B0, sends 5 volts to pin 6 of the chip, B0.
01:52If you have an LED connected, it will light up, and if it's low, it will turn off; this is important.
01:57to alternate between both states I and low, we write the on state and, on, B5, then
02:04The information we wrote about the IMS is a 30-millisecond wait.
02:18We write the off state low, pin B5, turns off LED 5, we write from the IMS, it is a
02:2430 millisecond wait.
02:32We write the state on and, pin B4, we write from the IMS, it is a 30 millisecond wait.
02:46We write the off state low, pin B1, we write the off state low, pin B4, we write
02:53From IMS, it's a 30-millisecond wait.
03:00We write the state on and, pin B2, then a 30 millisecond wait.
03:09We write the off state low, pin B2, we write from the IMS, it's a 30 millisecond wait,
03:16We write the state on and, pin B1, with a wait of 30 milliseconds.
03:26We write the off state low, pin B5 and pin B3.
03:36The programming logic is as follows: red LED 1 and green LED 2 are turned on.
03:42Green LED 2 turns off, yellow LED 2 turns on, red LED 1 turns off, red LED 1 turns on
03:482, green 1 turns on, yellow 1 turns on, red 2 turns off, and the WIT loop returns
03:53of TRUE.
03:59Once the programming is done, we check the code for missing parts or if it is correct.
04:04We've written it, compiled it, and we see that the programming is correct.
04:15On the other hand, we make the circuit, first we click on MUC, we choose the PIC 16F48,
04:22We configure the PIC, choose a name, Task 37, click on Project Type, and choose
04:30hexadecimal file, we choose a project name, for example project 117, we go
04:36Source, we choose the components, Ground, we go to basic, we choose a 220 ohm resistor,
04:51In basic, we choose the 5-volt DC power supplies; here, importantly, we click on Pack.
05:03It features a series of resistors in parallel, which allows us to make a better connection,
05:07We select one of 6, in indicators we look for the LEDs, red, yellow, green, we perform the
05:25connections, we erased the names on the LEDs,
05:42Let's go to graphs, select rectangle, representing the traffic light, we do it
05:48Within the LEDs, we click, select the rectangle, and change the color to blue.
05:56and we copy, we change the DC voltages to 1.5 volts, we select bus, a bus is a route
06:10shared physical infrastructure, cables, tracks, through which data, addresses and signals are transmitted
06:16The control between components allows for easier copying and renaming.
06:28We click on the line for the bus, and change it to S, we also add another bus, and also
06:34We changed the name to S, now in the connection, we named the pin RB0, RB1, up to RB6, and performed
06:49the connections.
07:32We uploaded the hexadecimal file, named F1, and clicked simulate; it appears to be correct.
07:39The sequence is complete. If you found the video helpful, don't forget to subscribe.
08:09Thank you.
08:09Thank you.
Comentarios