Infolinks

Friday, November 19, 2010

How to transmit I2C data to the slave IC?

Here is the example for you about sending I2C data into tuner as a slave.
 
Table below are write data format of I2C into the IC.
Figure 1. Write data format
Address byte (ADB) à address slave IC byte (write/read command)
Divider byte 1 dan 2 (DB1,2) à switching broadcasting frequency
Control byte 1 dan 2 (CB1,2) à slave IC setting for many think (see datasheet)
Band switch byte (BB) à band switching (VHF-L, VHF-H, UHF), charge pump, etc.
A à Acknowledge (information signal to the master for completing data receive and ready to receive next data)
 
Example:
In IC SN761668 (Texas Instrument)
Address byte : 11000010 (C2h) write command
Divider byte 1 : 00001011 (0Bh) freq. 474MHz, IF 36.167MHz
Divider byte 2 : 11110101 (F5h) Step size: 166.67kHz
Control byte 1 : 10010000 (90h)
Band Switch byte  : 11011000 (D8h) UHF band.
Control byte 2 : 11000010 (C2h)
 

I2C data are going to transmit have to be follow the sequence as a table above. There are different format in each slave IC type.
 
The communication data as like below approximation:

Figure 2. I2C data (example)
For the master IC program is up to you.
 
Need your feedback for wrong data communications.

Friday, November 12, 2010

What is I2C (Inter Integrated Circuit) ??

What is I2C which is mean Inter Integrated Circuit???. The meaning is a circuit integrate each other. I2C communication as minimum two devices, master and slave. An one of circuit integration, it's only one of master device, but the slave are can be more than two devices.
Many application that using I2C communication in a system. Connection data is only using two communication lines, it’s SDA and SCL. SDA is Serial Data Address and SCL is Serial Clock. Both lines is continuously each other.
Figure 1. I2C configuration
I try to explain as simply words of how I2C is working. Many kinds of explanation in the website. But it’s still makes confuse for they had never know what I2C is, where it used. I hope you can a bit understand how I2C data is transmit. My explanation is on I2C application in television tuner device.

IC Master is used to transmit information data of frequency and IC slave setting. And the IC slave is used to control the devices are connected. As like switching television channel broadcast, band frequency (VHF/ UHF) and anything else of IC setting needed.
 
A number of data are send to IC slave is 6 byte, 1 byte for Address byte, 2 bytes for frequency switching, 2 bytes for IC setting, 1 byte for switching band. It’s different in each device. You have to be read datasheet IC at first before controlling tha slaves.
As described by many sites, normal condition of SDA and SCL is high, it was supported by pull up circuit to make high logic in idle condition IC master.
 
 

Figure 2. Start and Stop condition
How to make start and stop signal condition? Here is the beginning.
Start signal is used to start sending data to the slave. Done with makes “0 on SDA at the SCL in “1” condition. And Stop signal is used for finish sending data to the slave. Can be done with makes “1” on SDA at the SCL in  1” condition. 
 
Another I2C signal is acknowledge signal as we know as ACK. This signal is on the last of  1 byte data sending from master. About who is the sender of this signal? After I browse in search engine world, the sender is IC slave. It mean after 1 byte (8 bit) data are received.

Figure 3. ACK and NACK signal condition

I2C data has a procedure are required set by international standardization.
As below:
Data transferred in idle condition data bus, another words is not busy line bus. In a data transfer process, Data condition is have to be stable on SDA signal as long as SCL condition is high “1”. Changing condition “1” to “0” or opposite on SDA is only can be changed as long as SCL in “0” condition. If  changing condition in SDA at the SCL is high “1”, so it’s assume as Start or Stop signal 
Figure 4. I2C bus data condition
SDA is send data to slave in every clock received.
 
Example of sending I2C data is going to describe In next post.
The application is for Television tuner IC.

Tuesday, November 2, 2010

What is Phase Locked Loop (PLL)??

Many kind of information of PLL (Phase Locked Loop) which is mean close circuit with locked by phase. Sometimes it’s a bit difficult of the meaning consume for non expert like us. I’d just understand what PLL is, how to work and application in the circuit after many years later. It cause of my brain is not really good for low accepting maybe. J
 
I try to share for a simple explanation about PLL. In order to you get a bit comprehension about  how and what for the PLL purpose. The block as like below.
 
Figure 1. PLL Block Diagram
X-Tal:
Works as signal reference for signal detector, usually use X-tal as reference frequency.
 
Reference Divider:
Divide oscillation reference from X-tal. The purpose is for divide oscillation signal with 128 / 80 / 64 / 50 / 28 / 24 divider. This block can be fixed to the one of the divider in the circuit.
 
Phase Detector:
This block would detect of different phase between two input and going to supply signal to Charge pump block. Phase detector output is going to 0 if the reference signal is same as feedback signal.
 
Charge Pump:
This block is working as like DC/DC converter. It works for increase and decrease signal level are received from phase detector. Signal produced are still in frequency signal.
 
LPF:
LPF (Low pass filter) is working to make a limitation of signal input. More high frequency received from charge pump, the output will down in level. And it’s use also for changing signal into direct current to the VCO. Because of VCO requirement is DC voltage.
 
VCO:
VCO is Voltage Controlled Oscillator. It means this block are works to produce frequency which is controlled by input voltage. Output frequency is proportional with the input.
 
Programmable divider:
The function of programmable divider is divide of frequency feedback from VCO which is continued to phase detector block. Divider system is programmable via data line as we call I2C. For more explanation of I2C, it would be discuss at next time. The purpose is  divider system can make output VCO is suit to the frequency as we want.
 
There are a very simple explanation about how PLL’s working. PLL block as usually used in tuning frequency in tuner system television.

Saturday, October 30, 2010

Make your own PCB (Printed circuit board)

So far, many people are confused about where to make the PCB. Because, We are don’t  know how and not confidence about the result. PCB manufacturing as like manual or screen printing system which they said a bit complicated and need some equipment and others. But, I want to share of how to make PCB as simple as like they thinking. The way is using glossy paper, as we call is photo paper. Because, We just need a glossy side of the paper. It’s for the ink are patched on the paper can be moved to the PCB. Some people said use gasoline, but I never tried that method, next time maybe I share another ways.
The equipment needed are not much. Photo paper (the cheap one), flat iron, aseton liquid, PCB of course. This method is used for simple circuit. When it’s complicated, actually we can make it, but we have to high accurate in ironing method.

Equipment needed:
- 1 pcs of flatiron
- 1 sheet PCB lember PCB which is cut as like the circuit shape.
- 1 bottle aseton liquid (you can get it in pharmacy).
- 1 sheet glossy/photo paper.
- 1 pcs PCB design layout.
- 1 pack fericlorite liquid (FeCl3) (etching liquid)

Figure 1. Layout example
First step:
Circuit design layout is very important at this step. You can use OrCad, PCB designer or another software as we know. For me, I use PADS software, easy to use this software. But the result is same. Define shape of PCB layout and match it with the PCB shape. Match of shape of course.
 


Figure 2. Four layout on one sheet


Second step:
Print the PCB layout on to typical sheet paper, Do not forget, use mirror condition at the layout printout, because it’s going to attach as mirror condition on the PCB sheet. If possible, printout some sheet and attach on the one sheet A4 size paper. It’s for reduce cost when a copy print. Example: attach 4 PCB layout in one sheet, it mean we are reduce of three sheet copy print. And we have backup layout when the process is fail. Need to remember, ask to the copier to use laser copy print and photo paper, it’s better if the copier is have the photo paper. So, you don’t have to be brought the paper or you can print out your self with laser printer. But the point is you have to be using photo paper.

Figure 3. Ironing Sumilation
Third step:
If it’s copied, the next step is more important. Dabs the PCB by water, cooper side only, make it medium humidity. After that, attach the PCB layout paper on the PCB cooper, layout image is on the cooper. Make the PCB and paper is not slide. When it’s attached, put it on the floor or carpet., ironing the PCB with the medium heat, about ¾ of heat level. Do it until the ink can see on the other side. Don’t to push when the ironing, it cause the pattern is going wide. Just relax. After finish it, don’t release the paper directly. Let the PCB’s into low temperature. Dip the PCB into the water, let it dip in a few minutes.

Fourth step:
Fade the paper out from the PCB, so, the paper is release easy and it will leave the ink on the cooper. Don’t scratch it hardly, can make the ink lifted. Just relax and don’t be hurry. Fade it until all apart. Clean the PCB from the leaved paper. The PCB is ready to the etching step.

Five step:
Prepare fericlorite liquid by adding warm water. Clean PCB layout is soaked in the liquid for fading out the unnecessary cooper. Shake the liquid until the cooper are fade. And will leave the pattern are coated by the ink. Be sure for etching is done and clean it by water. Clean the ink layer with aseton liquid by tissue or cotton. And the circuit will appears clearly.

Six step:
After the pattern are clear, you can start to drill for component hole and PCB are ready to use.

Additional step:
If you are going to add component layout, you can do as above. But not need fericlorite and aseton. Just ironing the component layout on to the other side without cooper. The function is leaving the ink on the PCB for component placement.

Monday, October 25, 2010

Making your own Training I/O module (LED, push button, and DIP switch)

On the previous discussion, We are try to make ourself mini downloader using computer parallel interface. This time we are try to make I/O module (Input/Output) for the previous downloader.

Figure 1. Module and Micro
Here is the illustrate.
It's simple ways, caused by very easy to get the component. I/O is going to make is 2 byte input and 2 byte output. Input are using 8 pcs push button, 8 pcs DIP switch, but the output are use 16 pcs LED. It's up to you about the LED colour, the important think is for display active signal from micro. 
Input and output is active low, which is, when the logic is low or zero, LED is going to glow. Confuse about that? don't be confused. The point is when the LED receiving signal zero volt, the LED is going to shine, so, the other LED pin is connected to positif voltage. and so as the input. Input signal to the micro are have to be grounded for giving the active signal.

Figure 2. LED and Switch module
Now, we try to make it. Component needed:
- 8 pcs LED Red 2.5mm
- 8 pcs LED Green 2.5mm
- 8 pcs push button
- 2 pcs DIP switch @4 switches
- 16 pcs resistor 300ohm
- 1 pcs terminal 40 pin
- 3 pcs resistor array 9 pin, 10Kohm
- 1 pcs housing 2 pin
This circuit are tried by me and connected to downloader in previous discussion. the result, it's not bad for programing LED and switches with microcontroller.


Figure 3. Switching circuit

Figure 4. Output circuit


Switching circuit:
On the figure 3, Switch are grounded for active low by adding resistor 10k ohm to the Vcc. The function is giving logic 1 or 5 volt to the micro when the button is not pushed. And it going to supply logic 0 or 0 volt when the button is pushed. Out line on figure 3 is direct to any port on micro. Build this circuit as many 8 pcs with using resistor 9 pin 10Kohm for siple circuit.

Output circuit:
On the figure 4, using LED can be applied directly from the IC, other ways are using pull up circuit on the IC output. For safety and avoid to unload the IC, We are going to use resistor as pull up on IC output. Using pull up is only on port 0 AT89S51, caused by port 0 iskarena keluaran port 0 is threshold. so have to be sure with pull up circuit, another port are unecessary pull up circuit, because it was include in the IC. Input of this circuit is connected to IC and the output is connected to LED, it's have to be resisted with 300 ohm for decreasing current to the LED. Maximum LED current is only 20mA. If it's over, the LED is going to broken.
 
Make the LED circuit as many 16 pcs with 1 pcs resistor array 9 pin as pull up. Pin anode LED is connect to Vcc. and pin LED cathode is connected to IC with series resistor 300 ohm.
Using housing 2 pin to connecting module and micro with Vcc 5 volt. VCC 5 volt is already connected in terminal 40 pin, so you don't need more cable. For the PCb, you can make your own PCB.

How to make a PCB? we are going to discuss it at next session. Cause of the simple ways.
Are we want to learn? it's on your self. Important think is " WILL". Thanks.