Sunday, July 29, 2012

Control Dual Digital Voltmeter Circuit Using PICXXX


This is a circuit for digital voltmeter that can use for two channel. This thermometer is a simple thermometer using DS1820 thermal probes that have a tolerance within 0.5°C. This is the figure of the circuit;


The three holes seen to the left of the 14pin SIP are for a potentiometer if the display you use requires a contrast control. My display did not have this function so I did not have to put a potentiometer on it. However all the connections are there, so if you need a pot for your display one just needs to be soldered in. This circuit is the display running with probe 1 sitting next to it monitoring ambient house temperature, and the second probe left in the fridge for a couple minutes.
read more "Control Dual Digital Voltmeter Circuit Using PICXXX"

Control Digital Clock Timer Circuit


This is circuit for clock timer uses a PIC16F628 microcontroller to display digital time and control an external load. Timer output duration can be programmed from 1 to 59 minutes and can be manually switched on and off. This is the figure of complete circuit;


The clock has a correction feature that allows an additional second to be added every so many hours to compensate for a slightly slow running oscillator. The oscillator uses a common 32.768 KHz watch crystal and the frequency can be adjusted slightly with the 24pF capacitor on the right side of the crystal. The clock will also adjust itself for daylight savings time and add or subtract an hour on the first Sunday in April and last Sunday in October. The daylight savings feature is disabled at boot up and needs to be enabled after turn on.  

Setting the time of day and other features is done with 3 momentary single pole, double throw switches and one non-momentary single pole, double throw. The switch functions are shown in the chart below with the letters A-H indicating the switch combination for each function. Some entries can be made with one momentary switch closure while others require toggling 2 switches at the same time.
read more "Control Digital Clock Timer Circuit"

Control Color BAR Generator Circuit Using AT90SXX


This is a design circuit for color BAR generator circuit. The circuit (see Color bar Schematic.jpg)it is constituted by AT90s2313 running at 17.734475 MHz (over clocked) and one, 5 bits DA converter (R2R-ladder) with 10 resistors. This is the figure of the circuit;


Program the MCU with colour_bar_gen.hex that its included in colour_bar_gen.zip file, connect it on composite video connector (or scart adapter) of your TV, power-on the circuit and you will see on TV, 6 vertical bars, 4 in color, 1 white and 1 black.

Partlist
1 x AT90s2313
1 x 17.734475Mhz crystal
2 x 22 pF condensator
6 x 1 kOhm resistor
4 x 500 Ohm resistor
read more "Control Color BAR Generator Circuit Using AT90SXX"

Saturday, July 28, 2012

Control Light Chaser Circuit Using Microcontroller


This is a simple form for light chaser circuit. This circuit is control using microcontroller. This is the figure of the circuit;


The circuit this month is a simple 8 light chaser built around a PIC. This will demonstrate how easy it is to program a PIC and to utilize it in a circuit. The circuit works as follows. When power is supplied to the circuit the PIC resets and starts to process instructions that are programmed into it. The program will turn on each LED in sequence with a small delay between each one. It will continue to do this until power is removed. The nice feature with this circuit is that you can program it to perform many complex lighting sequences. Normally you would have to rebuild a hardware based circuit to change the light sequence. With a PIC all you need to do is reprogram it and plug it back into the circuit. I am assuming that you will be using an IC socket. The circuit is show below and then I will discuss the program that is programmed into the PIC.
read more "Control Light Chaser Circuit Using Microcontroller"

Control Milli gause Meter Circuit


This circuit is provide an easy yet reliable way to detect the intensity of a.c. (or e.l.f.) fields around the home or workplace. It is doubly effective because it does not merely detect the electromagnetic radiation emitted by electrical appliances, but the electromagnetic energy actually absorbed by the body. This is the figure of the circuit;



The circuit in is a standard charge pump which is charged by the alternating eddy currents induced in the human body by a.c. fields. C1 charges virtually instantly, and is read by a digital (or high impedance) voltmeter. To obtain a very rough translation from milli volts to milli gauss (the unit of magnetic field strength), divide the milli volts reading by four. For example, 1000mV will yield 250 milli gauss.
read more "Control Milli gause Meter Circuit"

Friday, July 27, 2012

Control Simple VGA Adapter Circuit


This is a design circuit for vga adapter. This circuit have some characteristic. This is the figure of the circuit;


Initial calculations showed that the the AVR 8-bit microcontroller from ATMEL, with its 16Mhz clock speed providing approximately 16 MIPS was a good candidate for further research. Also note that newer AVRs such as the Mega48, Mega88 and Mega168 will officially support clock rates upto 20 Mhz. Therefore I concluded that with a clock of 16 Mhz I could achieve something in the order of 8 Mhz speed of data being transferred out of a port. I also chose the AVR as I had already built up quite a body of experience with it and so I began work of the project. To avoid distortion of the image, when receiving data through the UART, for VGA, it is recommended to make the data exchange with the terminal in approximately 300-600 us after a signal of vertical synchronization (VSYNC). The available internal RAM of the Mega8535 (only 512 bytes) is not enough for the formation of a Video signal with a resolution of 38x20 symbols.
read more "Control Simple VGA Adapter Circuit"

Schematic PIC Data Logger with Delta-Sigma Converter

The aim of the project is to build a lab-grade data logger with PIC18F45K20 microcontroller and a 20-bit delta-sigma converter. It's named as G5 Data Logger.



This new data converter technology using delta-sigma simplifies the design of high resolution data recording device. One of the interesting chip is Linear Technology LTC2400, 24-bit ADC. Another chip of interest is LTC2420, 20-bit ADC. The chip has pin and data output compatible to the LTC2400. This project uses new data logger using the LTC2420 and use the cheap memory card for data storage.

DownloadSchematic, Firmware, Quick start, Brochure, Sample record of TMP36

read more "Schematic PIC Data Logger with Delta-Sigma Converter"

Thursday, July 26, 2012

Schematic Photovoltaic Solar Battery Regulator and Load Controller

This Solar Battery Regulator project allows solar cell arrays to be connected to either conventional lead-acid, sealed lead-acid, or lithium storage batteries without fear of overcharging. The project can be used to drive two different electrical loads from the batteries at two different charge states to maximise power usage efficiency.

Photovoltaic Solar Battery Regulator

How to Use It
Applying a load only to the secondary output, you can choose to charge up the batteries to near maximum and dump excess power into the load only to stop overcharging. Applying the load to the main load output extracts as much power from the system immediately as it is generated. For camping fridge operation one might typically connect to the main load output most of the time, possibly switching to the secondary output if power was needed for some other purpose on the main load e.g. charging a mobile phone battery, or if it was desired to store up charge for a period of prolonged fridge operation.

Here is the project schematic. No MCU is needed for this project.



read more "Schematic Photovoltaic Solar Battery Regulator and Load Controller"

Wednesday, July 25, 2012

Control Graphic LCD

Done working on Graphic LCD (GLCD) interfacing with 89c51. Here is exapmle  asm file and hex code file.
And following are the connection pattern for GLCD and 89c51.



read more "Control Graphic LCD"

Control 89c51 Microcontroller


8051 Microcontroller is a programable device which is used for controlling purpose.
Basically 8051 controller is Mask porogramble means it will programed at the time of manufacturing and will not programed again, there is a derivative of 8051 microcontroller, 89c51 microcontroller which is reprogramable upto 10000 times, here is small discription abot the 89c51 microcontroller.
It have 4 ports which are used as input or output according to your need.
These prots are also programmed as bit wise pattern, means you can use each bit of microcontroller saperatelly as input or output.
This 89c51 is 8-bit device mean each port have 8-bits for I/O, total of 32-bits in the controller.
This device also have Timer, Serial Port interface and Interrupt controlling you can use these according to your need.
This device have 4K of ROM space to store the program,and 256Bytes of RAM space, this device have ability to interface with TTL based devices and also with the external MEMORY to increase its data space, but when your are using external MEMORY the 2 ports of 89c51 microcontroller are used for this purpose.

source
read more "Control 89c51 Microcontroller"

Control ISP Flash Microcontroller Programmer

Introduction

 This ISP Programmer can be used either for in-system programming or as a stand-alone spi programmer for Atmel ISP programmable devices. The programming interface is compatible to STK200 ISP programmer hardware so the users of STK200 can also use the software which can program both the 8051 and AVR series devices.

Hardware
Figure 1 shows the circuit diagram of the in-system programmer interface, the power to the interface is provided by the target system. The 74HCT541 ic isolate and buffer the parallel port signals. It is necessary to use the HCT type ic in order to make sure the programmer should also work with 3V type parallel port.


                Figure 1: Circuit Diagram of the ISP Programmer Interface

Figure 2 shows the circuit diagram of the stand-alone spi programmer, the power to the interface is provided by the PC USB port which can supply a max of 100mA current. Get a cheap USB cable, cut the cable other end connector and attach a crimp shell connector to this end, red wire is 5V and black is 0V.

The printer port buffer interface is same as shown in figure 1. For the u-controller a 40 pin ZIF socket can be used.

This programmer circuit can be use to program the 89S series devices and the AVR series devices which are pin compatible to 8051, like 90S8515. For other AVR series devices the user can make an adapter board for 20, 28 and 40 pin devices. The pin numbers shown in brackets correspond to PC parallel port connector.

                    Figure 2: Circuit Diagram of the SPI Programmer

Software
The ISP-30a.zip file contains the main program and the i/o port driver. Place all files in the same folder.
The main screen view of the program is shown in figure 3.

Also make sure do not program the RSTDISBL fuse in ATmega8, ATtiny26 and ATtiny2313 otherwise further spi programming is disable and you will need a parallel programmer to enable the spi programming. For the fuses setting consult the datasheet of the respective device.

For the auto hardware detection it is necessary to short pin 2 and 12 of DB25 connector, otherwise the software uses the default parallel port i.e. LPT1.

Following are the main features of this software,

Read and write the Intel Hex file
Read signature, lock and fuse bits
Clear and Fill memory buffer
Verify with memory buffer
Reload current Hex file
Display buffer checksum
Program selected lock bits & fuses
Auto detection of hardware


Note:
The memory buffer contains both the code data and the eeprom data for the devices which have eeprom memory. The eeprom memory address in buffer is started after the code memory, so it is necessary the hex file should contains the eeprom start address after the end of code memory last address i.e. for 90S2313 the start address for eeprom memory is 0x800.

The software does not provide the erase command because this function is performed automatically during device programming. If you are required to erase the controller, first use the clear buffer command then program the controller, this will erase the controller and also set the AVR device fuses to default setting.


Download
ISP-Flash Programmer Software ISP-30a.zip

                  Figure 3: Main screen of the program ISP-Pgm Ver 3.0a

source
read more "Control ISP Flash Microcontroller Programmer"

Tuesday, July 24, 2012

Schematic SMS Based Controlling Machines Using GSM Mobile and microcontroller 8051

SMS Based Controlling Different Industrial Machines Using GSM Mobile and microcontroller 8051
This project (interfacing mobile phone with microcontroller 8051 for machines control through SMS) has many important other applications and can be used to control Switch ON or OFF any machines at far off places using a gsm modem by sending sms through the communication between the mobile and the embedded devices (microcontroller 8051).This remote control of appliances is possible through Embedded Systems. The use of “Embedded System in Communication” has given rise to many interesting applications that ensures comfort and safety to human life. The microcontroller is interfaced with GSM Modem in mobile phone via MAX232 level convertor. The microcontroller project is designed to allow easy use of a mobile phone to control appliances or machines at any far location may be in industry or at home. Using a mobile phone the development of the control system will be carried out using SMS. This will communicate with another mobile phone, which in turn controls the devices attached to microcontroller modules. When the action has been carried out then a response is sent to the user. The use of mobile phones to remotely control an appliance control system. The microcontroller would then control the device based on the information given to it.

The devices are connected to the 8051 microcontroller using relays and optocouplers. These relay are controlled through software to switch ON or OFF the device as required. For every message received to microcontroller through mobile phone in form of SMS, the controller will check for the valid and pre-define formate. If the message is correct the controller will perform the operation.

The hardware board contains microcontroller AT89c52 at the heart of the system. The microcontroller is interfaced with GSM Modem of mobile phone via MAX232 level convertor. It is used to convert RS232 voltage levels to TTL voltage levels.

The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable and erasable read only memory (PEROM). The device is compatible with the industry-standard 80C51 and 80C52 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer which provides a highly-flexible and cost-effective solution to many embedded control applications.A GSM modem is a wireless modem that works with a GSM wireless network. A wireless modem behaves like a dial-up modem. The main difference between them is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order to operate.
Generally, computers use AT commands to control modems. Reading of message from the SIM card inserted into the modem is done by sending the appropriate AT command to the modem.
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA- 232 inputs to 5-V TTL/CMOS levels. Each driver converts TTL/CMOS input levels into EIA-232 levels.
SMS Based Controlling Machines Using GSM Mobile and microcontroller 8051


GSM Modem, which works at RS-232 voltage levels, logic 1 varies from -3 to -15 volts and logic 0 from +3 to +15 volts. The microcontroller which works on TTL logic levels, logic 1 is +5 volts and logic 0 is 0 volts. Therefore to interface the two we use a MAX 232 driver IC.



AT-Command set
 
The following section describes the AT-Command set. The commands can be tried out by connecting a GSM modem to one of the PC’s COM ports. Type in the test-command, adding CR + LF (Carriage return + Line feed = \r\n) before executing. Table gives an overview of the implemented AT-Commands in this application. The use of the commands is described in the later sections.

AT-Command set overview

The AT Command
Description of Commands
AT
Check if serial interface and GSM modem is working.
ATE0
Turn echo off, less traffic on serial line.
AT+CNMI
Display of new incoming SMS.
AT+CPMS
Selection of SMS memory.
AT+CMGF
SMS string format, how they are compressed.
AT+CMGR
Read new message from a given memory location.
AT+CMGS
Send message to a given recipient.
AT+CMGD
Delete message.

GSM Modem is used to receive message from the authorized user. This GSM modem requires a SIM card from a wireless carrier in order to operate. This SIM number is contact number of the receiving section.
First, the microcontroller have to send “AT” A response "OK" should be returned from the mobile phone or GSM modem. Now the microcontroller will send "AT+CPIN?". The AT command "AT+CPIN?" is used to query whether the mobile phone or GSM modem is waiting for a PIN (personal identification number, i.e. password). If the response is "+CPIN: READY", it means the SIM card is ready for use. After this, various AT commands depending on the used modem’s instruction set are send to modem and responses are received. This process is very useful in testing GSM modems.
, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt. In this project MODEM is communication with the microcontroller through serial port, the microcontroller will send the commands to the modem through RS 232.and the data is read through serial port therefore to make compatible computer serial port with microcontroller serial port we are using the RS 232 converter.A GSM network is composed of several functional entities, whose functions and interfaces are specified. Figure 1 shows the layout of a generic GSM network. The GSM network can be divided into three broad parts. The Mobile Station is carried by the subscriber. The Base Station Subsystem controls the radio link with the Mobile Station. The Network Subsystem, the main part of which is the Mobile services Switching Center (MSC), performs the switching of calls between the mobile users, and between mobile and fixed network users. The MSC also handles the mobility management operations. Not shown is the Operations and Maintenance Center, which oversees the proper operation and setup of the network. The Mobile Station and the Base Station Subsystem communicate across the Um interface, also known as the air interface or radio link. 8051 provides a transmit channel and a receive channel of serial communication. The transmit data pin (TXD) is specified at P3.1, and the receive data pin (RXD) is at P3.0. All modes are controlled through SCON, the Serial control register. The timers are controlled using TMOD, the Timer mode register, and TCON, the Timer control register.
read more "Schematic SMS Based Controlling Machines Using GSM Mobile and microcontroller 8051"

Monday, July 23, 2012

Control I, Robot' Will Blow Your Circuits

Get ready for all your circuits to be blown by "I, Robot," an adrenaline rush of a movie that actually excites your mind as it excites your senses.
Debra Scott Columnist Graphic In 1950, Issac Asimov -- one of the most famous, inventive and humanistic writers of science fiction -- set down the Three Laws of Robotics in his series of short stories, "I, Robot."1. A robot may not injure a human or, through inaction, allow a human to come to harm.
2. A robot must obey orders given to it by a human, except where it would conflict with the first law.
3. A robot must protect itself, as long as that protection does not violate either the first or second law.
I,Robot: CU Robot Ever since Asimov first wrote those words, many films about robots have used his laws as a blueprint and then theorized what would happen if a robot started to evolve and deviate from its hardwired programming."I, Robot," the movie, takes that premise and then leaves the rest of the robot movies in the dust with its involving murder mystery plot. "I, Robot" has a challenging, complex story structure, characters whose pasts fit together like a jigsaw puzzle and a comforting meld of the familiar and the futuristic in its Chicago 2035 setting. Two characters were taken from Asimov's stories -- robotics pioneer Dr. Alfred Lanning (James Cromwell) and a younger version of Dr. Susan Calvin (Bridget Moynahan), who specializes in the psyches of robots.I, Robot: Will In Robots Will Smith plays Det. Del Spooner (who is not a character in Asimov's stories), just about the only cop on the police force who doesn't believe robots are completely harmless -- an attitude that doesn't play well with his boss, Lt. John Bergin (Chi McBride).On the eve of a major rollout of the next generation of robots -- the NS-5's -- Lanning apparently commits suicide and leave behind a holographic message for Spooner. As Spooner pursues breadcrumbs of information, his investigation pushes him closer to the realization that his worst fears could be closer to the truth than anyone could ever imagine.I, Robot: Robot With LeadsSmith is absolutely spectacular as the haunted detective. His pumped-up body from "Ali" is still intact, but so is the wit, sensitivity and emotion he has revealed in his other films. Everything he has done has culminated in this mysteriously complex character.At times, the stunts are a little too far-fetched for any human to make believable, but who cares? It's cool, and so are the almost translucent-faced robots -- one of whom, Sonny, is almost irresistable with its childlike curiosity and human-like need for approval. But can it be trusted?Moynahan does an adequate job with the limited role she has been given, playing the robot-believer to Smith's robot-doubter. But this movie is really about Spooner and the robots.Asimov devotees should know that that the movie only takes ideas and characters from the book and those ideas are combined with a previously written script titled "Hardwired."Is it possible that robots could actually evolve to the point where they could come up with their own interpretations of the 3 Laws, or is that just an invention of screenwriters? "I, Robot" is a provocative, exhilarating peek into an unsure future that serves as sobering warning against letting technology take too much control over our lives.


source
read more "Control I, Robot' Will Blow Your Circuits"

Control Program control PWM for microcontroller

 This program can control motor dc for micorocontroller at mega 8535 .It is make with AVR studio 4
 
#include
#include
#include

#define    DDR_motor    DDRD    //DDR inilisiasi for Motor
#define    PORT_motor    PORTD    //PORT inisialisasi Motor

#define en_ka         5        // Enable L298 for right motor
#define dirA_ka     2        // Direction A for right motor
#define dirB_ka     3        // Direction B for right motor 

#define pwm_right    OCR1A

void delay_ms(int ms)
{for (int i=0;i

void foward(unsigned int pwm)
{
PORT_motor |=(1<
PORT_motor &=~(1<
pwm_right=pwm;                    //pwm for right motor
}

void backward(unsigned int pwm)
{
PORT_motor |=(1<

PORT_motor &=~(1<
pwm_right=pwm;                    //pwm for right motor
}


int main (void)    // excetion
{

DDR_motor=0xFF;
PORT_motor=0x00;


    TCCR1A= (1<<
            (1<<
            (1<<
           
    TCCR1B= (0<<
            (0<<<
    TCNT1=0x0000;
    OCR1A=0;
    OCR1B=0;
    sei( );


while(1)
{
backward(1000);
delay_ms(5000);
foward(700);
delay_ms(3000);

}
}


source
read more "Control Program control PWM for microcontroller"

Control DC Motor Control with Microcontroller ATmega8535

At mega 8535 microcontroller can use control dc motor that is on pin d where there have PWM control. DC motor can rotate because of the induction when the motor is connected to the DC voltage source. DC motor control with microcontroller if it is done more easily than without the microcontroller. We can change the direction of rotation of DC motor directly by changing the polarity of the voltage source. To change the speed of DC motors can be done by changing the size of a fox-voltage source. Control with a microcontroller as well as principled, but with an automated system. We do not have to change the cable from the motor to the battery if you want to change the direction of rotation, we just provide the logic 0 or 1 to the microcontroller is performed on the program in the microcontroller. To change the velocity is also easier because we simply use the existing PWM feature on the microcontroller. Maybe there are still many who do not know what PWM

PWM (Pulse Width Modulation) is a technique to get the effect of the analog signal from a digital signal to falter. PWM can be generated using only digital i / o which functioned as an output.

In the example above the waves, the comparison between high signal (1) and low signal (0th) is the same. Above the wave is said to have 50% duty cycle. Duty cycle is the ratio between the width of high signal (1) the overall width of the cycle (cycle). If the PWM wave amplitude is 5 volts, then the average stress (as if to analog) that we get is 2.5 volts. Here's an example of wave PWM with duty cycle 10%, if the amplitude of wave 5 volts then we will get the average analog voltage 0.5 volts.



In  ATMEGA8535 have two way control PWM, the PWM can be generated from the first port input / output is enabled as output. The second is to utilize the facilities of the function of the PWM timer / counter which has been provided. With this facility, the timing of the process of high / low digital signal will not disrupt the sequence of other programs being executed by the processor. In addition, by using this facility to enter how many servings we lived on and off time period on a wave PWM registers. OCR1A, OCR1B and OCR2 is register a place set PWM duty cycle.
read more "Control DC Motor Control with Microcontroller ATmega8535"

Friday, July 20, 2012

Control PWM Configuration for PIC16F877 microntroller

PWM can be used to control a motor driver or generate sound samples.

The register specifically used to configure PWM are the TRISC, PR2, CCP1CON, CCP2CON, CCPR1L, CCPR2L and T2CON registers. There are two PWM channels on the PIC16F877. These modules are coined CCP1 et CCP2. These modules are implemented on pins 16 and 17 of the PIC16F877. There are two ways to connect these pins to a L293D H-Bridge. I recommend to connect these to the L293D Chip Enable pins. PWM then controls the percentage of time the chip is enabled. 

There are two parameters that affect the behavior of the PWM. The first one is the frequency of the pulses, the second is the length of these pulses. The length of the pulse is also called the duty cycle, e.g. the percentage of time the motor is enabled. In an ideal environment, if a motor normally exhibit 100 RPM, then it should do 25 RPM with a 25% duty cycle

It is important to experiment with these parameters to find the configuration that is right for your application because no two motors are the same. Some motors are better when the frequency is low (between 2 000-5 000 Hz). Other motors are best when the frequency is high, say between 15 000 and 20 000 Hz. Note that a low frequency (between 1 000 and 8 000 Hz) will produce an audible sound that can be very annoying. I have tested three robots with varying weight (500 g to 15 kg) and with different motors and have found that a frequency of 15 000 to 20 000 Hz gives good results. I have never seen any robot move with a duty cycle of less than 50%. If you want to do this, you have to find ways to control PWM in software, i.e. for a duty cycle of 25%, use a 50% duty cycle and turn PWM 50% of the time. Ideally, you will find motors that are not too fast at 50% and fast enough at 100%. 

The TRISC register must be initialized so that RC1 et RC2 are identified as output ports (bits 1 and 2 of TRISC must be set to 0). CCP1CON and CCP2CON are used to configure CCP1 and CCP2 modules mode. A value of 12 configures these modules for PWM mode.

Timer2 is used by CCP1 and CCP2 modules for PWM purposes. Timer2 prescaler is configured using bits TCKPS0 et TCKPS1 of T2CON register (bits 0 and 1). A value of 0 for these two bits configures a prescaler of 1. Bit TMR2ON (bit 2) must be initialized to 1 to start Timer2.PR2 register controls the pulse frequency. The formula used to calculate the pulse period is:(PR2 + 1) * 4 * TOSC * (Timer2 prescaler value).Pulse frequency is 1 / period. If PR2 is equal to 255 and the PIC runs at 20 MHz, pulse frequency is 19.53 kHz with a Timer2 prescaler of 1, i.e. 1 / ((255 + 1) * 4 * 1 / 20 000 000 * 1).

The CCPR1L et CCPR2L registers configure the "duty cycle". The "duty cycle" is relative to PR2. If PR2 is 100 and CCPR1 is 50, then the "duty cycle" is effectively 50% (half of PR2).
CCS provides macros to configure these registers appropriately. Here is an example program that shows how to configure PWM with CCS:

demopwm.c
read more "Control PWM Configuration for PIC16F877 microntroller"

Control Timers on PIC16F877

The timer service is one of the basic services offered by a microcontroller. Although CCS compiler provides some simple macros that implement delay routines, in order to determine time elapsed and to maximize use of MCU (see Simple Scheduler section), understanding of the timer functionality is necessary.
To introduce delays in an application, the CCS macro delay_ms and delay_us can be used. These macros provide an ability to block the MCU until the specified delay has elapsed.
For tasks that require the ability to measure time (for instance, how much time has elapsed since a given pin has transitioned to low), it is possible to write code that uses the microcontroller timers.
There are three timers on the PIC16F877: Timer0, Timer1 and Timer2 (there is also a watchdog timer, but it is not typically used to drive application based behavior).
Timer0, Timer1 and Timer2 are essentially counters that increment based on the clock cycle and the timer prescaler. An application can monitor these counters to determine how much time has elapsed. On PIC16F877, Timer0 is an 8-bit counter whereas Timer1 and Timer2 are 16-bit counters. Individual timer counters can be set to an arbitrary value using CCS macro set_timer0, set_timer1 or set_timer2. When the counter reaches its limit (255 for 8-bit and 65535 for 16-bit counters), it wraps around to 0. Interrupts can be generated when wrap around occurs. Timer2 is normally used for PWM or capture and compare functions.
Each timer can be configured with a different source (internal or external) and prescaler. The prescaler determines the timer granularity. A timer with a prescaler of 1 increments its counter every 4 clock cycles (1,000,000 times a second if using a 4 MHz clock). A timer with a prescaler of 8 increments its counter every 32 clock cycles.
Given that Timer1 is set up with a prescaler of 8 on a MCU clocked at 20 MHz. If Timer1 is reset to 0 and the application performs a certain task and if the value of Timer1 read at the end of the task is 6 250, the application can assume that a delay of 10 ms has taken place. To determine the delay, use the following formula:
delay (in ms) = (# ticks) * 4 * prescaler * 1000 / (clock frequency)
or in our example:
delay (in ms) = (# ticks) * 4 * 8 * 1000 / 20 000 000
or
delay (in ms) = (# ticks) / 625
This translates in our example to:
delay (in ms) = 6 250 / 625 = 10 ms
Here is some sample code that shows how to initialize and use the timer to determine the length of a task:
long delay;
/* Set Timer1 prescaler to 8. */
setup_timer_1(T1_INTERNAL | T1_DIV_BY_8);
/* Reset Timer1 to 0. */
set_timer1(0);

/* Perform some task. */
printf("Hello, world!");

/* Calculate delay in ms. */
delay = get_timer1() / 625;

In the above example, it is important that the task performed does not exceed the maximum delay a timer can sustain before wrapping around, otherwise, the calculations may be incorrect.
Here is another code sample that shows how to create a delay of 50 ms before resuming execution (alternative to delay_ms):
/* Set Timer1 prescaler to 8. */
setup_timer_1(T1_INTERNAL | T1_DIV_BY_8);
/* Reset Timer1 to 0. */
set_timer1(0);

for ( ; get_timer1() < 3125; ) ;

/* 50 ms has elapsed. */
read more "Control Timers on PIC16F877"

Control Installation instructions of AVR development tools for Linux

This guide provides quick instructions how to install AVR development tools in various Linux distributions. For Windows platform, there is WinAVR containing all the same tools. Check out these instructions how to use AVR Studio with avr-gcc in Windows also. There are ports of AVR tools available for Mac OSX and FreeBSD as well.
In the excercise work lab, there are Linux systems with GNU AVR development tools available. With these instructions, students may install corresponding tools to their own computers. Students may also use their own laptop computers in the excercise lab if they wish so. Parallel port is required to upload code into the target AVR controller.
Students are encouraged to setup their own development environment. However, course personnel does not provide officially any support in installation or maintenance of private systems, except this document. If you can't make your system working with these instructions, please seek help from the internet society. There are plenty of documents and instructions just waiting for your googleing.

GNU toolchain

The GNU C-development toolchain consists of compiler, binary utilities and C-library. All the tools are available for Atmel's AVR target.
  • gcc-avr Gnu C Compiler for AVR
  • binutils-avr Binary utilities (linker, assembler, etc.) for AVR
  • avr-libc Basic C-library for AVR
  • gdb-avr Gnu debugger for AVR

Debian (apt)

Installation of GNU tools is very simple in a Debian based platform (Debian and Debian derivatives: Knoppix, Ubuntu, SELinux, etc.). The apt mechanism takes care of all the installation hasle without need to download installation packages manually. There exists ready made installation packages in standard sources servers for GNU development tools.In the command line, type the following commands with administrative privileges (root):
# apt-get install gcc-avr
# apt-get install avr-libc
# apt-get install gdb-avr
This will install, if not already installed, all the necessary development tools: gcc-avr, binutils-avr, avr-libc and gdb-avr. The same packages can be installed with graphical synaptic tool too.
In Ubuntu based systems (Ubuntu, Kubuntu, Edubuntu) you may need to enable universe packages. In the file /etc/apt/sources.list uncomment lines ending universe.

Redhat (yum/rpm)

In Red Hat based systems (Fedora Core and other derivatives; SuSe, Mandrake, etc.) with YUM package management system the installation of AVR tools is very similar to Debian installation. In the command line, give the following instructions with required priviledges (root):# yum install avr-gcc
# yum install avr-binutils
# yum install avr-libc
# yum install avr-gdb
There is also graphical gyum front-end available for the yum. If you have an older setup without YUM system, you must download rpm packages individually. There are several sources for the packages, good starting points are http://rpmfind.net and http://rpm.pbone.net. The set of required dependency packages depends on your system.
The minimum set of required packages is: avr-gcc, avr-binutils and avr-libc. Use the RPM tool to install packages:
# rpm \-ivh 

Other (src)

The most difficult way of installing the tools is to compile them from scratch. Use this method only if you can't get the tools using any package management tool. Compiling tools from sources provides option to have the tools in non-linux platforms. For more detailed information how to compile these tools for AVR target, check Rich Neswold's A GNU Development Environment for the AVR Microcontroller documentation. Note that the document is a bit old and version numbers do not apply anymore.
The standard 3-series gcc has support for AVR target. Gcc sources are available at gcc official web site http://gcc.gnu.org/. When configuring gcc build, use the following settings:
# configure \--target=avr \--enable-languages="c"*binutils*
The standard binutils package has support for AVR target. Official binutils web site is http://www.gnu.org/software/binutils/. When configuring binutils build, use the following setting:
# configure \--target=avr*libc\*
In embedded systems, language libraries must be as light weight as possible. There is no much resources available in the target hardware, thus general c libraries can not be used. For AVR there is a specific C library implementation available: http://www.nongnu.org/avr-libc/

Programmers/Downloaders

UISP

UISP is a simple command line tool to upload compiled hex code into the target hardware. AVR supports in-system programming. New code can be programmed into the internal program flash memory via serial programming interface meanwhile the microcontroller is mounted in the embedded target hardware.
UISP supports many serial and parallel port programming cables. Most of Atmel's AVR versions are supported too. For more information, check the projects web site http://savannah.nongnu.org/projects/uisp/.

Debian

# apt-get install uisp

Redhat

# yum install uisp

Source

Download sources from UISP's web site, or elsewhere, and extract package. Compile and install program. Note that the last command (install) must be executed as root. If there is a newer version available, replace the version number in the package name with correct one.
# tar xvzf uisp-20050207.tar.gz
# uisp-20050207
# ./configure
# make
# make install
You may need to install parallel port drivers and set access permissions as root:
# modprobe ppdev
# chmod a+rw /dev/parport0

Avrdude

Avrdude is similar tool to the UISP. The tool was previously named avrprog. Avrdude supports wide range of programming tools and target AVR devices. It is know to run in Linux, FreeBSD, Mac OSX and Win32. Projects home page: http://savannah.nongnu.org/projects/avrdude.
Avrdude's configuration file allows user to define alternative programmer cable pin configurations. Thus it can be used with exotic programming cables as well.

Debian

The avrprog in debian sources is an oldversion. Not recommended! Compile the program from sources instead.
# apt-get install avrprog

Red Hat

Source

Download sources from project page and extract it. Compile the code and install the program. Note that the last command (install) must be executed with super user priviledges (root). If there is a newer version available, replace the version number in the package name with correct one
# tar xvzf avrdude-5.0.tar.gz
# cd avrdude-5.0
# ./configure
# make
# make install
You may need to install parallel port drivers and set access permissions as root:
# modprobe ppdev
# chmod a+rw /dev/parport0

Simulators

read more "Control Installation instructions of AVR development tools for Linux"

Control ARM announces the first mobile multicore processor | Cortex-A5.

 ARM has launched the ARM Cortex-A5 MPCore processor – their first multicore processor intended for usage in mobile devices. According to the company this is the smallest and most power-efficient multicore processor that is capable of delivering the performance needed for smartphones and the cheap manufacturing desired for low-cost devices.
ARM Cortex-A5
The ARM Cortex-A5 gamma features a wide range of CPUs – from the power-efficient uniprocessor (that we imagine will cost pennies to produce) to up to 4-core processor (that should be used on high-end multimedia powerhouses).
The new range of processors should deliver much better performance than its ARM11 predecessors, while still fitting within the size of the ARM9 units. At the same time the multi-core ARM Cortex-A5 should be nearly twice as power efficient, which should probably have quite an effect on mobile devices battery life. ARM11 is a pretty popular hardware platform for many Symbian smartphones. Even the the first two generations of Apple iPhone used ARM11 cores.
ARM state that the new Cortex-A5 is fully application compatible with the older Cortex-A8 and Cortex-A9 processors (currently used in popular devices such as the Sony Ericsson Satio, Nokia N900, Samsung Omnia HD, iPhone 3GS and Palm Pre), which means it should get along perfectly with0 all software platforms such as Android, Symbian, Windows Mobile, etc. We are yet to see however if all those platforms will be able to utilize the multi-core architecture to its fullest.
The Cortex-A5 processor is now available for general licensing, and shipments will start in Q4 of 2009. That means that we might be seeing the first prototypes utilizing it at the next GSM Congress in February.
read more "Control ARM announces the first mobile multicore processor | Cortex-A5."

Thursday, July 19, 2012

Control To make a robot which can follow a white strip on black background and can extinguish fire on its way .

line follower robot
Design Specifications 
1. For proper functioning of the robot needs a voltage supply of about 5.3V and current about 0.7A.
2. The robot should be able to distinguish between the white and the black surface.
3. If the black surface suddenly ends, the robot should keep on moving in the direction it last moved
until the black line is again there.
4. It should stop and extinguish fire and restart only after making sure that the fire has been
extinguished.
5. This could not be run using the dry cells because of the current requirement.


Principle
The basic principle used is the difference in reflection of light from a white surface
and a dark surface .This could be sensed using two LDR's. The two inputs would be fed to two different
comparator whose comparing voltage is set using the potentiometer .When the light is reflected by the black
surface the resistance of LDR is high, hence the voltage is high and vice versa .The current flowing through
the output of comparator is very low to drive the motor .Thus ,a Darlington pair is applied to the output of
the op-amp .This output could be used to run the H-bridge circuit which can rotate the motors in both the
directions. It would continue moving in the line it was last moving if there is no line.It can navigate through
almost all turns.
If a flame comes in the way the third LDR mounted on the top will detect it and stop the motors of tyres
and startthe fan. When the fire extinguishes,fan stops and the motor starts again and it continues in same
direction.


Working of the Robot



The circuit implemented consists mainly of two different sub-circuits.
The first part comprises of making the robot follow a black strip. This was done using a comparator
circuit using the LDR whose reference voltage was fixed using the potentiometer. This was based on the
phenomenon that the resistance of the LDR decreases as the intensity of light falling on it increases. In our
case, the light reflected from the white surface is more than that from the black surface. Therefore, the
voltage in positive terminal of the comparator remains high as long as the robot is moving on white surface.
If the black surface come under one of the two LDR.s the motor corresponding to that LDR stops, the other making
it move away from the black line. But as the other LDR crosses the black line, its motor stops, the other
forcing it in other direction, resulting in its following the black line. Thus ,the output voltage of the Op-Amp
has been varied according to the need,but the current flowing through the output of Op-Amp is in some mA .Thus
there was need for current amplification. The Darlington .pair was used for the same. The resistance of the motor
was 5-10ohms,thus source follower circuit was used.
The second part comprised of using LDR.s and IR-receivers to detect flame .The dual Op-Amp LM358
was used for the same. The two comparator circuits were used .For LDR, the working was same, but for IR receiver
the voltage and not the resistance vary according to the intensity of light. Thus the two ends of IR-receiver
were connected to ground and positive terminal of the comparator .The output of these two were ORed and given to
a monostable 555 timer with time period of 4 sec.555 was used because when the robot sees the fire ,the fan
starts and the motors stop but when fan starts the intensity of light decreases and hence the two motors start
again and there is a chance that the motor starts before the fire is extinguished .The 555 helps in generating a
high pulse of about 4 seconds which will remain high and will not depend on the intensity of light for the same
duration .Thus , this will make sure that the fire is extinguished before moving ahead. Once the fire is
extinguished it will retain its original motion.

Application
1. The robot can be used as a guider to guide the visitors from the entrance to the main office .
2. It can help doctors to carry the medicines from one ward to another .
3. The main purpose is to rescue the people by extinguishing fire in a building .
read more "Control To make a robot which can follow a white strip on black background and can extinguish fire on its way ."

Wednesday, July 18, 2012

Control Mikrokontoroler test wIth LED

This program I created for it using AVR studio where this program turn the fruit led eight couples who pins on PORTD

#include
#include

void kanan() //arah geral led kekanan
{
DDRD=0xff; //set pin D
int i;        // i inisilisai
for (i=1 ;i<=128; i=i*2)
{
PORTD=i;    // i inisilisai
_delay_ms(500);
}
}
void kiri() //arah geral led kekiri
{
DDRD=0xff; //set pin D
int  i;  // i inisilisai
for (i=128; i>1 ; i -=i/2)
{
PORTD=i;  // i inisilisai
_delay_ms(500);
}
}
void blink()
{
unsigned char i= 0 ;
for (i=0;i<8;i++)
{
PORTD=0xff;
_delay_ms(500);
_delay_ms(500);
PORTD=0×00;
_delay_ms(500);
_delay_ms(500);
}
}
int main() // tempat beraksi
{
while(1)
{
kiri();
kanan();
_delay_ms(500);
_delay_ms(500);
blink();
_delay_ms(500);
_delay_ms(500);
kanan();
kiri();
_delay_ms(500);
_delay_ms(500);
blink();
_delay_ms(500);
_delay_ms(500);
}
return(0);
}
read more "Control Mikrokontoroler test wIth LED"

Control Creating Minimum System Atmega8535

 What is the minimum system?
 The minimum system is a series of at least where the microcontroller chip can work. Atmega8535 microcontroller has dilengapi with internal oscillator, so no crystal or resonator is required external to the CPU clock source. However, this oscillator maximum 8Mhz so I suggest to keep using an external crystal.Internal oscillator by the manufacturer gives a chance 1 MHz, and to change it we need to change the settings of Fuse bits, for setting fuse bits need to be careful, because this setting is so vulnerable because if the wrong setting microcontroller can cause damage, I had corrupted a microcontroller.

Minimum System AVR is very simple where only connect AVCC to VCC and +5 V and GND and AGND to the ground and reset pin is not connected to anything . Chip will be reset if the voltage is zero or RST pins are forced to zero. This is the minimum system without using a crystal. For those who wear the above plus a series of crystal-crystal on pins XTAL1 and XTAL2.The following minimum system which uses a crystal (I recommend making the use of crystals)
Combination the above are the minimum system used to control the LEDs.The above circuit can use the live trace deeptrace, eagle, proteus, or other programs that you mastered. For those who are lazy to download the trace made by me, which I pake softrware deeptrace 2009, please download here
downloadernya can use a downloader that my previous post
 
 display the following minimum system in deeptrace
 For the prgram and the way I described in my program filling the next posting.

from  http://etekno.blogspot.com/2010/06/proyek-1-membuat-sistem-minimum.html
read more "Control Creating Minimum System Atmega8535"