Microcontroller reverse engineer
Microcontroller reverse engineer
Everything they make, We can break! 
Disassembler Software   
World first mcu hack company
In business since 1998
Reversed tens of thousands of chips
Copied thousands of pcbs
Foreseen all pertential problems
Integrity with payments
crack ic
Microcontroller Beginners' Guide

Chapter 7


Part 19 - Making Convenient Connectors for Prototyping - Using Standard Headers

Using convenient connectors during the prototyping stage is key to getting dependable and predictable results very quickly. In the videos for this tutorial, I will show you how to make Do-It-Yourself connectors that are strong and very professional in appearance. I will use standard male headers to provide for the connection to the breadboard, and standard female headers consisting of a female housing and crimp pins. Making the female headers is not quite as "DIY" as is the construction of the male headers, but I use a standard needle nose pliers to do the crimping so there is a hint of DIY in the process.


Making a good male connector sturdy and functional:

The key to a sturdy connector male connector is to provide both a mechanical and a soldered connection. Yes, mechanics do come into play--even in the fine details of electronics. Simply put, the mechanical connection provides more surface area available to be soldered to the header pin. Since the short side of the header pin has very little protrusion, it is crucial to use a mechanical crimp to maximize the quality of the connection. To make this mechanical connection, we start by just stripping the insulation off a very small gauge wire (I'm using a flat cable in this case), somewhere around 24 or 26 gauge (or smaller). Now take the bare portion of the wire and wrap it around the lead, and this becomes the mechanical connection. Solder the wire and header pin together, and the connection is relatively permanent. In fact I dare you to separate the wire and lead! It's tough... If you are wondering what a non-mechanical connection would look like, just imagine the wire placed alongside the lead and the two soldered together. It might be prettier, but I promise that you will just about tear out your hair trying to get those two wires together!


Finally, it is advisable to cover the finished wire connections with shrink-tube to provide insulation from adjacent pins. This will be illustrated in the first of two videos that accompany this tutorial.


Making the Female Connector:

This is actually not much of a mystery, since we are using the standard method (except for the tool used). The parts involved are a small crimp pin (female), and a female connector housing of 2.54 mm (0.1 inch) pitch. Pitch is the distance from one pin to another, measured from the center of the pins. A needle-nose pliers is used for the crimping, as shown in the second video. I prefer to use the professional crimper, but they are expensive and the typical hobbyist might not have one laying around.



Part 20 - Using Potentiometers and Understanding Voltage Dividing

Are you looking for a good device to use when testing your Analog to Digital Converter (ADC)? Do you need a variable voltage source, rated between zero volts and the top voltage possible for your circuit? In this video, I'll show how these goals can be reached using a potentiometer. Basically a potentiometer is just a fancy voltage divider, but for the purposes of using them correctly in our circuits, a good understanding of these devices is required.


At its most basic level, a potentiometer is simply a resistor. To verify this you can simply measure the resistance across the two outer leads of a potentiometer with a multi-meter. (Remember to set it for ohms before you make the test though.) The multi-meter will read the total resistance at which the potentiometer is rated, or that for which it was designed. This resistance value will probably not be exact, but it should be very close. The thing that sets a potentiometer apart from a regular resistor however, is the fact that the resistance value can be changed by turning the knob attached to the wiper.


To demonstrate the variable nature of the potentiometer, try reading the resistance from the middle lead (wiper) to the either one of the outer leads. Notice that unless the potentiometer is exactly centered, you won't read the same resistance between the wiper lead and both outer leads. Note that the resistance across one side of the potentiometer will be a portion of the total resistance of the device. Don't move that knob!!Now test the middle lead to the opposite side lead and see what you get. You guessed it--the measurement will be the other portion of the total resistance! If you add those two values, you should get the total resistance of the potentiometer (the first reading you did, between the two outer leads).


Now you have a way to get any voltage that you might need for your system, by using a potentiometer. By grounding one of the two outer pins and applying the positive (+) voltage to the other outside pin, you can tune the potentiometer so that the desired voltage will be available on the middle pin. This will be between about zero volts (ground) and the maximum voltage supplied to the potentiometer from the system. You can also check this on the multi-meter as well--just put one test lead on "ground" and the other lead on the middle pin, and read the voltage across those two points.


Part 21 - Introduction to the Analog to Digital Converter

This is where we can start to sense the environment. Want to know tilt (Or G's, or acceleration)? Connect an accelerometer to the ADC! Want to know angular velocity? I've probably already lost you with that one (it's not a household word/phrase). Angular velocity is how fast you rotate something. Connect a gyro to the ADC! Want to know light intensity? Well, there are many ways (ambient, direct, etc.) to detect light, but we could conect a photo sensor, diode, or something like that to the ADC! Want to know distance? Connect a sonic range finder, IR sensor, or laser range finder to the ADC! The latter is probably a bit out of the pocket book range for us (like the pun? It was totally intended!).


The ADC is perfect for these sensors, and I didn't mention all of the different types of sensors. With the ADC, you can sense the environment (light, sound, distance, gravity, acceleration, rotation, smell, gasses, other particles and even feeling through pressure). Imagine all of the things you could do with all of these senses!!


In this video, we will investigate the function of the ADC (Analog to Digital Converter). There is this very real little lady inside the AVR microcontroller listening to you. She has this control panel and she makes transactions! She accepts voltage currency. This is the legal tender of her realm, and she likes all kinds of analog voltages! But she won't give you a voltage back, she will give you a number in return, which is the currency of her AVR country. BUT!! She is a bit dishonest! she will drop some change on "her" floor and you will get somewhere around what the exchange rate is. I know, I know, this is so unfair, but that is just the way it is!


You have the option of receiving less of her number currency, or more in her number currency. She can either ask for the 256 exchange rate, or the 1024 exchange rate. For instance, if you elect the 256 exchange rate and you give her 2.5 volts of voltge currency (with a top value of 5 volts), she will return to you 128 of her number currency. Here is where she gets a bit dishonest: if you gave her 2.5002643 volts, she will give you back the same 128 number curency. See? I told you, she is slick.


If you elect to use the 1024 currency exchange rate, then that 2.5 volts given to her will return the number currency of 512. Are you doing the math in your head? Yes, you are right, 512 is half of 1024, and 128 is half of 256, and yes, 2.5 is half of 5. you provide her any portion of the voltage currency and she will match the same proportion of her cnumber currency.


Part 22 - Writing Our First ADC Program - Reading the Potentiometer

Oh, by the way, sometimes she gives you MORE! That's right, she may make a mistake. It turns out, she is very sensitive to sound (noise). Mrs. ADC hates the cacophony created by the outside, and even within the King Core! Let me tell you, King Core is cacophonic!! He beats these drums all day, and doesn't let anyone rest, that is unless he is resting! Becuase of all this noise, she will most likely fumble her currency and give you more than you asked for. It's really bad when the environment poses a noisy reception of voltage currency (I'm talking about breadboardville).


In this video, see how I slap a potentiometer on the bread board and read its voltage division (the potentiometer is your agent of voltage currency. Don't expect Mr. Pot to do any currency laundering! That's your job. We will use a container called Mr. Cap to do this laundering. Mr. Cap (his full name is Mr. Capacitor) and he comes in many weights. The FAT Mr. Cap will do them most laundering and clean up that currency like you can't believe. The skinny Mr. Caps will not do such a good job, but the Caps in the middle are fairly good at laundering and are the ones I like to use. the Cap family use a weight in the form of Farads. The Farad is the measure of how fat they are. The higher the Farad, the fatter Mr. Cap is. Be warned! the fatter the Cap, the slower the laundering and flow of voltage currency!


I am heavy with the Atmega32 datasheet here, but do not fear! Hold my hand throughout this process and I promise, you will get through it with a comfort of the datasheet you never thought possible. When I say datasheet, I mean databook, no kidding, I printed it out a while back, and it's heavier than my most complete C++ book. Thank goodness there are a lot of figures and illustrations!



Part 23 - Getting the Full 10-bits from the ADC

This is where we UP the anty with Mrs. ADC. Do you have the faith? Do you think she will be able to handle that much cash?!? She's pretty stressed as it is! She is sensitive to sound, she's dishonest, and she makes mistakes all the time. Let's see how she does.


Actually, she wasn't that bad with the 256 currency exchange mode. But that's where it ends. The 10-bit 1024 exchange mode is a bit more of an issue with Mrs. ADC. She gets real nervous with that much currency! Noice from Breadboardville, Mr. Pot and King Core is making her crazy. There is cacophony all around her.


This time, Mr. Cap is really necessary! Fat Cap would do a good job, but Mr. Fat Cap is no match for the upheaval going on at Breadboardville. Breadboardville is a town with gusts of wind that can wash away rain voltage currency. If there are waves of this untamed currency in the air, Breadboardville is sure to pick it up. See the next chapter to see if Mr. Cap can launder his voltage currency well enough to overcome this turbulence! We will also meet Mr. Gravity! The tipsy fellow down the metal street.


So, how do we capture the 10-bit number currencies? We only need to look at another register. For the 8-bit number, we were looking at the ADCH (Analog to Digital Conversion Result High) and when the ADLAR in ADMUX is set, then the ADCL is left justified and the ADCL will contain a number between 0-256. When we get ADCL (Analog to Digital Conversion Result Low) involved, then we can capture the two extra bits that exist in the 10-bit number.


By using the ADCH for just receiving 0-255, we are essentially skipping every 4th number in the actual ADC. By including the ADCL, we are able to capture the extra 4 numbers in-between each of the ADCH numbers.


Please don't glaze over the following information!!! If you don't understand shifting operations (>> or <<), then this will really help you. Read it carefully!


First, we utilize a 16-bit variable to hold the 10-bit number (in the program, I call it "theTenBitResults"):

So, theTenbitResults starts off like this:

bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
With ADLAR = 1:

ADCL starts off with these bits (remember 2 bits have 4 possibilities 0, 1, 2 and 3):

bit1 bit0 ---- ---- ---- ---- ---- ----

Two of the 10 total bits.

And ADCH starts off with these bits (remember that 8 bits have 256 possibilities):

bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2

The remaining 8 of the total 10 bits.

Shifting ADCL to the right 6 places using this: ADCL >> 6, we would get:

---- ---- ---- ---- ---- ---- bit1 bit0

If by stating theTenBitResult |= ADCL >> 6; theTenbitResults would look like this:

---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- bit1 bit0

The ADCL is shifted to the right by 6 places (moving it all the way to the right)

Now we just need to get the ADCH into the theTenbitResults variable. All we need to do is make room for the two bits of the ADCL, so by shifting ADCH two places to the left and still applying the ADCL, we get: theTenBitResult |= ADCH << 2 | ADCL >> 6

---- ---- ---- ---- ---- ---- bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

And then Bob's your Uncle, if you like left adjusted stuff. Let see how to do it right adjusted.

Don't worry about the 6 un-used spaces in the 16-bit number. We really don't have any other options.

With ADLAR = 0:

ADCL starts off with these bits:

bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

Eight of the 10 total bits (the 8 low bits).

And ADCH starts off with these bits:

---- ---- ---- ---- ---- ---- bit9 bit8

The remaining 2 of the total 10 bits (the two high bits).

Shifting ADCH to the left 8 places using this: ADCH << 8, we would get:

bit9 bit8 ---- ---- ---- ---- ---- ---- ---- ----

If by stating theTenBitResult |= ADCH << 8; theTenbitResults would look like this:

---- ---- ---- ---- ---- ---- bit9 bit8 ---- ---- ---- ---- ---- ---- ---- ----

The ADCH is shifted to the ledft by 8 places top make room for the low 8 bits.

All we need to do now is to place the ADCL into the variable since the lower 8 bits would just naturally be set into the correct places: theTenBitResult |= ADCH << 8 | ADCL

---- ---- ---- ---- ---- ---- bit9 bit8 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

And there you go!

Lets see how this program may appear (I selected the latter of the two approaches with ADLAR = 0):

#include <avr/io.h>
#include <avr/interrupt.h>
#include "MrLCD.h"
int main(void)
Send_A_StringToMrLCDWithLocation(1,1,"ADC Result:");
ADMUX |= (1<<REFS0) | (1<<REFS1);



while (1)
uint8_t theLowADC = ADCL;
uint16_t theTenBitResults = ADCH<<8 | theLowADC;
Send_An_IntegerToMrLCD(13,1,theTenBitResults, 4);




Chapter 1 | Chapter 2 | Chapter 3 | Chapter 4 | Chapter 5 | Chapter 6 | Chapter 7 | Chapter 8 | Chapter 9



PCB Copying Service
PCB Projects Overview
PCB Clone
PCB Reverse Engineering
PCB Prototype
PCB Assembly Production
Mcu Hacking Service
Atmel Microcontroller Hack
Actel Mcu Attack
Altera Microcontroller Crack
Cygnal Mcu Unlock
Cypress IC Reverse Engineer
Elan Mcu Code Extract
Fujitsu Microprocessor Decryption
Freescale IC Code Extraction
Gould integrated circuit Hack
Hitachi Mcu Code Extract
Holtek Chip Reverse Engineer
Infineon Microcontroller Dump
Intel Mcu Read Code Protection
ICT Microcontroller Duplication
Lattice Microcontroller Clone
Microchip Source Code Recovery
Motorola Microcontroller Crack
Maxim Mcu Attack
MDT Controller Hack
Magawin Microcontroller Unlock
NEC Mcu Reverse Engineer
NTK Microcontroller Code Extract
Nuvoton Chip Decryption
NXP Semiconductor Code Extraction
Philips integrated circuit Crack
Renesas Microcontroller Dump
ST Processor Reverse Engineer
Silicon Labs Mcu Read Protection
Samsung Mcu Duplication
SST Mcu Clone
Sinowealth Source Code Recovery
SyncMOS Mcu Unlock
Sonix Mcu Read Source Code
STC Microprocessor Code Extract
Tenx Microcontroller Decryption
Texas Instuments MCU Hack
Winbond MCU Code Extraction
Xilinx integrated circuit Crack
Zilog MCU Reverse Engineer
More MCU brands we can reverse engineer below, please contact us if yours not listed here:
AMD Feeling LG / Hyundai Myson STK
ChipON Hynix Mitsubishi National Semi Temic
Coreriver ICSI Mosel Vitelic Portek Toshiba
Dallas ISSI MXIC SSSC Gal / Pal / Palce
Copyright © 2013 Mikatech. All rights reserved. Full dedicated reverse engineering company