During the New Year holidays, and not only, there is a great need for light illumination.

This device can be called differently: a mood lamp, an RGB lamp, a New Year's lamp, an LED beacon, etc. Your imagination will tell you how to use it.

Here is a diagram of a multi-color RGB lamp on a PIC12F629 (or PIC12F675) microcontroller. To enlarge, click on the image.

Appearance of the assembled RGB lamp.

Video of the lamp working in the “Mood Lamp” mode.

The circuit of the proposed device is very simple, but has many operating modes. Here are just a few of them:

    Slow color change. Green, red and blue glow of different intensities are mixed, which allows you to get a smooth selection of rainbow colors;

    Fast alternate flashing in red, green and blue;

    Smooth increase in white light and then 4 flashes. Then the cycle repeats;

    Alternate sharp flashing and slow fading of primary colors (blue, red, green). Afterwards the cycle repeats.

    Smooth red glow;

    Smooth blue glow;

    Smooth green glow;

    Flashing blue;

    Accelerated color change;

    Smooth white glow;

    Smooth white glow with reduced brightness;

    Smooth white glow with minimal brightness;

    Smooth glow violet (red + blue);

    Smooth orange glow (red + green).

These are the main operating modes of the lamp. All the rest are options for smoothly changing the colors of the rainbow at different speeds.

To appreciate the full rich palette of modes and the performance of the device, it is better to first assemble it on a solderless breadboard. The so-called “breadboard”.

In order for the glow from different LEDs to mix and form an even color shade, the LEDs must be placed as close to each other as possible. Also, after prototyping the diagram, you can take a white A4 sheet, roll it into a cylinder and secure it on the sides with paper clips. We install the resulting paper cylinder on a solderless breadboard and cover the LEDs. As a result, we will get a kind of matte lampshade. Here's what might come of it.

The microcontroller must be “flashed” before being soldered into the board. I have already talked about how to do this on the pages of the site. What to flash is a separate question. If you have nothing, then first you need to assemble a USB programmer for PIC microcontrollers yourself or buy a ready-made one. It will come in handy more than once.

When flashing PIC12F629 or PIC12F675, you need to pay attention to the calibration constant. It wouldn’t hurt to first consider ( "Read") data from a blank microcontroller and write down the value of the constant somewhere on paper. After flashing the microcontroller, you need to check whether the value of the constant in the cell matches 0x3FF the previously read value. If it is different, then change the constant. I have already talked about what a calibration constant is.

List of necessary radio components for assembling an RGB lamp.

Name Designation Parameters / Rating Brand or item type
Microcontroller DD1 8-bit microcontroller PIC12F629 or PIC12F675
Integral stabilizer DA1 to output voltage 5 volts 78L05, MC78L05ACP (any analogue)
MOSFET transistors VT1 - VT3 - 2N7000 or KP501A ( Attention! KP501A has a different pinout!)
Semiconductor diode VD1 (optional) 1N4148, 1N4007 or equivalent
LEDs HL1 - HL4 red glow colors any bright ones with a diameter of 5 mm.
HL5 - HL7 green glow colors
HL8 - HL10 blue glow colors
Resistors R1 120 Ohm MLT, MON (dissipation power - 0.125 W)
R2, R3 68 Ohm
Capacitors C2 220 nF (0.22 µF) Ceramic multilayer or any analogues
C3 100 nF (0.1 µF)
Electrolytic capacitor C1 47 uF * 16 volts any aluminum (K50-35 or foreign analogues)
Button SB1 - any tact button (for example, KAN0610-0731B)
Jumper J1 (not installed) -

After power is applied, the device starts working immediately. By pressing the SB1 button you can switch the operating mode of the RGB lamp. The button can be pressed even indefinitely - switching modes occurs in a circle.

A PCB is easy to make using a PCB marker. That's what I did. If there is no marker for boards, then you can use the “pencil” method or tsaponlak. If you know how to make boards with LUT - even better.

Well, if you don’t have any of the above, but you really want to make a homemade product, then instead of fiberglass you can use thick cardboard, a piece of thin plastic or plywood. In general, everything on which the circuit can be mounted using a surface-mounted system. Connections can be made with copper wire from the back of the base.

Now such advice may seem crazy, but when I first started studying electronics, I tried all sorts of ways to assemble circuits. In those recent times, consumables and parts were bought at radio markets, which were only in large cities. We could only dream of ordering radio parts online back then.

Explanations for the diagram.

Transistors 2N7000 can be replaced with KP501A. But it is worth considering that the KP501A another pinout! Here it is.

The protective diode VD1 does not need to be soldered into the circuit. It serves to protect the circuit in case of incorrect power connection - polarity reversal. If such protection is not needed, then diode VD1 is also not needed.

Resistors can be selected with values ​​close to those indicated in the diagram (standard tolerance ±20%). For example, I set R1 to 130 Ohms, and R2, R3 to 82 Ohms.

To power the circuit, you will need a stabilized power supply with an output voltage of 12 volts. Suitable, for example, is an regulated power supply, the circuit of which is described. You can also use it to power the device.

So, the time has come to study microcontrollers, and then program them, and I also wanted to assemble devices on them, the circuits of which are now on the Internet in abundance. Well, we found a diagram, bought a controller, downloaded the firmware... and what should we use to flash it with??? And here a radio amateur who begins to master microcontrollers is faced with the question of choosing a programmer! I would like to find best option, in terms of versatility - simplicity of the circuit - reliability. “Branded” programmers and their analogues were immediately excluded due to quite complex circuit, which includes the same microcontrollers that need to be programmed. That is, it turns out to be a “vicious circle”: in order to make a programmer, you need a programmer. So the search and experiments began! In the beginning, the choice fell on PIC JDM. This programmer works from the com port and is powered from there. This option was tested, confidently programmed 4 out of 10 controllers, with a separate power supply the situation improved, but not much; on some computers it refused to do anything at all, and it does not provide protection from the “fool”. Next, the Pony-Prog programmer was studied. In principle, it’s almost the same as JDM. The “Pony-prog” programmer is a very simple circuit, powered from the computer’s com port, and therefore, on forums and on the Internet, questions about failures when programming it very often appear , or other microcontroller. As a result, the choice was made on the “Extra-PIC” model. I looked at the diagram - very simple, competent! At the input is MAX 232, which converts RS-232 serial port signals into signals suitable for use in digital circuits with TTL or CMOS levels, does not overload the computer's COM port with current, since it uses the RS232 operating standard, and does not pose a danger to the COM port .Here is the first plus!
Works with any COM ports, both standard (±12v; ±10v) and non-standard COM ports of some models of modern laptops that have reduced signal line voltages, up to ±5v - another plus! Supported by popular programs IC-PROG, PonyProg, WinPic 800 (WinPic800) and others - the third plus!
And it’s all powered by its own power source!
It was decided - we need to collect! So in the magazine Radio 2007 No. 8 a modified version of this programmer was found. It allowed programming microcontrollers in two modes.
There are two known ways to put PICmicro microcontrollers into programming mode:
1.With the supply voltage Vcc turned on, raise the voltage Vpp (at the -MCLR pin) from zero to 12V
2.With the Vcc voltage off, raise the Vpp voltage from zero to 12V, then turn on the Vcc voltage
The first mode is mainly for early development devices; it imposes restrictions on the configuration of the -MCLR output, which in this case can only serve as a signal input initial installation, and many microcontrollers provide the ability to turn this pin into a regular line of one of the ports. This is another plus of this programmer. Its diagram is shown below:

Larger
Everything was assembled on a breadboard and tested. Everything works perfectly and reliably, no glitches were noticed!
A signet was drawn for this programmer.
depositfiles.com/files/mk49uejin
everything was assembled into an open case, the photo of which is below.




The connecting cable was made independently from a piece of eight-core cable and standard Komov connectors, no null modems will work here, I warn you right away! You should be careful when assembling the cable; you will immediately get rid of headaches in the future. The cable length should be no more than one and a half meters.
Photo of the cable


So, the programmer is assembled, the cable is also assembled, it’s time to check all this equipment for functionality, look for glitches and errors.
First of all, we install the IC-prog program, which can be downloaded from the developer’s website www.ic-prog.com. Unpack the program into a separate directory. The resulting directory should contain three files:
icprog.exe - programmer shell file.
icprog.sys is a driver required to work under Windows NT, 2000, XP. This file must always be located in the program directory.
icprog.chm - Help file.
Installed, now we need to configure it.
To do this:
1.(Only for Windows XP): Right click Click on the icprog.exe file. “Properties” >> “Compatibility” tab >> Check the box for “Run this program in compatibility mode for:” >> select “Windows 2000”.
2.Run the icprog.exe file. Select “Settings” >> “Options” >> “Language” tab >> set the language to “Russian” and click “Ok”.
Agree with the statement “You need to restart IC-Prog now” (click “Ok”). The programmer shell will restart.
Settings" >> "Programmer

1.Check the settings, select the COM port you are using, click “Ok”.
2.Next, “Settings” >> “Options” >> select the “General” tab >> check the “On” item. NT/2000/XP driver" >> Click "Ok" >> if the driver has not been installed on your system before, click "Ok" in the "Confirm" window that appears. The driver will be installed and the programmer shell will restart.
Note:
For very “fast” computers, you may need to increase the “I/O Latency” parameter. Increasing this parameter increases the reliability of programming; however, the time spent on programming the chip also increases.
3. “Settings” >> “Options” >> select the “I2C” tab >> check the boxes: “Enable MCLR as VCC” and “Enable block recording.” Click “Ok”.
4. “Settings” >> “Options” >> select the “Programming” tab >> uncheck the item: “Check after programming” and check the box “Check during programming”. Click "Ok".
So it's set up!
Now we should test the programmer in a place with IC-prog. And here everything is simple:
Next, in the IC-PROG program, in the menu, run: Settings >> Programmer Test

Before performing each point of the testing methodology, do not forget to set all “fields” to their original position (all “checkboxes” are unchecked), as shown in the figure above.
1.Tick the “On” field. Data Output", in this case, a “tick” should appear in the “Data Input” field, and the log level should be set on the (DATA) contact of connector X2. “1” (at least +3.0 volts). Now, close the contact (DATA) and the contact (GND) of connector X2 with each other, and the mark in the “Data Input” field should disappear while the contacts are closed.
2.When checking the “On” field. Clocking" on the (CLOCK) pin of connector X2, the log level should be set. "1". (at least +3.0 volts).
3.When checking the “On” field Reset (MCLR)", on the contact (VPP) of connector X3, the level should be set to +13.0 ... +14.0 volts, and the D4 LED (usually red) should light up. If the mode switch is set to position 1, the HL3 LED will light up
If during testing, any signal does not pass through, you should carefully check the entire path of this signal, including the connection cable to the computer’s COM port.
Testing the data channel of the EXTRAPIC programmer:
1. Pin 13 of the DA1 chip: voltage from -5 to -12 volts. When checking the box: from +5 to +12 volts.
2. Pin 12 of the Da1 chip: voltage +5 volts. When checking the box: 0 volts.
3. Pin 6 of the DD1 chip: voltage 0 volts. When checking the box: +5 volts.
3. 1 and 2 pins of the DD1 microcircuit: voltage 0 volts. When checking the box: +5 volts.
4. Pin 3 of the DD1 chip: voltage +5 volts. When checking the box: 0 volts.
5. Pin 14 of the DA1 chip: voltage from -5 to -12 volts. When checking the box: from +5 to +12 volts.
If all testing was successful, the programmer is ready for use.
To connect the microcontroller to the programmer, you can use suitable sockets or make an adapter based on a ZIF socket (with zero pressing force), for example, like here radiokot.ru/circuit/digital/pcmod/18/.
Now a few words about ICSP - In-Circuit Programming
PIC controllers.
When using ICSP on the device board, it is necessary to provide the ability to connect a programmer. When programming using ICSP, 5 signal lines must be connected to the programmer:
1. GND (VSS) - common wire.
2. VDD (VCC) - plus supply voltage
3. MCLR" (VPP) - microcontroller reset input / programming voltage input
4. RB7 (DATA) - bidirectional data bus in programming mode
5. RB6 (CLOCK) Synchronization input in programming mode
The remaining microcontroller pins are not used in in-circuit programming mode.
Option for connecting ICSP to PIC16F84 microcontroller in DIP18 package:

1. “MCLR line” is decoupled from the device circuit by jumper J2, which opens in the in-circuit programming (ICSP) mode, transferring the MCLR pin to exclusive control of the programmer.
2. The VDD line in ICSP programming mode is disconnected from the device circuit by jumper J1. This is necessary to eliminate current consumption from the VDD line by the device circuit.
3.Line RB7 (bidirectional data bus in programming mode) is isolated in terms of current from the device circuit by resistor R1 with a nominal value of at least 1 kOhm. In this regard, the maximum inflow/outflow current provided by this line will be limited by resistor R1. If it is necessary to ensure maximum current, resistor R1 must be replaced (as in the case of VDD) with a jumper.
4. Line RB6 (PIC synchronization input in programming mode), like RB7, is isolated in terms of current from the device circuit by resistor R2, rated at least 1 kOhm. In this regard, the maximum inflow/drainage current provided by this line will be limited by resistor R2. If it is necessary to ensure maximum current, resistor R2 must be replaced (as in the case of VDD) with a jumper.
ICSP pin locations for PIC controllers:


This diagram is for reference only, it is better to check the programming conclusions from the microcontroller datasheet.
Now let's look at the microcontroller firmware in the IC-prog program. We will look at the example of the design from here rgb73.mylivepage.ru/wiki/1952/579
Here is the device diagram


here is the firmware
We are flashing the PIC12F629 controller. This microcontroller uses the osccal constant for its operation - it is a hexadecimal calibration value of the internal MC generator, with the help of which the MC reports the time when executing its programs, which is written in the last peak data cell. We connect this microcontroller to the programmer.
The screenshot below shows in red numbers the sequence of actions in the IC-prog program.


1. Select microcontroller type
2. Press the “Read microcircuit” button
In the “Program Code” window, in the very last cell there will be our constant for this controller. Each controller has its own constant ! Don't erase it, write it down on a piece of paper and stick it on the microcircuit!
Let's move on


3. Click the “Open file...” button and select our firmware. The firmware code will appear in the program code window.
4. We go down to the end of the code, right-click on the last cell and select “edit area” in the menu, enter the value of the constant that you wrote down in the “Hexadecimal” field, and click “OK”.
5. Click “program microcircuit”.
The programming process will begin; if everything was successful, the program will display a corresponding notification.
We take the chip out of the programmer and insert it into the assembled breadboard. Turn on the power. We press the start button. Hurray it works! Here is a video of the flasher working
video.mail.ru/mail/vanek_rabota/_myvideo/1.html
That's sorted out. But what to do if we have a file source code in asm assembler, but do we need a hex firmware file? A compiler is needed here. and it exists - this is Mplab, in this program you can both write firmware and compile it. Here is the compiler window


Installing Mplab
We find the MPASMWIN.exe program in the installed Mplab, usually located in the folder - Microchip - MPASM Suite - MPASMWIN.exe
Let's launch it. In the (4) Browse window we find our source code (1).asm, in the (5) Processor window we select our microcontroller, click Assemble and in the same folder where you specified the source code your firmware will appear.HEX That's all ready!
I hope this article will help beginners in mastering PIC controllers! Good luck!


This device is not particularly original, but it may be useful to someone. The idea is this: we have 3 inputs: foot, left and right turn signals, as well as two LED strips on the left and right of 8 LEDs each. When you press the brake pedal, both strips flash with different effects, complementing the main brake lights. When the right turn signal is turned on, a light runs along the right strip in time with it, if the left one is on, then along the left strip. When the emergency lights are on, all the LEDs in the matrix blink synchronously with the emergency lights.

Additionally, there is one more input - a “flashing light”. It has no special purpose, it was just a shame to throw the PIC leg in the air. When a 12V signal is applied to this input, all the matrix LEDs blink quickly, which can be used, for example, when turning on the reversing lights.

For proper operation The device LEDs should be positioned as shown in the figure above. The 1st diode in the diagram is the one closest to the device body, the 8th LED is the outermost LED on the line. The left and right rulers are designated accordingly.

This device can be placed behind the rear window of the car or on the spoiler. The LEDs must be red, of course! No setup of the device is required; it starts immediately. In standby mode, the current consumption is negligible, so it is absolutely not dangerous for the battery.









File:
Size:
Content:

mk_stop_2.rar
48.9 KB
PCB drawing (LAY) and microcontroller firmware file (HEX)

1 diagram
I suggest you repeat it schematic diagram lighting effects made on the basis of the popular Pic12f629 microcontroller. The circuit features 15 different lighting effects, including an effect that simulates a police flashing signal. To enlarge, click on the image.

This circuit is very easy to assemble and does not require adjustment. When you press the " Start" turns on automatic mode playback


Automatic playback mode is when all lighting effects are played one by one. To stop playing effects, press the "Start" button again.


When pressing the buttons " Forward" or " Back"When playback is stopped, the first effect will turn on and work continuously.


To switch the effect, press the " button Back" - to go to the previous light effect, " Forward" - to move to the next one.


The device is assembled on printed circuit board, drawing and firmware for the controller in the archive. The board also contains a simple 5V stabilizer to power the controller (it is not shown in the diagram). The case is a small plastic box. We choose the LEDs themselves of any type and color, suitable for voltage and current. We have them in any form - use your imagination here. And if you need to make effects for a disco based on this device, we simply amplify the outputs of the microcontroller with powerful ones field effect transistors type IRF. Author of the design: Pelekh.M
part 2
This article offers 2 LED effect circuits on microcontrollers PIC And AVR.

1) PIC12F629

There are 4 functions:

* Chaser MODE
*Brake MODE
*Chaser/Brake MODE
* OFF

Modes are switched by successively pressing the button.

2) Attiny2313

LED garland based on ATtiny231320PI microcontroller

This LED garland project on a microcontroller is well suited for beginners. The circuit is distinguished by its simplicity and contains a minimum of elements.

This device controls 13 LEDs connected to the microcontroller ports. An ATtiny231320PI microcontroller is used as a microcontroller. Thanks to the use of an internal oscillator, pins 4 and 5 are used as additional ports of the microcontroller PA0, PA1. The circuit provides the execution of 12 effect programs, 11 of which are individual combinations, and the 12th program is a sequential one-time repetition of previous effects. Switching to another program is done by pressing the SB1 button. Effect programs include running single fire, increasing fire, running shadow and much more.

The device has the ability to adjust the speed of changing combinations when executing a program, which is carried out by pressing the buttons: SB2 - increase speed and SB3 - decrease speed, provided that switch SA1 is in the "Program speed" position. It is also possible to adjust the frequency of LED lighting (from a stabilized glow until light flickering), which is carried out by pressing the buttons: SB2 - decrease (to flicker) and SB3 - increase, provided that switch SA1 is in the "Flicker frequency" position. For switch SA2, the closed position corresponds to the mode for adjusting the speed of program execution, and the open position corresponds to the mode for adjusting the frequency of LED lighting.
The numbering order of the LEDs in the circuit corresponds to their lighting order during program execution. If necessary, the RESET pin can be used for reset, but it is not used as the PA2 port. When programming, the device selected a clock frequency of 8 MHz from the internal oscillator (fuses CKSEL3..0 - 0100). Although it is possible to use a frequency of 4 MHz (fuses CKSEL3..0 - 0010) with corresponding changes in the time intervals of the circuit.
The type of LEDs indicated in the diagram was used in a prototype; any LEDs with a supply voltage of 2-3 volts are suitable for the circuit; resistors R1-R17 can be used to adjust the brightness of the LEDs.

PIC microcontrollers have Harvard architecture and are manufactured by Microchip Technology Inc. The name PIC is an abbreviation for the English phrase peripheral interface controllers - translated into the great and mighty “peripheral interface controllers”. PIC controllers under the Microchip brand produce 8-, 16- and 32-bit microcontrollers, as well as DSC digital signal controllers. PIC microcontrollers have the following significant advantages: good continuity of different families: full software compatibility and common development tools, including the free MPLAB IDE, common libraries, common stacks of popular transmission protocols, compatibility in peripherals, pins, and supply voltages. The range of controllers includes more than 500 various types with all sorts of peripheral options, different memory sizes, performance, number of pins, supply voltage ranges, operating temperatures, etc.


Let's consider the simplest controller of the PIC series PIC16C84 or PIC16F84.

The presence of FLASH memory allows you to reprogram it in a matter of seconds. The number of microcontroller rewrite cycles is 1000. Of its 18 pins, 13 can be used as input-output bits general purpose. When they are wired to the output, they allow a logic one level current of up to 20mA and a logic zero level current of up to 25mA (more than sufficient for connecting, for example, LEDs). This makes it possible to develop simple and cheap electronic devices and makes it an ideal candidate for those wishing to learn and understand the principles of working with a PIC microcontroller. The pinout of 8-bit microcontrollers is shown below:


Pins RA* and RB* are input and output associated with the controller registers PORTA and PORTB, respectively (pin RA4 can be used as an internal timer input, and RB0 can be used as an interrupt source). VDD and VSS - power supply (+Up and GND). The 16x84 series of microcontrollers operate over a wide voltage range, but typically VSS is connected to 0V and VDD to +5V. The main reset pin /MCLR is usually connected to VDD (directly or through a resistor), since the MCU contains a reliable reset circuit when the supply voltage is applied. Contacts OSC1 and OSC2 are connected to the generator clock frequency and can be configured for various types, including resonator and RC oscillator modes. Simple scheme, using PIC controller 16C84 is shown in the figure below:


The circuit, in addition to the microcircuit, only has an RC oscillator and one pin RB4 is connected to an LED. It comes with an amazingly short (6 words) program for MPASM in assembler - blinking an LED.

Type this code in any text editor, save it with the ASM extension (LIGHTS.ASM), then assemble it using the MPASM program (use the "MPASM LIGHTS.ASM" command) to obtain a HEX file that can be uploaded to the microcontroller using the programmer.

Once power is supplied to the circuit, the LED will flash.

Everything you need to know about the PIC16F628A microcontroller in order to successfully assemble amateur radio designs on it, a lot of reference documentation and interesting circuits.

So, we made up our minds and decided to assemble our first homemade product on a microcontroller, all that remains is to understand how to program it. Therefore, we will need a PIC programmer, and you can assemble its circuit yourself; let’s look at a few simple designs as an example.

This proprietary and free tool is an excellent development and debugging environment for all PIC microcontrollers manufactured by Microchip Technology. MPLAB consists of separate applications, but linked to each other and consists of an assembly language compiler, text editor, a controller firmware simulator. In addition, you can use a compiler with SI.

Presented to K. by the author technical information about software development tools based on PIC microcontrollers. The applications contain a collection of circuit diagrams and software solutions on PIC microcontrollers, standard interfaces are implemented. The book contains many examples of software implementation of a wide variety of functions: interrupt organization, extended arithmetic routines, floating point arithmetic, etc. To consolidate the theory in practice, simple devices are given, including an alarm clock and a multi-channel digital voltmeter.

Power supply and clocking of PIC microcontrollers
Application development. Which microcontroller should you choose?
Microcontroller interface circuit designs
Control of LEDs and optocouplers, relays, digital indicators, ADCs
Interaction with peripherals via serial interface
Unsigned multiplication of 8-bit numbers
Signed and unsigned multiplication of 16-bit numbers
Dividing, adding and subtracting 16-bit numbers
Floating point operations
Converting BCD to Binary
Ready-made circuit solutions: alarm clock, implementation of the i2ts interface, voltmeter with LED indication
Stepper motor control

What is a microcontroller and how does it work
PIC16F84A command system
What is a program and the rules for its preparation. An example of creating a program for a self-oscillating multivibrator. Directives.
Integrated design environment MPLAB IDE and work in it
Example of creating a program
Working in a simulator. Debugging the program
An example of program development with interrupts
Organizing a calculated transition.
Working with EEPROM data memory
How does a digital comparator work?
Cyclic shift. Multiplication operation
Introduction to the principle of constructing a dynamic display subroutine. Indirect addressing
Conversion binary numbers to binary decimal. Final formation of the text of the dynamic display subroutine
The principle of counting. Working with timer TMR0. The principle of installing groups of counting commands in the program text

All four books, in addition, all the sources of the described programs and other additional reference information have been added to the archive. In the archive you will also find the source codes of programs and controller firmware. Reference materials for all microcontrollers discussed in all four books (PIC12c67x PIC16c432 PIC16c433 PIC16c505 PIC16c54_58 PIC16c554_558 PIC16c620_622 PIC16c623_625 PIC16c62B_72A PIC16c63a_65b_73 b_74b PIC16c64x_66x PIC16c6x PIC16c717_77x PIC16C71xx PIC16c72 PIC16c72_77 PIC16c745_765 PIC16c77x PIC16c781_782 PIC16c92x PIC16F630_676 PIC16f7x 6f84a PIC16f85_86 PIC16F87xA PIC16hv540 PIC16Lc74b PIC17c4x PIC17c752_756 PIC17c7xx PIC17LC752P16 PIC18c601_801 PIC18cXX8)
Introduction to CAN 2.0 interface
CAN module in PIC microcontrollers
Software implementation of the I2C interface and a brief overview of it
KeeLoq chips with jumping code technology
Universal Serial Bus USB in PIC microcontrollers and software for working with USB
X-bit ADC modules in PIC microcontrollers
Recommendations for working with ADCs in PIC microcontrollers
As well as software for programming the PIC Microcontrollers IC-Prog and PonyProg2000 described in the books

Developers approach debugging issues differently. Some believe that it is enough to carefully analyze the source code of the program, check the formation of signals at the MK pins, and all errors can be corrected. Others use sets of special subroutines that are called at control points and provide information about the state of MK resources in a certain way (for example, by output to an indicator or serial communication channel). By the way, ICD (In-Circuit Debugger) technology, implemented in some MKs from Motorola and Microchip, is based on this. But with any of the above debugging methods, one significant problem arises - the need to reprogram the MK after making even minor changes to the program. This problem is especially relevant for once-programmable microcontrollers. True, in the latter case, debugging can be carried out, say, on a MK with FLASH memory, but still the time spent on programming is quite large and sometimes reaches several minutes. In addition, the MK, as a rule, needs to be removed from the circuit being debugged, connected to the programmer, and then inserted back. Those who have dealt with PC programming especially feel the difference. For example, when programming in the Borland C++ 3.1 (BC++) environment, to launch the program being debugged, just press the key combination Ctrl+F9, and after a few seconds it will already work (unless, of course, it contains errors). I would like to get a similar result when writing MK control programs. And this is possible thanks to the use of VSE, which is a software and hardware tool that can replace an emulated microcontroller in a real device, to which it is connected by a cable with a special emulation head. Using such an emulator is no different from using a real MK, except that the modified program is reloaded into the VSE almost instantly.

Lecture 1 - introductory

Microchip has long been known to domestic electronics engineers thanks to its widespread line of cheap 8-bit microcontrollers, which have found great application in various devices thermostats, small automation devices, sensors, etc. To keep up with its main competitors, Microchip introduced its new 32-bit microcontrollers of the PIC32 family to the electronic world in 2007.

The PIC32MX line includes huge amount devices from PIC32MX1** to PIC32MX7** with different amounts of memory (from 16 KB flash and 4096 bytes of RAM to 512 KB flash and 131 KB RAM), peripheral capabilities and package designs. In general, there are models for almost any application.

The full version of the lecture with a description of a typical MK connection and an example of its programming can be found here:

Lecture 2 - Microcontrollers of the PIC32 family. Working with timers.

With the help of timers, they implement time counting, organize interrupts, generate signals with pulse width modulation, etc. There are two types of timers in PIC-32 controllers - timers A (in fact, it seems like one - TMR1) and type B timers (TMR2, TMR3, TMR4, TMR5). All timers are 16-bit, clocked from an external or internal source and cause interrupts.

Lecture 3 - PIC32 microcontrollers - interrupts. This is any external or internal event that requires the controller to immediately respond to it. In this case, the execution of the current program code is temporarily completed, the microcontroller saves the values ​​of the service registers and enters the interrupt handler, then processes this interruption, and upon exiting it restores the service registers and again returns to the place where the code is executed.

Microchip PIC16 series MCUs are capable of performing simple arithmetic commands with 8-bit operands, since their core itself is 8-bit. But some projects require much more computing resources, so in such moments the use of a special library of arithmetic operations will come in handy. The library presented in the link above will allow you to multiply, divide, subtract and add 16-bit numbers, you can convert numbers into different forms, check parity, square a number and a bunch of other technical useful little things.