Contacts

Principle of operation of a flashing beacon with a microcontroller PIC. The simplest scheme on the microcontroller. Examples of change of values \u200b\u200bin the memory of the microcontroller PIC12F629

So, it's time to study microcontrollers, and then program them, as well as I wanted to collect devices on them, whose schemes are now online, well, just the sea. Well, found the scheme, bought the controller, downloaded the firmware .... And to gem what ??? And here in front of a radio amateur, starting to master microcontrollers, the question arises - the choice of programmer! I would like to find optimal option, in terms of versatility - simplicity of the scheme - reliability. "Branded" programmers and their analogues were immediately excluded due to pretty complex schemewhich includes the same microcontrollers that need to be programmed. That is, it turns out a "closed circle": to make a programmer, a programmer is needed. So it began to search for and experiments! At the beginning, the choice fell on Pic JDM. This programmer works from the COM port and feeds from there. This option was tested, confidently programmed 4 out of 10 controllers, while nutrition improved the situation, but not much, on some computers, he generally refused to either do and the protection against "fool" in it is not provided. Then the programmer Pony-Prog was studied. In principle, almost the same as the JDM. The "Pony-Prog" programmer represents a very simple scheme, with meals from a computer computer, in connection with which, on the forums, on the Internet, questions are very often appear on failures in programming , or other microcontroller. As a result, the choice was stopped on the EXTRA-PIC model. I looked at the scheme - very simple, competently! The input is MAX 232 transforming RS-232 serial port signals to signals suitable for use in digital circuits With the levels of TTL or CMOS, the computer does not overload the COM port, as it uses the RS232 operating standard, it does not represent hazards for the COM port. The first plus!
It is operational with any COM ports, as standard (± 12V; ± 10V) and with non-standard COM ports of some models of modern laptops that have reduced voltages of signal lines, up to ± 5V - more plus! Supported by common IC-PROG programs, PonyProg, WinPic 800 (WinPIC800) and others - the third plus!
And it eats it all from its own power source!
It was decided - you need to collect! So the final version of this programmer was found in Radio 2007 No. 8. He allowed to program microcontrollers in two modes.
Two ways to translate Picmicro microcontrollers to programming mode are known:
1. Included VCC power voltage to raise VPP voltage (on -MCLR output) from zero to 12V
2. The VCC voltage is turned off to raise the VPP voltage from zero to 12V, then turn on the VCC voltage
The first mode is mainly for the instruments of early developments, it imposes restrictions on the configuration of the -MCLR output, which in this case can serve only in the input of the signal initial installationAnd in many microcontrollers there is an opportunity to turn this output into a normal line of one of the ports. This is another plus of this programmer. The scheme is shown below:

Larger
Everything was collected on the laypete and tested. Everything is perfect and stable, glitches have not been noticed!
Speaker was drawn for this programmer.
depositfiles.com/files/mk49uejin.
Everything was collected in the open case, the photo of which is lower.




The connecting cable was made independently of the segment of an eight cable and standard comedian times, no zero modem here will not hide, I warn you right away! The cable assembly should be taken carefully, immediately get rid of headaches in the future. The length of the cable should be no more than one and a half meters.
Photo of cable


So, the programmer is assembled, the cable, too, has arrived a turn of checking all this economy for performance, search for glitches and errors.
At first, we install the IC-PROG program, which can be downloaded on the developer website www.ic-prog.com, unpack the program to a separate directory. In the formation, the cathedral must be three files:
icprog.exe - programmer shell file.
icprog.sys - driver required for Windows NT, 2000, XP. This file must always be in the program directory.
ICPROG.CHM - help file (Help File).
Installed, now it would be necessary to configure it.
For this:
1. (Windows XP only): Right-click on the icprog.exe file. "Properties" \u003e\u003e Tab "Compatibility" \u003e\u003e Install the "tick" to "Run the program in compatibility mode with:" \u003e\u003e Select "Windows 2000".
2. Over the ICPROG.EXE file. Select "Settings" \u003e\u003e "Options" \u003e\u003e Top "Language" \u003e\u003e Install the "RUSSIAN" language and click OK.
Agree with the approval of "You Need to Restart IC-PROG NOW" (click OK). The programmer shell restarts.
Settings "\u003e\u003e" Programmer

1. Check the settings, select the COM port you use, click OK.
2. Dealer, "Settings" \u003e\u003e "Options" \u003e\u003e Select the General tab \u003e\u003e Set the "Tick" on the point "ON. NT / 2000 / XP Driver "\u003e\u003e Click" OK "\u003e\u003e If the driver has not previously been donated on your system, in the" Confirm "window that appears, click" OK ". The driver will be installed, and the programmer shell restarts.
Note:
For very "fast" computers, it is possible to increase the "I / O Delay" parameter. Increasing this parameter increases the reliability of programming, however, the time and time spent on the programming of the chip.
3. »Settings" \u003e\u003e "Options" \u003e\u003e Select the "I2C" tab \u003e\u003e Set the "Ticks" on the items: "Enable MCLR as a VCC" and "Enable Block Recording". Click OK.
4. "Settings" \u003e\u003e "Options" \u003e\u003e Select the "Programming" tab \u003e\u003e Remove the "tick" from the item: "Check after Programming" and set the "Tick" at the "Programming Check" item. Click OK.
So set up!
Now we would test the programmer in place with IC-Prog. And then everything is simple:
Next, in the IC-Prog program, in the menu, run: Settings \u003e\u003e Programmer Test

Before performing each item of the test method, do not forget to set all the "fields" to the original position (all "checkboxes" are removed), as shown in the figure above.
1. Install the "tick" in the "On Data output ", at the same time, the" Tick "field should appear in the" Login "field, and the Log Contact (DATA)) should be installed. "1" (at least +3.0 volts). Now, closer contact (DATA) and contact (GND) X2 connector, while the mark in the "Data input" field should disappear while contacts are closed.
2. When installing the "Talk" in the "On Tacting ", on the contact (clock) of the X2 connector, the level of the log must be installed. "one". (at least +3.0 volts).
3. Install the "Tick" setting in the "On Reset (MCLR) ", on contact (VPP) X3 connector, the level of + 13.0 ... +14.0 volt should be installed, and the LED d4 (usually red) is lit. if the mode switch is put in position 1, the HL3 LED will be lit.
If during testing, any signal does not pass, you should carefully check the entire path of the passage of this signal, including the connection cable with the computer COM port.
Testing the channel data channel ExtraPic:
1. 13 DA1 chip output: voltage from -5 to -12 volts. When installing the "tick": from +5 to +12 volts.
2. 12 DA1 chip output: Voltage +5 volts. When installing the "tick": 0 volt.
3. 6 DD1 chip output: Voltage 0 volt. When installing the "tick": +5 volts.
3. 1 and 2 DD1 chip output: Voltage 0 volt. When installing the "tick": +5 volts.
4. 3 DD1 chip output: Voltage +5 volts. When installing the "tick": 0 volt.
5. 14 DA1 chip output: voltage from -5 to -12 volts. When installing the "tick": from +5 to +12 volts.
If all testing has passed successfully, the programmer is ready for operation.
To connect a microcontroller to the programmer, you can use suitable panels or make an adapter based on ZIF panels (with zero plugging force), for example, as Radiokot.ru/circuit/digital/pcmod/18/.
Now a few words about ICSP - intrahemal programming
PIC controllers.
When using ICSP on the device board, you should envisage the programmer. When programming using ICSP, 5 signal lines must be connected to the programmer:
1. GND (VSS) - shared wire.
2. VDD (VCC) - plus supply voltage
3. MCLR "(VPP) - microcontroller reset / programming voltage input
4. RB7 (DATA) - bidirectional data bus in programming mode
5. RB6 (Clock) Synchronization Log in Programming
The remaining conclusions of the microcontroller are not used in the mode of intrahemid programming.
ICSP connection option to PIC16F84 microcontroller in the DIP18 housing:

1. The MCLR case is unleashed from the diagram of the jumper J2 device, which in the intrahemhemal programming mode (ICSP) opens, passing the MCLR output to the monopoly programmer.
2. The VDD in the ICSP programming mode is disconnected from the diagram of the jumper J1 device. This is necessary to eliminate current consumption from the VDD line of the device.
3. RB7 (bidirectional data bus in programming mode) is insulated by the current from the device diagram of the resistor R1 with a par value of at least 1 com. In this regard, the maximum flowing / flowing current provided by this line will be limited to the R1 resistor. If necessary, ensure maximum current, the R1 resistor must be replaced (as in the case of VDD) with a jumper.
4. RB6 decline (PIC synchronization in programming mode) as well as RB7 is inserted to the current from the device diagram R2, a par value of at least 1 com. In this regard, the maximum flowing / flowing current provided by this line will be limited to the R2 resistor. If necessary, ensure maximum current, the R2 resistor must be replaced (as in the case of VDD) with a jumper.
Location of ICSP outputs in PIC controllers:


This scheme is only for reference, programming conclusions are better to clarify from datashet to the microcontroller.
Now consider the microcontroller firmware in the IC-PROG program. We will consider on the example of the design here from here RGB73.Mylivepage.ru/wiki/1952/579
Here is a device scheme


Here is the firmware
We flash the PIC12F629 controller. This microcontroller uses an OSCCAL constant - represents a 16-type Calibration value of the internal MK generator, with which MK reports time when executing its programs that are recorded in the last cell of the peak data. We connect this microcontroller to the programmer.
Below on the screaming with red numbers shows a sequence of actions in the IC-PROG program.


1. Select the type of microcontroller
2. Press the "Contact Chip" button
In the "Program Code" window in the latest cell there will be our constant for this controller. For each constant controller its own ! Do not erase it, write down on a piece of paper and get it on the chip!
We go further


3. Click the "Open File ..." button, select our firmware. In the window software code The firmware code appears.
4. Go down to the end of the code, on the last cell click on the right mouse button and select the "Hex" field in the "Hex" field, enter the constant value, which is written, click "OK".
5. Click "Program the Chip".
The programming process will go, if everything went successfully, the program will display the appropriate notification.
I pull out a micrower from the programmer and insert into the collected layout. Turn on power. Press the start button. Here's video work flasher
video.mail.ru/mail/Vanek_rabota/_MyVideo/1..html.
It was understood. But what to do if we have the source code file on the ASM assembler, and we need a HEX firmware file? Here you need a compiler. And it is - it is MPLAB, in this program you can write firmware and compile. Here is a compiler window


Install MPLAB
Find in the MPLAB installed MPASMWIN.EXE program, is usually located in the folder - Microchip - MPASM Suite - MPasmwin.exe
Run it. In the window (4) browse find our source (1) .ASM, in the window (5) Processor, select our microcontroller, press the Assemble and in the same folder where you specified the source code will appear your firmware. HEX. And everything is ready!
I hope this article will help beginners in mastering PIC controllers! Good luck!


This device does not shine a special originality, but can come in handy. The idea is such, we have 3 entrances: foot, left and right turn signals, as well as two LED strips on the left and right 8 LEDs. When you click on the brake pedal - both strips blink with various effects, complementing the main stop lights. When I enabled, say the right turn signal - in the clock, the light runs on the right strip, if the left is turned on - then on the left strip. When the accident is turned on - all the LEDs are blinking in the matrix synchronously with the emergency.

Additionally, there is another entrance - "Flashing". He's no special purpose, it's just a sorry for the foot of the Pic to throw in the air. When the 12V signal is filled with this input, all matrix LEDs flash quickly, you can apply for example when the reverse lamp is turned on.

For proper work LED devices must be arranged as shown in the figure above. The 1st diode according to the scheme is the closest to the device body, the 8th SD is the extreme LED on the line. Accordingly, the left and right rules are indicated.

This device can be placed for rear glass Car or on a spoiler. LEDs, of course, should be red! No setup device is required, it starts immediately. In waiting mode, the current consumption is negligible, so it is absolutely not scary for the battery.









File:
The size:
Content:

mk_stop_2.rar
48.9 KB
Picture pCB (Lay) and microcontroller firmware file (Hex)

This scheme is a simple lED stroboscopebuilt on microcontroller Pic12F629. In the stroboscope there are 4 jumpers with which you can select one of the options for the LED.

There are the following modes: the interval between the pulse (30 ms and 10 ms), the frequency of repetitions (1, 2, 3 and 4 seconds), the creation of single or double flashes.

Since the output of the microcontroller PIC12F629 is able to withstand the maximum load in the area of \u200b\u200b25 mA, the transistor can unload the output of the microcontroller and increase the current passing through the LED into the strobe circuit. This transistor has a maximum current collector 100 mA, sufficient to power most types of 5 mm LEDs.

The R4 resistor performs the role of the current limiter for the LED. When nutrition of a strobe in 5 volts and a drop in the voltage on the LED at 1.8 volt, the current flowing through the LED is limited to 47 mA.

The input voltage should not exceed 5 volts. The LED strobe circuit is capable of working at 3 volts, but it will be necessary to reduce the resistance of the resistor R4. It should be taken into account when calculating the R4 resistor that some LEDs create a voltage drop to 3 volts, in particular a white LED and some blue and green LEDs.

Pulse duration, interval and stroboscope mode can be selected by the user using the jumper unit. As mentioned above, two modes were implemented in the diagram: single outbreaks and double (pause between double flashes is 175 ms).

The interval between the flash series is measured from the end of a single group pulse before the next group.

Select the mode of operation of the LED strobe

The time of the pulse duration, the interval and the double mode is configured by editing the value in the EEPROM microcontroller Pic12F629, before its firmware. It greatly simplifies editing values \u200b\u200bbecause it is not necessary to re-compile source programs. Just need to flash HEX in memory of the microcontroller.

Examples of change of values \u200b\u200bin the memory of the microcontroller PIC12F629

Change the duration of the outbreak. Suppose you want to get the duration of the flash pulse (instead of 30 ms by default) 40 ms. Then the value you want to write in EEPROM is defined as follows: 40 ms / 1 ms \u003d 40. Now we will transfer 40 to the hexadecimal system, we get 28, which you need to write to 00 address EEPROM.

Calculate the change in the interval between double flashes by 0.2 seconds (instead of 175 ms by default). For this, 200 ms / 1 ms \u003d 200. We translate into the hexadecimal system to obtain C8 which is recorded in the address 02.

To change the interval between the flash series by 1.3 seconds (instead of 1 sec by default), you need to do the following: 1.3 seconds / 100 ms \u003d 13. We translate into a hexadecimal type of 0D. This value is prescribed to 03 EEPROM.

It should be noted that 255 is the maximum value that can be prescribed into one memory address.

The easiest way to translate the number of decimal in the hexadecimal system (for example, the number 40) is in Google.com search engine type: 40 to hex. We will get the answer: 0x28. Prefix 0x as a result simply indicates us that the value is given in the hexadecimal system.

In the strobe circuit, you can apply a microcontroller both Pic12F629 and Pic12F675.

Modification of the LED strobe scheme (ABC Morse - SOS)

This is a modified stroboscope version that allows Morse in the Morse system to organize light gear sOS signal. The length of the point can be installed in one of the four periods, and the time between the two sequences 'SOS' can also be adjusted.

PIC microcontrollers, possess Harvard architecture and produced by Microchip Technology Inc. The PIC name is a reduction from the English phrase of Peripheral Interface Controllers -to transfer to the Great and Mighty "Peripheral Interface Controllers". PIC Controllers under the Microchip brand produce 8-, 16- and 32-bit microcontrollers, as well as digital DSC signal controllers. PIC microcontrollers have the following significant advantages: good continuity of different families: full software compatibility and general development tools, including a free IDE MPLAB environment, general libraries, common stacks of popular transmission protocols, compatibility on the periphery, outputs, feeding voltages. Nomenclature of controllers has more than 500 different species with all sorts of peripherals, various sizes Memory, productivity, number of conclusions, ranges of supply voltages, operating temperatures, etc.


Consider the easiest controller series PIC16C84 or PIC16F84.

The presence of Flash memory allows you to reprogram it in seconds. Number of 1000 microcontroller overwriting cycles. From its 18 conclusions 13, it is possible to be used as input discharges - output of general purpose. When they are stitched on withdrawal, then the current level of the logical unit "1" to 20 mA and the current level of the logical zero "0" to 25mA (more than sufficient to connect, for example, LEDs). It makes it possible to develop simple and cheap on this controller. electronic devices And makes it an ideal candidate for those who want to explore and understand the principles of working with the PIC microcontroller. Codovka conclusions 8 bit microcontrollers are shown below:


Contacts Ra * and Rb * - This is an input and output associated with the registers of the Porta and PortB controller, respectively (RA4 output can be used as an internal timer input, and RB0 is used as an interrupt source). VDD and VSS - Power (+ Upit and GND). The 16x84 microcontroller series operates in a wide voltage interval, but usually VSS is connected to 0 V, and VDD - + 5V. The output of the main reset / MCLR is usually connected to VDD (directly or via resistance), because MK contains a reliable discharge scheme when feeding the supply voltage. Contacts OSC1 and OSC2 are connected to the generator clock frequency and can be configured for different types of it, including the resonator and RC generator modes. A simple scheme, using the PIC 16C84 controller is presented in the figure below:


The scheme except the chip has only an RC generator and one RB4 output is connected to the LED. It has amazingly short (out of 6 words) program for MPASM on the Asembler - the blinking of the LED.

Dial this code in any text editor, save with the ASM extension (lights.asm), then proassembly using MPASM (use the MPASM Lights.asm command) to get a HEX file that can be pouring using a programmer to a microcontroller.

After feeding the power to the scheme, the LED will flash.

what you need to know about the microcontroller PIC16F628A to successfully collect radio amateur structures On it, a lot of reference documentation and interesting schemes.

So, we decided and decided to collect our first homemade on the microcontroller, it remains to be only understood how to program it. Therefore, we will need pIC programmer, and you can collect it with your own hands, consider for example a few simple designs.

This branded and free UTITA is an excellent program for developing and debugging programs for all microcontrollers of the PIC family produced by Microchip TECHNOLOGY. MPLAB consists of individual applications, but connected with each other and consists of a compiler from the assembler, text editor, simulator operation of the controller firmware, in addition, you can use the CA compiler.

The author Tavernier K. was presented technical information On software development software based on PIC-microcontrollers. Applications have a collection of circuit and software solutions On PIC microcontrollers, typical interfaces are implemented. A lot of examples of the software implementation of a variety of functions are painted in the book: Organization of interrupts, subprogrammes of extended arithmetic, floating point arithmetic, etc. To secure the theory in practice, simple devices are given, including a clock-alarm clock and a multichannel digital voltmeter.

Power and clocking PIC microcontrollers
Application Development. What microcontroller you need to choose
Circuit solutions of microcontrollers interfaces
Control of LEDs and optocouplers, relays, digital administrators, ADC
Interaction with the periphery on the serial interface
Unstable multiplication of 8-bit numbers
Signal and unsigned multiplication of 16-bit numbers
Division, addition and subtraction of 16-risks
Floating
Transformation of binary-decimal codes in binary
Ready-made schematic solutions: an alarm clock, the implementation of the I2C, I2C, voltmeter with LED indication
Management of stepper motors

What is a microcontroller and how it works
PIC16F84A command system system
What is the program and the rules for its preparation. An example of creating an auto-oscillatory multivibrator program. Directives.
Integrated MPLAB IDE design and work in it
An example of creating a program
Work in the simulator. Debugging programs
An example of the development of a program with interruption
Organization of the calculated transition.
Working with EEPROM data memory
How does a digital comparator work
Cyclic shift. Multiplication operation
Introduction to the principle of building a dynamic indication subroutine. Indirect addressing
Transformation of binary numbers into binary-decimal. Final formation of the text of the dynamic indication subroutine
The principle of the account. Work with TMR0 timer. The principle of installing groups of accounts in the text of the program

All four books, in addition, all sources of the described programs are added to the archive and another additional reference Information. In the archive you will also find the source texts of the programs and the "firmware" of the controller. Reference materials on all microcontrollers discussed in all four books (PIC12c67x PIC16c432 PIC16c433 PIC16c505 PIC16c54_58 PIC16c554_558 PIC16c620_622 PIC16c623_625 PIC16c62B_72A PIC16c63a_65b_73b_74b PIC16c64x_66x PIC16c6x PIC16c717_77x PIC16C71xx PIC16c72 PIC16c72_77 PIC16c745_765 PIC16c77x PIC16c781_782 PIC16c92x PIC16F630_676 PIC16f7x PIC16f84a PIC16f85_86 PIC16F87xA PIC16hv540 PIC16Lc74b PIC17c4x PIC17c752_756 PIC17c7xx PIC17LC752P16 PIC18c601_801 PIC18cXX8)
Introduction to CAN 2.0 Interface
CAN module in PIC microcontrollers
I2C software interface and brief overview
Keeloq chips with jumping code technology
Universal sequential tire USB in PIC microcontrollers and USB software software
Modules of the X-discharge ADC in microcontrollers PIC
Recommendations for working with ADC in PIC microcontrollers
As well as software for programming described in the books of PIC microcontrollers IC-PROG and PONYPROG2000

Debug questions developers are different. Some believe that it is enough to carefully analyze the source text of the program, check the generation of signals on the MK outputs, and you can correct all errors. Others use the sets of special subroutines that are called at the control points and are issued in a certain way (for example, an indicator output or a serial communication channel) information about the status of MK resources. By the way, ICD technology is based on this (in-circuit debugger - intrahemnaya debugging), implemented in some MK Motorola and Microchip. But with any of the above debugging methods, one significant problem arises - the need to reprogram the MK after entering the program even minor changes. This problem is especially relevant for once programmable MK. True, in the latter case, the debugging can be done, say, on the MK with Flash memory, but still the time spent on programming is large enough and sometimes reaches a few minutes. In addition, MK, as a rule, need to be removed from the diagram, connect to the programmer, and then insert back. Those who dealt with Programming on PCs especially feel the difference. For example, when programming in Borland C ++ 3.1 (BC ++), it suffices to start a Ctrl + F9 key combination, and after a few seconds it will already work (unless otherwise contains errors). I would like to get a similar result and when writing control programs MK. And this is possible due to the use of ALW, which is a software and hardware that can be replaced by an emulated MK in real deviceWith which it is connected by a cable with a special emulation head. The use of such an emulator does not differ from the use of a real MC, except that the modified program is rebooted in the ALW almost instantly.

Lecture 1 - Introductory

MicroChip has long been known for domestic electronics due to the widespread line of cheap 8-bit microcontrollers who have found huge use in various devices Temperature regulators, low automation devices, sensors, etc. In order to keep up with its main competitors, Microchip presented its new 32-bit microcontrollers of the PIC32 family in 2007.

In the PIC32MX line great 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 body execution. In general, there are practical models for any application.

The full version of the lecture with the description of the Model connection of the MK and the example of its programming can be taken here:

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

Using timers, the countdown is implemented, organize interrupts, form signals with pulse modulation, etc. In PIC-32 controllers, there are two types of timers - timers A (in fact, it seems like one - TMR1) and timers of type B (TMR2, TMR3, TMR4, TMR5). All timers are 16-bit, clock from an external or internal source and cause interrupts.

Lecture 3 - microcontrollers PIC32 - interrupts. It is an external or internal event that requires an immediate response to it from the controller. In this case, the execution of the current program code is completed, the MK saves the values \u200b\u200bof the service registers and is included in the interrupt handler, then processes this interrupt, and it restores the service registers to the output from it and returns to the location of the code.

MK Series Pic16 firms Microchip are able to perform simple arithmetic teams with 8-bit operands, because their kernel itself is 8-bit. But in some projects you need much more computational resourcesTherefore, at such moments it is useful to use a special library of arithmetic operations. Presented, on the link above the library will allow you to multiply, division, subtraction and addition of 16-bit numbers, you can convert numbers in different forms, Check parity, build a number in a square and another technical handful of useful trifles.

On New Year's holidays, and not only, there is a great need for light illumination.

This device can be called differently: a mood lamp, a RGB lamp, a new year lamp, a LED beacon, etc. How to use it - will tell fantasy.

Here is a diagram of a multicolor RGB lamp on a Pic12F629 microcontroller (or Pic12F675). To enlarge click on the image.

Appearance of the collected RGB lamp.

Video operation of the lamp in the Mood Lamp mode (Mood Lamp).

The scheme of the proposed device is quite simple, but has a multitude of operating modes. Here are just some of them:

    Slow color change. Green, red and blue glow of different intensity is mixed, which allows you to get a smooth overworked of the rainbow colors;

    Fast alternate blinking red, green and blue;

    Smooth increase in white luminescence and then 4 flashes. Then there is a repetition of the cycle;

    Eldly sharp flarellation and slow attenuation of basic colors (blue, red, green). After the cycle is repeated.

    Smooth glow red;

    Smooth glow blue;

    Smooth glow green;

    Blinking blue;

    Accelerated color change;

    Smooth white glow;

    Smooth white glow with reduced brightness;

    Smooth white glow with minimal brightness;

    Smooth glow purple (red + blue);

    Smooth luminess orange (red + green).

These are the main modes of operation of the lamp. All others are options for smooth change of rainbow colors at different speeds.

To appreciate the entire rich palette of the modes and the performance of the device, it is better to first collect it on an invoko dummy. So-called "Breadboard" (Breadboard).

In order for the glow from different LEDs mixed and formed a smooth color shade, the LEDs need to be placed as closer to each other. Also, after making the scheme, you can take a white sheet of A4 format, roll it into the cylinder and fasten on the sides of the clips. The resulting paper cylinder is installed on an insane dummy - close the LEDs. As a result, we will have a kind of matte plander. That's what it can work out.

The microcontroller before sealing in the fee you need to "flash". About how to do it, I already talked on the pages of the site. What to flash - a separate question. If there is nothing, then you first need to collect your own USB microcontroller programmer PIC or buy ready. He is more useful yet.

During the firmware PIC12F629 or PIC12F675, you need to pay attention to the calibration constant. It will not be superfluous to count first ( "READ") Data from a pure microcontroller and write a constant value somewhere on the paper. After the firmware of the microcontroller, you need to check whether the value of the constant in the cell 0x3FF. Earlier values. If it is different, then change the constant. About what a calibration constant is already told.

List of necessary radio components for assembling RGB lamp.

Name Designation Parameters / Nominal Brand or type of element
Microcontroller DD1. 8-bit microcontroller PIC12F629 or PIC12F675
Integral stabilizer DA1 5 volt output voltage 78L05, MC78L05ACP (any analog)
Mosfet transistors VT1 - VT3. - 2n7000 or KP501A ( Attention! KP501A is another bond!)
Semiconductor diode VD1. (not required) 1N4148, 1N4007 or analog
LEDs HL1 - HL4. red Colors of glow any bright diameter of 5 mm.
HL5 - HL7 green Colors of glow
HL8 - HL10 saint Colors of glow
Resistors R1 120 Oh. MLT, MON (dispersion power - 0.125 W)
R2, R3 68 Oh.
Condencators C2. 220 NF (0.22 μF) Ceramic multi-layered or any analogues
C3. 100 NF (0.1 μF)
Electrolytic condenser C1. 47 μF * 16 volts any aluminum (K50-35 or foreign analogues)
Button SB1 - any clock button (for example, Kan0610-0731b)
Jumper J1. (not installed) -

After powering, the device starts to work immediately. By pressing the SB1 button, you can switch the operation mode of the RGB lamp. The button can be pressed at least to infinity - the switching of the modes occurs in a circle.

The printed circuit board is easy to make using a marker for boards. So I did. If there is no marker for the boards, then you can apply a "pencil" method or a cont. Know how to make fees Lout'om - even better.

Well, if there is nothing of the listed, but I really want to make a homemade, then instead of a fiberglass, you can use a thick cardboard, a piece of thin plastic or plywood. In general, all that can be installed on the installation scheme. Compounds can be performed with copper wire on the reverse side of the base.

Now such a council will seem wildness, but when I was just started to engage in electronics, I tried all kinds of installation methods. In those near times, consumables and details bought on the radio rolls, which were only in major cities. We could only dream of online radio components.

Explanation of the scheme.

Transistors 2N7000 can be replaced by KP501A. But it is worth considering that KP501A another basement! This is.

A protective diode VD1 can not be saved into the scheme. It serves to protect the scheme with incorrect power connections - cords. If such protection is not needed, the VD1 diode is also not needed.

Resistors can be selected with rates close to the indicated in the diagram (standard permissible deviation ± 20%). For example, I installed R1 at 130 ohms, and R2, R3 - 82 ohms.

To power the scheme, a stabilized power supply with a 12 volt output voltage will be required. It is suitable, for example, an adjustable power supply, the diagram of which is described. Also to power the device can be used



Did you like the article? Share it