📜 ⬆️ ⬇️

Give me the iron! Part 1

Give me the iron!

Part 2

On Habré there are many articles devoted to the creation of cool self-made devices based on microcontrollers, take at least a wonderful series about an unusual gift ( 1 , 2 , 3 ) and addition about the touch keyboard . They evoke enthusiasm, encourage experimentation, but something like this arises: “And now, then, we draw a scheme, we dilute the board, we poison, we solder, we write the firmware, we fill it, and it's in the hat.” It was here that, as a coder, I never held a soldering iron in my hands, these very hands dropped, for all items except writing the firmware were not available.
')
But everything changes when desire overpowers laziness! In this article I will tell you where to start, to join the experiments with microcontrollers.

Under the cat a little less than a megabyte of images


A rock


First of all, you need to decide which microcontroller will be lucky to become a victim of our experiments. I’m still a minimalist in my heart, and therefore I wanted to start with a stone as simple as possible so that resources were limited, so that each byte had to be counted as in the good old days :) Therefore, I chose PIC controllers, which are remarkable for Harvard architecture and abbreviated command set (RISC) . Go to the manufacturer's website ( microchip.com ) and see what they are in general.

Digits

First of all, the stones are divided by bit. Guided by unhealthy minimalism, I chose 8-bit. They, in turn, are divided into families.

8-Bit PIC Controller Family

The larger the dial, the steeper the stone. Guided by the same minimalism, I bravely stuck into the youngest PIC10 series. Here we are already seeing the numbers of specific models. Pay attention to the letter that stands between the family name and the model number: either C or F. This letter indicates the type of memory of the microcontroller, C - write once, F - rewritable (flash). For experiments, of course, we need a stone with a rewritable memory.

However, my choice was somewhat broken off, having met with the harsh reality: the youngest stone, which was in the store - PIC12F509. So I will describe the experiments on it :)

Materiel


So, after we decided on a stone, what is needed? You need to read datasheet (pdf) to understand what we are going to deal with. By the way, besides datashit, there are many more fascinating readings on the site. It will also be very useful to refresh (or even acquire) knowledge of the basics of electronics, this can be done at easyelectronics.ru , there is even more fascinating reading :)

Programmer


A programmer is a device FROM A COLD HARD METAL !! 1 , which is needed to fill a program into a microcontroller. In the internet you can find a lot of schemes, but my goal was to get it as quickly as possible, and not to wave a soldering iron and fill up the forums with questions like “why it doesn’t work”. Therefore, I chose the most popular option: buy PICKit2. Details about it can be found on the site with an unpredictable name.

PICKit2

Here is a box, a lighter for scale. It is noteworthy that it works from USB, unlike many similar devices, which require a COM, or even an LPT port. Another plus is the ability to power the target device, no need to steam into a separate source. Included are disks with firewood and IDE (with the same success, everything can be downloaded from offsite), a USB cable and, depending on the configuration option, a demo card with an installed microcontroller. Nishtyachok is very tasty, but I preferred to leave it for future experiments, as the stone is older there.

Attention! There are 2 versions of PICKit2, differing in the color of the button: the old one has a black button, the new one has a red one. A device with a red button can be simply connected to a stone, and for a device with a black button you will need to additionally hang 2 resistors. To steam less, I recommend to take a device with a red button.

Yes, the price issue. Microchip sells them for 50 bucks. But they are there, and I am here in St. Petersburg. A lot of people deal with these devices, but someone only works with legal entities. persons, and someone is ready to deliver in 5-7 weeks. Remained retail stores. Chip and Dip - 3k, Mega Electronics - 2.5-2.7k. Maybe somewhere is cheaper, but I'm tired of looking, so I took in megaelectronics. inb4 lohanulsya

Crumbly


Resistors, capacitors, diodes, transistors. We read here . I didn’t have to waste time on trifles and took 10 pieces of each denomination, for experiments - for the eyes. So far, only 2 resistors (the largest ones) and 2 condenders (a large electrolyte and small ceramic) have come in handy.

LEDs. What are experiments without LEDs? I fell for the seller’s words that the BL-L513UBD LEDs can be hooked up to 5-volt leads without resistors. Yes, you can cling. But they are more suitable for burning their own retina than for indication. Ask the seller to pick up small-brightness LEDs and resistors for them to connect to 5 volts.

Bread board


The same ground, on which we will experiment. There are two types: for installation with soldering (looks like a printed circuit board) and without soldering (looks like a mattress with holes). I took an EIC-16020 in megaelectronics for something like 500 rubles. Consists of two pieces, which are connected by grooves. Pieces can be bought.

EIC-16020

The following photo shows how these boards are divorced inside:

The interior of the breadboard

For switching on this board will require wires. You can buy a set of jumpers for the price of 180 rubles for 10 wires, or you can just take a meter of a twisted pair - it fits perfectly.

Another problem: the connector programmer - holes. 6 items. And on the board holes. In an amicable way, you need to find a two-way DIP connector to connect the programmer. But I realized this only when I returned home, and therefore, without thinking twice, I cut the necessary out of paper clips. They are slightly thicker than required and entered with little effort.

Self made pins

On this, perhaps, I stop. I will continue to talk about what can be made up from all this, and how to breathe life into the monster that has been received. See you!

The end of the first part

Part 2

Source: https://habr.com/ru/post/112414/


All Articles