<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5685383281063442688</id><updated>2026-05-14T17:15:55.638+05:30</updated><category term="Electronics"/><category term="Microcontroller"/><category term="Interfacing"/><category term="Programming"/><category term="8051"/><category term="AVR"/><category term="Computer"/><category term="PIC"/><category term="Power Electronics"/><category term="Linux"/><category term="Books"/><category term="dsPIC"/><title type='text'>Embedded System Desgin </title><subtitle type='html'>Embedded System Design &#xa;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>140</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-8969403255514525677</id><published>2025-07-31T19:00:00.006+05:30</published><updated>2025-07-31T19:55:00.190+05:30</updated><title type='text'>Schmitt Trigger Working  Animation Tutorials .</title><content type='html'>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Schmitt Trigger Animation&lt;/title&gt;
    &lt;style&gt;
        body {
            font-family: &#39;Arial&#39;, sans-serif;
            margin: 0;
            padding: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #333;
            min-height: 100vh;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }

        .title {
            text-align: center;
            font-size: 32px;
            font-weight: bold;
            background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 30px;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }

        .control-group {
            background: linear-gradient(135deg, #74b9ff, #0984e3);
            padding: 15px;
            border-radius: 10px;
            color: white;
            text-align: center;
            min-width: 150px;
        }

        .control-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
        }

        .control-group input[type=&quot;range&quot;] {
            width: 100%;
            margin: 5px 0;
        }

        .control-group button {
            background: #00b894;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            margin: 5px;
        }

        .control-group button:hover {
            background: #00a085;
        }

        .circuit-section {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 30px;
        }

        .circuit-diagram {
            background: #f8f9fa;
            border: 3px solid #e9ecef;
            border-radius: 15px;
            padding: 20px;
            position: relative;
            height: 300px;
        }

        .op-amp {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 80px;
            height: 60px;
            background: #2d3436;
            clip-path: polygon(0 0, 70% 0, 100% 50%, 70% 100%, 0 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
        }

        .input-line {
            position: absolute;
            height: 3px;
            background: #e17055;
            left: 20px;
        }

        .feedback-line {
            position: absolute;
            width: 3px;
            background: #00b894;
        }

        .output-line {
            position: absolute;
            height: 3px;
            background: #fd79a8;
            right: 20px;
        }

        .voltage-label {
            position: absolute;
            font-size: 12px;
            font-weight: bold;
            padding: 2px 6px;
            border-radius: 3px;
            color: white;
        }

        .waveform-section {
            background: #2d3436;
            color: white;
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .waveform-title {
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            color: #74b9ff;
        }

        .canvas-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        canvas {
            background: #1a1a1a;
            border: 2px solid #74b9ff;
            border-radius: 8px;
            width: 100%;
            height: 200px;
        }

        .info-panel {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .info-box {
            background: linear-gradient(135deg, #a29bfe, #6c5ce7);
            color: white;
            padding: 20px;
            border-radius: 15px;
            text-align: center;
        }

        .info-box h3 {
            margin-bottom: 15px;
            font-size: 18px;
        }

        .equation {
            background: rgba(255,255,255,0.2);
            padding: 10px;
            border-radius: 8px;
            margin: 10px 0;
            font-family: &#39;Courier New&#39;, monospace;
            font-weight: bold;
        }

        .hysteresis-display {
            background: linear-gradient(135deg, #fd79a8, #e84393);
            color: white;
            padding: 15px;
            border-radius: 10px;
            text-align: center;
            margin: 10px 0;
            font-size: 18px;
            font-weight: bold;
        }

        .status-indicator {
            display: inline-block;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            margin: 0 10px;
            vertical-align: middle;
            animation: pulse 1s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }

        .legend {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255,255,255,0.1);
            padding: 8px 15px;
            border-radius: 20px;
        }

        .legend-color {
            width: 20px;
            height: 4px;
            border-radius: 2px;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class=&quot;container&quot;&gt;
        &lt;div class=&quot;title&quot;&gt;⚡ Schmitt Trigger Interactive Animation ⚡&lt;/div&gt;
        
        &lt;div class=&quot;controls&quot;&gt;
            &lt;div class=&quot;control-group&quot;&gt;
                &lt;label&gt;Input Voltage (V)&lt;/label&gt;
                &lt;input type=&quot;range&quot; id=&quot;inputVoltage&quot; min=&quot;-10&quot; max=&quot;10&quot; step=&quot;0.1&quot; value=&quot;0&quot;&gt;
                &lt;div id=&quot;inputValue&quot;&gt;0.0 V&lt;/div&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;control-group&quot;&gt;
                &lt;label&gt;Upper Threshold (VUT)&lt;/label&gt;
                &lt;input type=&quot;range&quot; id=&quot;upperThreshold&quot; min=&quot;1&quot; max=&quot;8&quot; step=&quot;0.1&quot; value=&quot;5&quot;&gt;
                &lt;div id=&quot;upperValue&quot;&gt;5.0 V&lt;/div&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;control-group&quot;&gt;
                &lt;label&gt;Lower Threshold (VLT)&lt;/label&gt;
                &lt;input type=&quot;range&quot; id=&quot;lowerThreshold&quot; min=&quot;-8&quot; max=&quot;-1&quot; step=&quot;0.1&quot; value=&quot;-5&quot;&gt;
                &lt;div id=&quot;lowerValue&quot;&gt;-5.0 V&lt;/div&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;control-group&quot;&gt;
                &lt;label&gt;Animation Control&lt;/label&gt;
                &lt;button id=&quot;startStop&quot;&gt;Start Auto&lt;/button&gt;
                &lt;button id=&quot;reset&quot;&gt;Reset&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class=&quot;circuit-section&quot;&gt;
            &lt;div class=&quot;circuit-diagram&quot; id=&quot;circuitDiagram&quot;&gt;
                &lt;div class=&quot;op-amp&quot;&gt;
                    &lt;span&gt;741&lt;/span&gt;
                &lt;/div&gt;
                
                &lt;!-- Input line --&gt;
                &lt;div class=&quot;input-line&quot; style=&quot;top: 120px; width: 100px;&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;voltage-label&quot; style=&quot;left: 5px; top: 105px; background: #e17055;&quot; id=&quot;vinLabel&quot;&gt;Vin: 0V&lt;/div&gt;
                
                &lt;!-- Feedback line --&gt;
                &lt;div class=&quot;feedback-line&quot; style=&quot;left: 200px; top: 80px; height: 100px;&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;feedback-line&quot; style=&quot;left: 80px; top: 180px; width: 120px; height: 3px;&quot;&gt;&lt;/div&gt;
                
                &lt;!-- Output line --&gt;
                &lt;div class=&quot;output-line&quot; style=&quot;top: 150px; width: 80px;&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;voltage-label&quot; style=&quot;right: 5px; top: 135px; background: #fd79a8;&quot; id=&quot;voutLabel&quot;&gt;Vout: +12V&lt;/div&gt;
                
                &lt;!-- Threshold indicators --&gt;
                &lt;div class=&quot;voltage-label&quot; style=&quot;left: 120px; top: 60px; background: #00b894;&quot; id=&quot;thresholdLabel&quot;&gt;VUT: 5V&lt;/div&gt;
                &lt;div class=&quot;voltage-label&quot; style=&quot;left: 120px; top: 200px; background: #ff7675;&quot; id=&quot;thresholdLabelLow&quot;&gt;VLT: -5V&lt;/div&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;info-box&quot;&gt;
                &lt;h3&gt;🎯 Current Status&lt;/h3&gt;
                &lt;div class=&quot;hysteresis-display&quot; id=&quot;hysteresisDisplay&quot;&gt;
                    Hysteresis: 10.0V
                &lt;/div&gt;
                &lt;div style=&quot;margin: 15px 0;&quot;&gt;
                    &lt;div&gt;Output State: &lt;span class=&quot;status-indicator&quot; id=&quot;outputIndicator&quot; style=&quot;background: #00b894;&quot;&gt;&lt;/span&gt;&lt;span id=&quot;outputState&quot;&gt;HIGH (+12V)&lt;/span&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class=&quot;equation&quot;&gt;
                    VUT = +Vref × (R2/(R1+R2))&lt;br&gt;
                    VLT = -Vref × (R2/(R1+R2))&lt;br&gt;
                    Hysteresis = VUT - VLT
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class=&quot;waveform-section&quot;&gt;
            &lt;div class=&quot;waveform-title&quot;&gt;📊 Real-time Waveforms&lt;/div&gt;
            &lt;div class=&quot;legend&quot;&gt;
                &lt;div class=&quot;legend-item&quot;&gt;
                    &lt;div class=&quot;legend-color&quot; style=&quot;background: #74b9ff;&quot;&gt;&lt;/div&gt;
                    &lt;span&gt;Input Voltage (Vin)&lt;/span&gt;
                &lt;/div&gt;
                &lt;div class=&quot;legend-item&quot;&gt;
                    &lt;div class=&quot;legend-color&quot; style=&quot;background: #fd79a8;&quot;&gt;&lt;/div&gt;
                    &lt;span&gt;Output Voltage (Vout)&lt;/span&gt;
                &lt;/div&gt;
                &lt;div class=&quot;legend-item&quot;&gt;
                    &lt;div class=&quot;legend-color&quot; style=&quot;background: #00b894;&quot;&gt;&lt;/div&gt;
                    &lt;span&gt;Upper Threshold (VUT)&lt;/span&gt;
                &lt;/div&gt;
                &lt;div class=&quot;legend-item&quot;&gt;
                    &lt;div class=&quot;legend-color&quot; style=&quot;background: #ff7675;&quot;&gt;&lt;/div&gt;
                    &lt;span&gt;Lower Threshold (VLT)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;canvas-container&quot;&gt;
                &lt;canvas id=&quot;inputCanvas&quot; width=&quot;400&quot; height=&quot;200&quot;&gt;&lt;/canvas&gt;
                &lt;canvas id=&quot;outputCanvas&quot; width=&quot;400&quot; height=&quot;200&quot;&gt;&lt;/canvas&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class=&quot;info-panel&quot;&gt;
            &lt;div class=&quot;info-box&quot;&gt;
                &lt;h3&gt;🔧 How It Works&lt;/h3&gt;
                &lt;p&gt;&lt;strong&gt;Schmitt Trigger&lt;/strong&gt; is a comparator with &lt;strong&gt;hysteresis&lt;/strong&gt;. It has two different threshold voltages:&lt;/p&gt;
                &lt;ul style=&quot;text-align: left; margin: 15px 0;&quot;&gt;
                    &lt;li&gt;&lt;strong&gt;VUT (Upper Threshold):&lt;/strong&gt; When input rises above this, output goes LOW&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;VLT (Lower Threshold):&lt;/strong&gt; When input falls below this, output goes HIGH&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Hysteresis:&lt;/strong&gt; Difference between thresholds prevents noise triggering&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;info-box&quot;&gt;
                &lt;h3&gt;📈 Key Features&lt;/h3&gt;
                &lt;ul style=&quot;text-align: left; margin: 15px 0;&quot;&gt;
                    &lt;li&gt;&lt;strong&gt;Noise Immunity:&lt;/strong&gt; Hysteresis prevents false triggering&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Square Wave Output:&lt;/strong&gt; Clean digital signal from noisy input&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Memory Effect:&lt;/strong&gt; Output depends on input history&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Positive Feedback:&lt;/strong&gt; Creates the hysteresis behavior&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;info-box&quot;&gt;
                &lt;h3&gt;🎯 Applications&lt;/h3&gt;
                &lt;ul style=&quot;text-align: left; margin: 15px 0;&quot;&gt;
                    &lt;li&gt;&lt;strong&gt;Digital Circuits:&lt;/strong&gt; Convert analog to digital&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Oscillators:&lt;/strong&gt; Generate square waves&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Noise Filtering:&lt;/strong&gt; Clean up noisy signals&lt;/li&gt;
                    &lt;li&gt;&lt;strong&gt;Level Detectors:&lt;/strong&gt; Detect voltage levels with immunity&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;script&gt;
        // Animation variables
        let animationRunning = false;
        let animationId;
        let time = 0;
        let inputHistory = [];
        let outputHistory = [];
        let maxHistoryLength = 200;
        
        // Circuit state
        let currentOutput = 12; // Start with HIGH output
        let inputVoltage = 0;
        let upperThreshold = 5;
        let lowerThreshold = -5;
        
        // Get DOM elements
        const inputSlider = document.getElementById(&#39;inputVoltage&#39;);
        const upperSlider = document.getElementById(&#39;upperThreshold&#39;);
        const lowerSlider = document.getElementById(&#39;lowerThreshold&#39;);
        const startStopBtn = document.getElementById(&#39;startStop&#39;);
        const resetBtn = document.getElementById(&#39;reset&#39;);
        
        const inputValue = document.getElementById(&#39;inputValue&#39;);
        const upperValue = document.getElementById(&#39;upperValue&#39;);
        const lowerValue = document.getElementById(&#39;lowerValue&#39;);
        
        const inputCanvas = document.getElementById(&#39;inputCanvas&#39;);
        const outputCanvas = document.getElementById(&#39;outputCanvas&#39;);
        const inputCtx = inputCanvas.getContext(&#39;2d&#39;);
        const outputCtx = outputCanvas.getContext(&#39;2d&#39;);
        
        // Update display elements
        function updateDisplay() {
            inputVoltage = parseFloat(inputSlider.value);
            upperThreshold = parseFloat(upperSlider.value);
            lowerThreshold = parseFloat(lowerSlider.value);
            
            inputValue.textContent = inputVoltage.toFixed(1) + &#39; V&#39;;
            upperValue.textContent = upperThreshold.toFixed(1) + &#39; V&#39;;
            lowerValue.textContent = lowerThreshold.toFixed(1) + &#39; V&#39;;
            
            // Update circuit labels
            document.getElementById(&#39;vinLabel&#39;).textContent = `Vin: ${inputVoltage.toFixed(1)}V`;
            document.getElementById(&#39;voutLabel&#39;).textContent = `Vout: ${currentOutput &gt; 0 ? &#39;+12V&#39; : &#39;-12V&#39;}`;
            document.getElementById(&#39;thresholdLabel&#39;).textContent = `VUT: ${upperThreshold.toFixed(1)}V`;
            document.getElementById(&#39;thresholdLabelLow&#39;).textContent = `VLT: ${lowerThreshold.toFixed(1)}V`;
            
            // Update hysteresis display
            const hysteresis = upperThreshold - lowerThreshold;
            document.getElementById(&#39;hysteresisDisplay&#39;).textContent = `Hysteresis: ${hysteresis.toFixed(1)}V`;
            
            // Update output state
            const outputIndicator = document.getElementById(&#39;outputIndicator&#39;);
            const outputState = document.getElementById(&#39;outputState&#39;);
            
            if (currentOutput &gt; 0) {
                outputIndicator.style.background = &#39;#00b894&#39;;
                outputState.textContent = &#39;HIGH (+12V)&#39;;
            } else {
                outputIndicator.style.background = &#39;#ff7675&#39;;
                outputState.textContent = &#39;LOW (-12V)&#39;;
            }
        }
        
        // Schmitt trigger logic
        function updateSchmittTrigger() {
            if (currentOutput &gt; 0) {
                // Output is HIGH, check if input goes below lower threshold
                if (inputVoltage &lt; lowerThreshold) {
                    currentOutput = -12;
                }
            } else {
                // Output is LOW, check if input goes above upper threshold
                if (inputVoltage &gt; upperThreshold) {
                    currentOutput = 12;
                }
            }
        }
        
        // Draw grid on canvas
        function drawGrid(ctx, canvas) {
            ctx.strokeStyle = &#39;#444&#39;;
            ctx.lineWidth = 0.5;
            
            // Vertical lines
            for (let x = 0; x &lt;= canvas.width; x += 20) {
                ctx.beginPath();
                ctx.moveTo(x, 0);
                ctx.lineTo(x, canvas.height);
                ctx.stroke();
            }
            
            // Horizontal lines
            for (let y = 0; y &lt;= canvas.height; y += 20) {
                ctx.beginPath();
                ctx.moveTo(0, y);
                ctx.lineTo(canvas.width, y);
                ctx.stroke();
            }
            
            // Center line
            ctx.strokeStyle = &#39;#666&#39;;
            ctx.lineWidth = 1;
            ctx.beginPath();
            ctx.moveTo(0, canvas.height / 2);
            ctx.lineTo(canvas.width, canvas.height / 2);
            ctx.stroke();
        }
        
        // Draw waveforms
        function drawWaveforms() {
            // Clear canvases
            inputCtx.clearRect(0, 0, inputCanvas.width, inputCanvas.height);
            outputCtx.clearRect(0, 0, outputCanvas.width, outputCanvas.height);
            
            // Draw grids
            drawGrid(inputCtx, inputCanvas);
            drawGrid(outputCtx, outputCanvas);
            
            // Draw input waveform and thresholds
            if (inputHistory.length &gt; 1) {
                // Input signal
                inputCtx.strokeStyle = &#39;#74b9ff&#39;;
                inputCtx.lineWidth = 2;
                inputCtx.beginPath();
                for (let i = 0; i &lt; inputHistory.length; i++) {
                    const x = (i / maxHistoryLength) * inputCanvas.width;
                    const y = inputCanvas.height / 2 - (inputHistory[i] / 15) * (inputCanvas.height / 2);
                    if (i === 0) {
                        inputCtx.moveTo(x, y);
                    } else {
                        inputCtx.lineTo(x, y);
                    }
                }
                inputCtx.stroke();
                
                // Upper threshold line
                inputCtx.strokeStyle = &#39;#00b894&#39;;
                inputCtx.lineWidth = 2;
                inputCtx.setLineDash([5, 5]);
                const yUpper = inputCanvas.height / 2 - (upperThreshold / 15) * (inputCanvas.height / 2);
                inputCtx.beginPath();
                inputCtx.moveTo(0, yUpper);
                inputCtx.lineTo(inputCanvas.width, yUpper);
                inputCtx.stroke();
                
                // Lower threshold line
                inputCtx.strokeStyle = &#39;#ff7675&#39;;
                const yLower = inputCanvas.height / 2 - (lowerThreshold / 15) * (inputCanvas.height / 2);
                inputCtx.beginPath();
                inputCtx.moveTo(0, yLower);
                inputCtx.lineTo(inputCanvas.width, yLower);
                inputCtx.stroke();
                inputCtx.setLineDash([]);
            }
            
            // Draw output waveform
            if (outputHistory.length &gt; 1) {
                outputCtx.strokeStyle = &#39;#fd79a8&#39;;
                outputCtx.lineWidth = 3;
                outputCtx.beginPath();
                for (let i = 0; i &lt; outputHistory.length; i++) {
                    const x = (i / maxHistoryLength) * outputCanvas.width;
                    const y = outputCanvas.height / 2 - (outputHistory[i] / 15) * (outputCanvas.height / 2);
                    if (i === 0) {
                        outputCtx.moveTo(x, y);
                    } else {
                        outputCtx.lineTo(x, y);
                    }
                }
                outputCtx.stroke();
            }
        }
        
        // Animation loop
        function animate() {
            if (!animationRunning) return;
            
            // Generate sine wave input when auto mode is on
            if (animationRunning) {
                inputVoltage = 8 * Math.sin(time * 0.02);
                inputSlider.value = inputVoltage;
                time++;
            }
            
            updateSchmittTrigger();
            updateDisplay();
            
            // Store history
            inputHistory.push(inputVoltage);
            outputHistory.push(currentOutput);
            
            if (inputHistory.length &gt; maxHistoryLength) {
                inputHistory.shift();
                outputHistory.shift();
            }
            
            drawWaveforms();
            
            animationId = requestAnimationFrame(animate);
        }
        
        // Event listeners
        inputSlider.addEventListener(&#39;input&#39;, () =&gt; {
            if (!animationRunning) {
                updateSchmittTrigger();
                updateDisplay();
                
                inputHistory.push(inputVoltage);
                outputHistory.push(currentOutput);
                
                if (inputHistory.length &gt; maxHistoryLength) {
                    inputHistory.shift();
                    outputHistory.shift();
                }
                
                drawWaveforms();
            }
        });
        
        upperSlider.addEventListener(&#39;input&#39;, updateDisplay);
        lowerSlider.addEventListener(&#39;input&#39;, updateDisplay);
        
        startStopBtn.addEventListener(&#39;click&#39;, () =&gt; {
            animationRunning = !animationRunning;
            startStopBtn.textContent = animationRunning ? &#39;Stop Auto&#39; : &#39;Start Auto&#39;;
            
            if (animationRunning) {
                animate();
            } else {
                cancelAnimationFrame(animationId);
            }
        });
        
        resetBtn.addEventListener(&#39;click&#39;, () =&gt; {
            animationRunning = false;
            cancelAnimationFrame(animationId);
            startStopBtn.textContent = &#39;Start Auto&#39;;
            
            time = 0;
            inputHistory = [];
            outputHistory = [];
            currentOutput = 12;
            
            inputSlider.value = 0;
            updateDisplay();
            drawWaveforms();
        });
        
        // Initialize
        updateDisplay();
        drawWaveforms();
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/8969403255514525677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2025/07/schmitt-trigger-animation-body-font.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8969403255514525677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8969403255514525677'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2025/07/schmitt-trigger-animation-body-font.html' title='Schmitt Trigger Working  Animation Tutorials .'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-4919394409992872885</id><published>2023-10-07T10:16:00.006+05:30</published><updated>2025-07-31T19:52:46.140+05:30</updated><title type='text'>16x2 LCD  Interfacing with STM32,STM32F103C6</title><content type='html'>







&lt;p&gt;&lt;b&gt;&amp;nbsp;16x2 LCD&amp;nbsp; Interfacing with STM32,STM32F103C6&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTPGx2dYPLj8-4B85uMiASlZ5B1dYZfmuLGtvxnNGjRH7X1WnzstdI0IuSeoo2yaX9OXpNW5p7p-DyytUe4U77DFuwN7sg_Z5IHP8p1D8sjUfkVxcevOKmuY9jgL-CXMXehpyx2EGmDaFjpeEUdYNmI3a6z07AIRba5F4utVUkn8nIiJfNUizfmdwCja5/s1017/Screenshot%202023-10-07%20101642.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;544&quot; data-original-width=&quot;1017&quot; height=&quot;269&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTPGx2dYPLj8-4B85uMiASlZ5B1dYZfmuLGtvxnNGjRH7X1WnzstdI0IuSeoo2yaX9OXpNW5p7p-DyytUe4U77DFuwN7sg_Z5IHP8p1D8sjUfkVxcevOKmuY9jgL-CXMXehpyx2EGmDaFjpeEUdYNmI3a6z07AIRba5F4utVUkn8nIiJfNUizfmdwCja5/w503-h269/Screenshot%202023-10-07%20101642.jpg&quot; width=&quot;503&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;




&lt;pre class=&quot;prettyprint&quot;&gt;  

lcd_init();

   LCD_LINE1;
  lcd_String(&quot;  GeElectron&quot;);
  LCD_LINE2;
   lcd_String(&quot;   Welcome&quot;);

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */

	  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13, GPIO_PIN_SET);// LCD Enable PIN to High
	 	  	  HAL_Delay(500);
	 	  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13, RESET);
	  	      HAL_Delay(500);
	  	  //  lcd_String(&quot;Hello&quot;);

  }
  /* USER CODE END 3 */
}&lt;span style=&quot;color: red;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;



                                                          &lt;b&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;LCD.c File&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;/*
 * lcd.c
 *
 *  Created on: Sep 30, 2023
 *      Author: Geelabs
 */
#include &quot;stm32f1xx_hal.h&quot;
#include &quot;lcd.h&quot;
#include &quot;main.h&quot;



extern void Delay_Us (uint16_t us);
void lcd_Strobe(void)
{

	HAL_GPIO_WritePin(GPIOB,GPIO_PIN_11, GPIO_PIN_SET);// LCD Enable PIN to High
    HAL_Delay(1);   
    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_11, RESET);// LCD Enable High to Low
    HAL_Delay(1);
 }

void lcd_init(void)
{

  HAL_Delay(40);
  lcd_cmd(0x03);
  HAL_Delay(5);
  lcd_cmd(0x03);
  HAL_Delay(1);
  lcd_cmd(0x03);
  HAL_Delay(10);
  lcd_cmd(0x02); // Function set --&amp;gt; DL=0 (4 bit mode), N = 1 (2 line display) F = 0 (5x8 characters)
  HAL_Delay(1);
  lcd_cmd(0x28);
  lcd_cmd(0x08);
  HAL_Delay(10);
  lcd_cmd(0x00);
  lcd_cmd(0x01);
  HAL_Delay(3);
  lcd_cmd(0x00);

   lcd_cmd(0x0c);            // Make cursorinvisible
   lcd_Clear();            // Clear screen
   lcd_cmd(0x6);            // Set entry Mode(auto increment of cursor)
}

void lcd_cmd(__uint16_t cmd)
{
	    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);
        cmd = (cmd &amp;lt;&amp;lt; 8) ;
        GPIOB-&amp;gt;ODR =  (cmd &amp;amp; 0xf000);
        lcd_Strobe();
        cmd = (cmd &amp;lt;&amp;lt; 4) ;
        GPIOB-&amp;gt;ODR =  (cmd &amp;amp; 0xf000);
        lcd_Strobe();
}


void lcd_data(__uint16_t lcd_data)
{
    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
     lcd_data = (lcd_data &amp;lt;&amp;lt; 8) ;
     GPIOB-&amp;gt;ODR =  (lcd_data&amp;amp; 0xf000)|0x400;
     lcd_Strobe();
     lcd_data = (lcd_data &amp;lt;&amp;lt; 4) ;
     GPIOB-&amp;gt;ODR =  (lcd_data &amp;amp; 0xf000)|0x400;
     lcd_Strobe();
   }


void lcd_Clear(void)
{
    lcd_cmd(0x01);
    HAL_Delay(5);
}

void lcd_String(const char *ptr)  // ptr pointing the address of displaying string
{
    while (*ptr)             // check weather the endo of file then exit the loop
    {
        lcd_data(*ptr++);    // Sending data to LCD_data functions
    }
}




&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/4919394409992872885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2023/10/16x2-lcd-interfacing-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4919394409992872885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4919394409992872885'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2023/10/16x2-lcd-interfacing-with.html' title='16x2 LCD  Interfacing with STM32,STM32F103C6'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTPGx2dYPLj8-4B85uMiASlZ5B1dYZfmuLGtvxnNGjRH7X1WnzstdI0IuSeoo2yaX9OXpNW5p7p-DyytUe4U77DFuwN7sg_Z5IHP8p1D8sjUfkVxcevOKmuY9jgL-CXMXehpyx2EGmDaFjpeEUdYNmI3a6z07AIRba5F4utVUkn8nIiJfNUizfmdwCja5/s72-w503-h269-c/Screenshot%202023-10-07%20101642.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-4831764964920839754</id><published>2023-02-18T19:43:00.000+05:30</published><updated>2023-02-18T19:43:00.872+05:30</updated><title type='text'></title><content type='html'>&lt;p&gt;The 16F877 is a microcontroller developed by Microchip Technology, which is capable of supporting the Serial Peripheral Interface (SPI) communication protocol. The SPI protocol is a synchronous serial communication protocol that allows devices to exchange data with each other. In order to use the SPI protocol with the 16F877 microcontroller, you need to follow these steps:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Configure the SPI pins: The 16F877 has dedicated pins for SPI communication, which are RB0 (SS), RB1 (SDO), RB2 (SDI), and RB3 (SCK). You need to configure these pins as digital I/O pins and set their direction as input or output, depending on the functionality you want to implement.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Configure the SPI module: The 16F877 has an SPI module that can be configured using the SPBRG (SPI Baud Rate Generator) register. This register sets the clock speed for the SPI communication, and its value depends on the system clock frequency and the desired baud rate. You also need to configure the SPI control register (SSPSTAT) and the SPI control register (SSPCON), which define the SPI mode, clock polarity, and data order.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Implement SPI communication: Once the SPI pins and module are configured, you can implement SPI communication between the 16F877 microcontroller and other SPI devices. To send data from the 16F877 to another device, you need to write the data to the SPI buffer register (SSPBUF) and then wait for the transfer to complete. To receive data from another device, you need to read the data from the SPI buffer register after the transfer has completed.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here is some sample code in C language for implementing SPI communication using the 16F877 microcontroller:&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre style=&quot;border-radius: var(--br-md); border: 0px; box-sizing: inherit; color: var(--highlight-color); font-family: var(--ff-mono); font-size: var(--fs-body1); font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;border-radius: var(--br-md); border: 0px; box-sizing: inherit; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: var(--lh-md); margin-bottom: calc(1.5em); margin-top: 0px; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: var(--su12); vertical-align: baseline; width: auto;&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW04yu84rRQvvn-KA-S0Inp0psYXMMe1tJtGkQXyB5ThmEqUYJ3dZCwC7elt8cebe-NtFX1u9elAGOL7tbQwDZ60TxqdmqcZM5xvtIINKmpRchXToLZtug9BWt6WUIO2qs_6ZL3AjR_U8T/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; #include &amp;lt;pic16f877.h&amp;gt;  
 #include &amp;lt;xc.h&amp;gt;  
 void spi_init()  
 {  
   // Configure SPI module  
   SSPCON = 0b00100000; // SPI Master, clock = Fosc/4  
   SSPSTAT = 0b00000000; // Data sampled at middle of data output time  
   // Configure pins  
   TRISC5 = 0; // SDO as output  
   TRISC4 = 1; // SDI as input  
   TRISC3 = 0; // SCK as output  
 }  
 void spi_write(char data)  
 {  
   SSPBUF = data; // Write data to buffer  
   while (!SSPIF); // Wait for transmission to complete  
   SSPIF = 0; // Clear flag  
 }  
 char spi_read()  
 {  
   SSPBUF = 0x00; // Write dummy data to initiate read  
   while (!SSPIF); // Wait for reception to complete  
   SSPIF = 0; // Clear flag  
   return SSPBUF; // Return received data  
 }  
 void main()  
 {  
   spi_init();  
   spi_write(0x55); // Write data to SPI  
   char data = spi_read(); // Read data from SPI  
 }  
 Note that this is just a simple example, and the specific configuration of the SPI module will depend on the requirements of your particular project.  
&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/4831764964920839754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2023/02/the-16f877-is-microcontroller-developed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4831764964920839754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4831764964920839754'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2023/02/the-16f877-is-microcontroller-developed.html' title=''/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-1707485944264821246</id><published>2023-02-17T21:42:00.002+05:30</published><updated>2023-02-17T21:42:23.839+05:30</updated><title type='text'>OLED Interface with PIC16f877A by using SPI Communication</title><content type='html'>To interface an OLED display with SPI using a PIC16F877A microcontroller, you can follow these general steps:

Choose an OLED display that supports SPI communication. Make sure to read the datasheet and understand how to communicate with the display using SPI.

Configure the SPI module of the PIC16F877A. The PIC16F877A has a built-in SPI module that can be configured to work in Master mode. You will need to set the appropriate registers to configure the SPI module, such as the SSPCON register.

Write a software program to communicate with the OLED display. This program should send commands and data to the display using the SPI module of the PIC16F877A. The program will need to follow the communication protocol specified in the OLED display datasheet.

Connect the OLED display to the SPI pins of the PIC16F877A. You will need to connect the MOSI (Master Out Slave In), MISO (Master In Slave Out), and SCK (Serial Clock) pins of the PIC16F877A to the corresponding pins on the OLED display. You may also need to connect additional pins for chip select (CS) and data/command select (DC).

Test the OLED display. Once you have written the program and connected the OLED display, you can test the communication by sending commands and data to the display and verifying that it responds as expected.

&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; 
                color: #000000; background-color: #eee;
                font-size: 12px; border: 1px dashed #999999;
                line-height: 14px; padding: 5px; 
                overflow: auto; width: 100%&quot;&gt;
       &lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt;

            #include &lt;xc.h&gt;

// Configuration bits
#pragma config FOSC = HS
#pragma config WDTE = OFF
#pragma config PWRTE = OFF
#pragma config BOREN = ON
#pragma config LVP = OFF
#pragma config CPD = OFF
#pragma config WRT = OFF
#pragma config CP = OFF

// Function to initialize the SPI module
void spi_init()
{
    TRISC5 = 0; // SDO pin as output
    TRISC4 = 1; // SDI pin as input
    TRISC3 = 0; // SCK pin as output
    TRISA5 = 0; // CS pin as output
    
    SSPSTAT = 0x00;
    SSPCON = 0x20;
}

// Function to send a command to the OLED display
void oled_cmd(unsigned char cmd)
{
    RA5 = 0; // Set CS low to select the OLED display
    
    SSPBUF = 0x00; // Send the command byte
    while(!SSPSTATbits.BF); // Wait for the transmission to complete
    
    RA5 = 1; // Set CS high to deselect the OLED display
}

// Function to send data to the OLED display
void oled_data(unsigned char data)
{
    RA5 = 0; // Set CS low to select the OLED display
    
    SSPBUF = 0x40; // Send the data byte
    while(!SSPSTATbits.BF); // Wait for the transmission to complete
    
    RA5 = 1; // Set CS high to deselect the OLED display
}

// Main function
void main()
{
    spi_init(); // Initialize the SPI module
    
    oled_cmd(0xAE); // Display off
    
    // Send initialization commands (see SSD1306 datasheet for details)
    oled_cmd(0xD5);
    oled_cmd(0x80);
    oled_cmd(0xA8);
    oled_cmd(0x3F);
    oled_cmd(0xD3);
    oled_cmd(0x00);
    oled_cmd(0x40);
    oled_cmd(0x8D);
    oled
}

       &lt;/code&gt;
 &lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/1707485944264821246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2023/02/oled-interface-with-pic16f877a-by-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1707485944264821246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1707485944264821246'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2023/02/oled-interface-with-pic16f877a-by-using.html' title='OLED Interface with PIC16f877A by using SPI Communication'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-473912970077874086</id><published>2023-02-17T21:34:00.000+05:30</published><updated>2023-02-17T21:34:12.258+05:30</updated><title type='text'>PWM sinewave generation Using for pic16f877a </title><content type='html'>To generate a PWM sine wave using a PIC16F877A microcontroller, you can use the following steps:

1)Configure the Timer2 module of the PIC16F877A microcontroller to generate a PWM signal. The PWM frequency can be set by configuring the PR2      
  register and the duty cycle can be set by configuring the CCPR1L and CCP1CON registers.

2)Generate a sine wave lookup table using a spreadsheet software or an online tool. The lookup table should contain the sine values for one cycle of    the wave, ranging from 0 to 2π.

3)Store the sine wave lookup table in the program memory of the microcontroller.

4) Set up a Timer1 module of the PIC16F877A microcontroller to generate interrupts at a frequency that is equal to the desired frequency of the sine    wave. In the interrupt service routine (ISR) for Timer1, read the values from the sine wave lookup table and update the duty cycle of the PWM      
   signal generated by Timer2.

&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; 
                color: #000000; background-color: #eee;
                font-size: 12px; border: 1px dashed #999999;
                line-height: 14px; padding: 5px; 
                overflow: auto; width: 100%&quot;&gt;
       &lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt;

            #include &lt;xc.h&gt;

// sine wave lookup table
const unsigned char sine_table[64] = {128,140,152,163,174,185,195,205,214,222,230,237,243,248,252,255,
                                      255,255,252,248,243,237,230,222,214,205,195,185,174,163,152,140,
                                      128,116,104,93,82,71,61,51,42,34,26,19,13,8,4,0,
                                      0,0,4,8,13,19,26,34,42,51,61,71,82,93,104,116};

// timer1 ISR
void __interrupt() timer1_isr(void) {
    static unsigned char table_index = 0;
    
    // update duty cycle of PWM signal generated by timer2
    CCPR1L = sine_table[table_index];
    
    // increment table index
    table_index++;
    if (table_index &gt;= 64) {
        table_index = 0;
    }
}

void main(void) {
    // configure timer2 for PWM generation
    T2CON = 0b00000111; // prescaler = 1, postscaler = 1, timer2 on
    PR2 = 255; // set PWM frequency
    CCP1CON = 0b00001100; // PWM mode, PWM duty cycle controlled by CCPR1L
    
    // configure timer1 for interrupt generation
    T1CON = 0b00110101; // prescaler = 8, timer1 on, enable timer1 interrupt
    TMR1IF = 0; // clear timer1 interrupt flag
    TMR1H = 0xFC; // set timer1 reload value for 50 Hz interrupt frequency
    TMR1L = 0x18;
    PEIE = 1; // enable peripheral interrupts
    GIE = 1; // enable global interrupts
    
    while (1) {
        // main program loop
    }
}

       &lt;/code&gt;
 &lt;/pre&gt;




  
  
  
  
In this example code, the sine wave lookup table contains 64 values, so the Timer1 module is configured to generate interrupts at a frequency of 50 Hz (the table is updated once per cycle). The Timer2 module is configured to generate a PWM signal with a frequency of 8 kHz. The duty cycle of the PWM signal is updated in the Timer1 ISR by reading the values from the sine wave lookup table.



</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/473912970077874086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2023/02/pwm-sinewave-generation-using-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/473912970077874086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/473912970077874086'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2023/02/pwm-sinewave-generation-using-for.html' title='PWM sinewave generation Using for pic16f877a '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-6319404342754667289</id><published>2020-07-05T22:08:00.003+05:30</published><updated>2020-09-30T07:35:05.645+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="dsPIC"/><title type='text'>dsPIC33 PWM Controlls iin accordance with ADC value </title><content type='html'>&lt;font size=&quot;5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;#b51200&quot;&gt;dsPIC33 PWM Controlls iin accordance with ADC value&lt;/font&gt;&amp;nbsp;&lt;/font&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiLucwwV_uTLyZASHGR0Pd3YgYdjECjPmFI4fWJzHlmxVKm5r_ryiNjHmdr_imydEKOqbmJUmrH1R-ViDb3dR600-l8RcggXlroSe1zmpreVrBIEpo-Bc-sYKYAmOxOyuLYuxGA1Fl1-vU/s719/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;514&quot; data-original-width=&quot;719&quot; height=&quot;458&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiLucwwV_uTLyZASHGR0Pd3YgYdjECjPmFI4fWJzHlmxVKm5r_ryiNjHmdr_imydEKOqbmJUmrH1R-ViDb3dR600-l8RcggXlroSe1zmpreVrBIEpo-Bc-sYKYAmOxOyuLYuxGA1Fl1-vU/w640-h458/1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWrOrNLqW56gguAWECW2OEcm9I6Kc97FVBWyYIFgYuxmvPj0jzh5TEsajm5HlgZiVMsxZot7hjr37Dy3h83G2xcrfU1KPIzhv_-kIRBiOBIinIY5qTg80lLKre5CGKEaig11c6_UADyVQ/s707/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;610&quot; data-original-width=&quot;707&quot; height=&quot;552&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWrOrNLqW56gguAWECW2OEcm9I6Kc97FVBWyYIFgYuxmvPj0jzh5TEsajm5HlgZiVMsxZot7hjr37Dy3h83G2xcrfU1KPIzhv_-kIRBiOBIinIY5qTg80lLKre5CGKEaig11c6_UADyVQ/w640-h552/2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihjR1xF1r_Hb1QadYQaAtpspIGjdhcrv8Mmv4i1cnEHpkRUj3BvSyopmXH_J1MjKRdk7qGxws3clK33EPXn9Z1YSGv52Be_1ikNmLUbxJbGR3Rraf25IJQ5IpvWIGivtpdqeBP4XAEE2Y7/s689/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;392&quot; data-original-width=&quot;689&quot; height=&quot;364&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihjR1xF1r_Hb1QadYQaAtpspIGjdhcrv8Mmv4i1cnEHpkRUj3BvSyopmXH_J1MjKRdk7qGxws3clK33EPXn9Z1YSGv52Be_1ikNmLUbxJbGR3Rraf25IJQ5IpvWIGivtpdqeBP4XAEE2Y7/w640-h364/3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjxeL5C2gj7yQ8qe-_ZkJw4nNdWOUXT35Ugm-2T5qW1xgAuiPL76ZBuoue84H7B3tBXuTf7vqc6bMsWsdtAE5evtVRp844eY4EXh_3WSvH61bWFBoqmCGKZQMeRlklD8X27OI50xp_VQyr/s674/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;442&quot; data-original-width=&quot;674&quot; height=&quot;420&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjxeL5C2gj7yQ8qe-_ZkJw4nNdWOUXT35Ugm-2T5qW1xgAuiPL76ZBuoue84H7B3tBXuTf7vqc6bMsWsdtAE5evtVRp844eY4EXh_3WSvH61bWFBoqmCGKZQMeRlklD8X27OI50xp_VQyr/w640-h420/4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;font size=&quot;5&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/6319404342754667289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2020/07/dspic33-pwm-controlls-iin-accordance_5.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/6319404342754667289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/6319404342754667289'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2020/07/dspic33-pwm-controlls-iin-accordance_5.html' title='dsPIC33 PWM Controlls iin accordance with ADC value '/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiLucwwV_uTLyZASHGR0Pd3YgYdjECjPmFI4fWJzHlmxVKm5r_ryiNjHmdr_imydEKOqbmJUmrH1R-ViDb3dR600-l8RcggXlroSe1zmpreVrBIEpo-Bc-sYKYAmOxOyuLYuxGA1Fl1-vU/s72-w640-h458-c/1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-4269836867489183617</id><published>2020-07-05T22:08:00.002+05:30</published><updated>2020-07-05T22:08:41.210+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="dsPIC"/><title type='text'>dsPIC33 PWM Controlls iin accordance with ADC value </title><content type='html'>&lt;font size=&quot;5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;#b51200&quot;&gt;dsPIC33 PWM Controlls iin accordance with ADC value&lt;/font&gt;&amp;nbsp;&lt;/font&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiLucwwV_uTLyZASHGR0Pd3YgYdjECjPmFI4fWJzHlmxVKm5r_ryiNjHmdr_imydEKOqbmJUmrH1R-ViDb3dR600-l8RcggXlroSe1zmpreVrBIEpo-Bc-sYKYAmOxOyuLYuxGA1Fl1-vU/s719/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;514&quot; data-original-width=&quot;719&quot; height=&quot;458&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiLucwwV_uTLyZASHGR0Pd3YgYdjECjPmFI4fWJzHlmxVKm5r_ryiNjHmdr_imydEKOqbmJUmrH1R-ViDb3dR600-l8RcggXlroSe1zmpreVrBIEpo-Bc-sYKYAmOxOyuLYuxGA1Fl1-vU/w640-h458/1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWrOrNLqW56gguAWECW2OEcm9I6Kc97FVBWyYIFgYuxmvPj0jzh5TEsajm5HlgZiVMsxZot7hjr37Dy3h83G2xcrfU1KPIzhv_-kIRBiOBIinIY5qTg80lLKre5CGKEaig11c6_UADyVQ/s707/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;610&quot; data-original-width=&quot;707&quot; height=&quot;552&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWrOrNLqW56gguAWECW2OEcm9I6Kc97FVBWyYIFgYuxmvPj0jzh5TEsajm5HlgZiVMsxZot7hjr37Dy3h83G2xcrfU1KPIzhv_-kIRBiOBIinIY5qTg80lLKre5CGKEaig11c6_UADyVQ/w640-h552/2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihjR1xF1r_Hb1QadYQaAtpspIGjdhcrv8Mmv4i1cnEHpkRUj3BvSyopmXH_J1MjKRdk7qGxws3clK33EPXn9Z1YSGv52Be_1ikNmLUbxJbGR3Rraf25IJQ5IpvWIGivtpdqeBP4XAEE2Y7/s689/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;392&quot; data-original-width=&quot;689&quot; height=&quot;364&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihjR1xF1r_Hb1QadYQaAtpspIGjdhcrv8Mmv4i1cnEHpkRUj3BvSyopmXH_J1MjKRdk7qGxws3clK33EPXn9Z1YSGv52Be_1ikNmLUbxJbGR3Rraf25IJQ5IpvWIGivtpdqeBP4XAEE2Y7/w640-h364/3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjxeL5C2gj7yQ8qe-_ZkJw4nNdWOUXT35Ugm-2T5qW1xgAuiPL76ZBuoue84H7B3tBXuTf7vqc6bMsWsdtAE5evtVRp844eY4EXh_3WSvH61bWFBoqmCGKZQMeRlklD8X27OI50xp_VQyr/s674/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;442&quot; data-original-width=&quot;674&quot; height=&quot;420&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjxeL5C2gj7yQ8qe-_ZkJw4nNdWOUXT35Ugm-2T5qW1xgAuiPL76ZBuoue84H7B3tBXuTf7vqc6bMsWsdtAE5evtVRp844eY4EXh_3WSvH61bWFBoqmCGKZQMeRlklD8X27OI50xp_VQyr/w640-h420/4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;font size=&quot;5&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/4269836867489183617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2020/07/dspic33-pwm-controlls-iin-accordance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4269836867489183617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4269836867489183617'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2020/07/dspic33-pwm-controlls-iin-accordance.html' title='dsPIC33 PWM Controlls iin accordance with ADC value '/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiLucwwV_uTLyZASHGR0Pd3YgYdjECjPmFI4fWJzHlmxVKm5r_ryiNjHmdr_imydEKOqbmJUmrH1R-ViDb3dR600-l8RcggXlroSe1zmpreVrBIEpo-Bc-sYKYAmOxOyuLYuxGA1Fl1-vU/s72-w640-h458-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-8676848636260862449</id><published>2020-03-15T20:55:00.003+05:30</published><updated>2020-03-15T20:56:36.162+05:30</updated><title type='text'>Attemt to Access  Keyboard</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;604&quot; data-original-width=&quot;846&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s640/Capture.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot;brush:c++&quot;&gt; *&lt;b&gt; main.c&lt;/b&gt;
 *
 *  Created on: Aug 12, 2017
 *      Author: thannara123
 



#include&lt;stdio .h=&quot;&quot;&gt;
#define FALSE 0
#define TRUE  1  // 0r //!FALSE
struct menu
 {
   char menu_up_key;
   char menu_down_key;
   char menu_enter_key :1; // bit feild 1 bit
 };
struct menu s1= {0}; //s1.menu_up-key =1;
void struct_1( struct menu,const char *menu_display[]);



int main()
{

     const char *menu_display[10];
      menu_display[0] = &quot;Menu0&quot;;
      menu_display[1] = &quot;Menu1&quot;;
      menu_display[2] = &quot;Menu2&quot;;
      menu_display[3] = &quot;Menu3&quot;;
      menu_display[4] = &quot;Menu4&quot;;
      menu_display[5] = &quot;menu 5&quot;;
      menu_display[6] = &quot;menu 6&quot;;


       struct_1(s1,menu_display);
             getchar();
             return 0;

      }


void struct_1(struct menu s1 ,const char *menu_display[])
{

     char ch;
      do{
            ch=getch();


            if(ch!=&#39;\0&#39;)
            {
              ch=getch();
              if(ch==&#39;H&#39;)
              {
               s1.menu_up_key++;
               if(s1.menu_up_key==7)
                 s1.menu_up_key =0;
            // printf(&quot;UP\n&quot;);
                  printf(&quot; %s\n&quot;,*(s1.menu_up_key+menu_display));
               }
         else    if(ch==&#39;P&#39;)
               {
              s1.menu_up_key--;
              if(s1.menu_up_key==-1)
                  {  s1.menu_up_key =6;
                   goto here;
                  }
                //printf(&quot;down\n&quot;);

                  here:
         printf(&quot;%s\n&quot;,*(s1.menu_up_key+menu_display));


                   }

            }
               }
              while(ch!=&#39;e&#39;);// while oka key
}
&lt;/stdio&gt;&lt;/pre&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;/*
 * button_key.c
 *
 * Created: 7/30/2017 12:02:39 PM
 *  Author: Krishna
 */ #include &lt;avr io.h=&quot;&quot;&gt;
 #include &quot;delay.h&quot;
  #include &quot;button_key.h&quot;
  #include &quot;lcd.h&quot;  
    
void menu_key_display(struct menu s1,const char *menu_display[]);
void UP_Down_Keyvalue(struct menu s1,int i,int j);

 /* Function Key Value For get key  */
int Key_pressed(void)
 { 
 while(1){
    if (LEFT_S) {  while(LEFT_S);return 1; }      
 if (RIGHT_S){  while(RIGHT_S);return 2; }
 if (UP_S)  {  while(UP_S); return 3; }
 if (DOWN_S) { while(DOWN_S);return 4 ; }
 if (OK_S) { while(OK_S);return 5 ; }
 } 
 } 
 
 
 /* Function Key Value For Up Key  &amp;amp; Enter*/
 
 void menu_key_display(struct menu s1,const char *menu_display[])
 {   
  int ch; 
   int a; 
  int  menu_position =0;
   LCD_DisplayString(menu_display[menu_position]);
            do{  
    
    repat:          
    ch = Key_pressed();
    if(ch==1||ch==2)
    {
                  if(ch==2)
                    {  if(ch==2)
                   { if(s1.menu_side_key==4)
                     s1.menu_side_key = 0;
                  LCD_Clear();
                  LCD_GoToLine(0);
                              LCD_DisplayString(*((++s1.menu_side_key)+menu_display)); 
         menu_position=1;            
         
                 } 
                      }
                   else if(ch==1)
                   {   
                             if(ch==1)
                    {if(s1.menu_side_key==1 ||s1.menu_side_key==0)
                      {
                    s1.menu_side_key=5;
                      }
                      LCD_Clear();
                            LCD_DisplayString(*((--s1.menu_side_key)+menu_display));                            
          menu_position=1;   
                         }
                   }  
          }
      
    if(menu_position==0)
    goto repat;
        }while(ch!=5);
       
        a = s1.menu_side_key; 
  switch(a)
     { 
 case 1: // set time
          { 
    LCD_Clear();
       LCD_GoToLine(0);
       LCD_DisplayString(menu_display[5]);
    LCD_GoToLine(1);
    LCD_DisplayString(&quot;  HH:MM:SS:PM/AM&quot;);
    UP_Down_Keyvalue(s1,2,4);    
          break;
          } 
 case 2: // Set date
        {
         LCD_Clear();
         LCD_GoToLine(0);
         LCD_DisplayString(menu_display[6]);
      LCD_GoToLine(1);
      LCD_DisplayString(&quot;  DD:MM:YY&quot;);
      UP_Down_Keyvalue(s1,2,3);     
         break;
        }
 
 case 3: // set alarm
          {
         LCD_Clear();
            LCD_GoToLine(0);
         LCD_DisplayString(menu_display[7]);
      LCD_GoToLine(1);
      LCD_DisplayString(&quot; HH:MM:SS:AM/PM&quot;);
      UP_Down_Keyvalue(s1,2,4);      
          break;
             }
 case 4:  // set alarm
           {
            LCD_Clear();
          LCD_GoToLine(0);
          LCD_DisplayString(menu_display[8]);
    LCD_GoToLine(1);
    LCD_DisplayString(&quot;  HH:MM:SS:PM/AM&quot;);
    UP_Down_Keyvalue(s1,2,4);    
          break;
            }
     } 
    
  while(Key_pressed()!=5); 
  
       
 } 
 
 
 
 
 /* Function Key Value For UP_Down Key */
 void UP_Down_Keyvalue(struct menu s1,int i,int j)
 {    
  
  int ch,lower,upper;    
  do{  
    if(j==4)
     {
      if(i==2)upper=1;
      if(i==3)upper=9;
      if(i==5)upper=5;
      if(i==8)upper =5;
      if(i==9)upper =9;
     } 
      if(UP_S)   
      {
      while(UP_S);    
      if(s1.menu_up_key==upper)
      s1.menu_up_key = lower-1;
      LCD_GoToXY(1,i); 
      LCD_Printf(&quot;%d&quot;,++s1.menu_up_key);
      s1.time[i-2]=s1.menu_up_key;          
      }
   else if(DOWN_S) // down 
             
          {    while(DOWN_S);
            if (s1.menu_up_key==lower)
            s1.menu_up_key = upper+1;        
            LCD_GoToXY(1,i);
            LCD_Printf(&quot;%d&quot;,--s1.menu_up_key);
      s1.time[i-2]=s1.menu_up_key;       
     }
          if(RIGHT_S)
       
             { while(RIGHT_S);
       s1.menu_up_key=0;
          if(i==9) goto exit1;
          if(i==3||i==6)
          ++i;
          i++;
              }
      exit1:
           if (LEFT_S)
             { while(LEFT_S);
        s1.menu_up_key=0;
            if(i==2) goto exit2;         
            if(i==5||i==8)
            --i;
            i--;
     
             }
    exit2:continue;
   
   
  } while (ch!=5);  // if Okay key exit loop
  
 }
 
 
 
See You 


&lt;/avr&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/8676848636260862449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2020/03/attemt-to-access-computer-keyboard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8676848636260862449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8676848636260862449'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2020/03/attemt-to-access-computer-keyboard.html' title='Attemt to Access  Keyboard'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-1232820860286492242</id><published>2020-03-15T20:52:00.001+05:30</published><updated>2020-09-30T07:35:06.212+05:30</updated><title type='text'>Transformer-configuration-in-proteus</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;u&gt;Setting up A Transformer in Proteus&lt;/u&gt;&lt;/h2&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;The calculation Formula is&amp;nbsp; L1/L2 = (V1/V2)^2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For Example: Design for 6 Volt input ,230volt 50Hz Not considered wattage just for simulation.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assign L1 = 1H (but 1henry&amp;nbsp;expectable for a 10 or 20 kW transformer)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Then L2 =&amp;nbsp;1/(230/6)^2&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 680.5293micro Henry&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWF2pAZDKQ2bqUqmZqp-uShXpTJwRJRDQOXv8xMgWfd451PKs4G8WApYqx296LAroKxvjlZZHdAWBqAjzQdFdb3sqX4bgVz1ZC8HDt8XFXfhBqRX5uJH8aq-4eBzjLpY-euirs3qBHTzdd/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;503&quot; data-original-width=&quot;765&quot; height=&quot;420&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWF2pAZDKQ2bqUqmZqp-uShXpTJwRJRDQOXv8xMgWfd451PKs4G8WApYqx296LAroKxvjlZZHdAWBqAjzQdFdb3sqX4bgVz1ZC8HDt8XFXfhBqRX5uJH8aq-4eBzjLpY-euirs3qBHTzdd/s640/Capture.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.edaboard.com/showthread.php?t=373967&amp;amp;p=1601905#post1601905&quot;&gt;more&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/1232820860286492242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2020/03/transformer-configuration-in-proteus_15.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1232820860286492242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1232820860286492242'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2020/03/transformer-configuration-in-proteus_15.html' title='Transformer-configuration-in-proteus'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWF2pAZDKQ2bqUqmZqp-uShXpTJwRJRDQOXv8xMgWfd451PKs4G8WApYqx296LAroKxvjlZZHdAWBqAjzQdFdb3sqX4bgVz1ZC8HDt8XFXfhBqRX5uJH8aq-4eBzjLpY-euirs3qBHTzdd/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-1223468481748070200</id><published>2020-03-15T20:52:00.000+05:30</published><updated>2020-03-15T20:52:01.709+05:30</updated><title type='text'>Transformer-configuration-in-proteus</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;u&gt;Setting up A Transformer in Proteus&lt;/u&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div&gt;
The calculation Formula is&amp;nbsp; L1/L2 = (V1/V2)^2&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For Example: Design for 6 Volt input ,230volt 50Hz Not considered wattage just for simulation.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assign L1 = 1H (but 1henry&amp;nbsp;expectable for a 10 or 20 kW transformer)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Then L2 =&amp;nbsp;1/(230/6)^2&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 680.5293micro Henry&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWF2pAZDKQ2bqUqmZqp-uShXpTJwRJRDQOXv8xMgWfd451PKs4G8WApYqx296LAroKxvjlZZHdAWBqAjzQdFdb3sqX4bgVz1ZC8HDt8XFXfhBqRX5uJH8aq-4eBzjLpY-euirs3qBHTzdd/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;503&quot; data-original-width=&quot;765&quot; height=&quot;420&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWF2pAZDKQ2bqUqmZqp-uShXpTJwRJRDQOXv8xMgWfd451PKs4G8WApYqx296LAroKxvjlZZHdAWBqAjzQdFdb3sqX4bgVz1ZC8HDt8XFXfhBqRX5uJH8aq-4eBzjLpY-euirs3qBHTzdd/s640/Capture.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://www.edaboard.com/showthread.php?t=373967&amp;amp;p=1601905#post1601905&quot;&gt;more&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/1223468481748070200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2020/03/transformer-configuration-in-proteus.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1223468481748070200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1223468481748070200'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2020/03/transformer-configuration-in-proteus.html' title='Transformer-configuration-in-proteus'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWF2pAZDKQ2bqUqmZqp-uShXpTJwRJRDQOXv8xMgWfd451PKs4G8WApYqx296LAroKxvjlZZHdAWBqAjzQdFdb3sqX4bgVz1ZC8HDt8XFXfhBqRX5uJH8aq-4eBzjLpY-euirs3qBHTzdd/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-8315905910563462216</id><published>2019-04-03T19:48:00.003+05:30</published><updated>2020-09-30T07:35:06.484+05:30</updated><title type='text'>Atmeag8 /AVR based Voltmeter</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: x-large;&quot;&gt;Tutorial for Atmeag8 /AVR based Voltmeter&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;t measures the Ac voltage and shows readings in RMS value.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Basics Of AC signal&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;The AC signal ,its amplitude varying in accordance with time. In india AC frequency is 50Hz.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Then the Time period one full cycle &lt;/b&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuzfGQby4Ur0iup0oeX_cNHjtyFURNkJI3oqxaFfkErTnSX-dqeKYfStJZEW2SaOsYcJd8vqpdzdBQ3CqxLUHcFqqWHiLWt2fNjJ2o-Sx-xWMky-YiOxwpWBvCnIv-60xDg_OSTPi7idC/s1600/fig1-1.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;299&quot; data-original-width=&quot;450&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuzfGQby4Ur0iup0oeX_cNHjtyFURNkJI3oqxaFfkErTnSX-dqeKYfStJZEW2SaOsYcJd8vqpdzdBQ3CqxLUHcFqqWHiLWt2fNjJ2o-Sx-xWMky-YiOxwpWBvCnIv-60xDg_OSTPi7idC/s320/fig1-1.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; T = 1/frequency&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; T = 1/50Hz = .002second&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 20milli Second&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 10 Milli second &lt;/b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;for Half Cycle&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;There are a lot of methods for measuring AC volt digitally&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;we could find the RMS value by multipliying the Peak Voltage with 0.707.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;Vrms = Peak Voltage * 0.707 .&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Approximatly Indian Line AC Peak volatge is 325v.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; Example :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;325v *0.707 = 229.775Volt&amp;nbsp; &amp;nbsp; &amp;nbsp; .(appro = 230Vrms).&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;But Microcontroller could only sense&amp;nbsp; up to 5 volt&amp;nbsp; as well as it couldnt sense negative values&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;so we cannot&amp;nbsp; give 230 volt directly to It .&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;It can be rectify&amp;nbsp;by using a Stepdown transformer ,which has an advantage of&amp;nbsp;safety.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Ac voltage can be reduce by using transformer to comfortable range . (ie 0 to 5volt DC)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;make the calculation&amp;nbsp; as&amp;nbsp; &amp;nbsp;,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;The voltage Divider would give a 5 volt when the Vrms 230v. &lt;/b&gt;[&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;will be more give details on the way&lt;/b&gt; &lt;/span&gt;].&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghLDfw04UYSJ9BjXYnTv88o8Fi1zcjwkM5lYwCqkM8851HGno1cMJ5kM23g7slbnvk0JYoyK7wA7FMp4S8OnsB0xF8NraocaE5MnmB-DdCU6V0IXxoOExLXVvoD6w6jH5j1RLUpLxoEj1P/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;278&quot; data-original-width=&quot;857&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghLDfw04UYSJ9BjXYnTv88o8Fi1zcjwkM5lYwCqkM8851HGno1cMJ5kM23g7slbnvk0JYoyK7wA7FMp4S8OnsB0xF8NraocaE5MnmB-DdCU6V0IXxoOExLXVvoD6w6jH5j1RLUpLxoEj1P/s1600/Capture.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;The full wave rectifier output will give to ADC of micro controller&amp;nbsp;. Then do corresponding coding.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Microcontroller Section&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;I am using here &lt;/span&gt;&lt;a href=&quot;https://www.google.co.in/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwj68_HXuaDYAhUMRo8KHZ9PDBcQFggoMAA&amp;amp;url=http%3A%2F%2Fwww.atmel.com%2FImages%2FAtmel-2486-8-bit-AVR-microcontroller-ATmega8_L_datasheet.pdf&amp;amp;usg=AOvVaw3TZJjZKL3jYrLyxAg6v1Vc&quot; style=&quot;font-size: medium;&quot;&gt;Amega8.&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;we need to mesure only one half cycles repeatedly because&amp;nbsp;&amp;nbsp;the waves same are repeating&amp;nbsp;&lt;/span&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;Basics&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;I selected , the F_cpu frequency is the internal RC Oscillator 8MHz.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Atmega8 ADC uses Prescalar [frequency reducer or divider by 2th,4th etc]&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Atmega ADC&amp;nbsp; Prescale Frequency is in between 50Khz to 200Kz&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ADC conversion time is in between 13 to 260 micro second.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ADC frequency = F_cpu / Prescaler&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 800,000HZ&amp;nbsp; / 8&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 62.5KHz&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;At high frequency ADC conversion would be fast while at lower frequency the conversion will be more accuracy.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ADC conversion time Calculation&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Conversion Time = 1/ADC frequency&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 1/62500&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 0.000016 Second&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 0.016 Milli Second&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 16 Micro Second.&amp;nbsp; &amp;nbsp; &amp;nbsp;[At 62.500KHz]&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;So 16 mirco second would taken for one cycle of&amp;nbsp; conversion.with 62,5KHz.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;13 ADC cycles required for one conversion&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ie,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; 13 * 16Micro Second = 230 Micro Second [approximately]&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 230us.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The Half wave has 10milli second time duration.[100000microsecond].&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;There the available conversion times is&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;nbsp; Total time period for a half cycle /one ADC conversion time&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 10000 micro second / 230 micro second&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 43.4 samples&amp;nbsp; [ for one half cycleie 10 milli second]&lt;/span&gt;&lt;/div&gt;&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;!-- 34 --&gt;&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-8429441124104529&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;9743413999&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;&lt;script&gt;(adsbygoogle = window.adsbygoogle || []).push({}); &lt;/script&gt;    &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivNYe9f6KpmSEUNAH4lIGRGif64ieKidE8i1Ef55_8CP_4SXZia0HrHOewTrWBBmIjE-ovqJYavhxVFE0eCV9Cew0gzFiC66lLbVTugFACN8io1kUG1opml6hQCExpUUVCD7yp6glZKMDu/s1600/wQxld+copy.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;221&quot; data-original-width=&quot;410&quot; height=&quot;344&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivNYe9f6KpmSEUNAH4lIGRGif64ieKidE8i1Ef55_8CP_4SXZia0HrHOewTrWBBmIjE-ovqJYavhxVFE0eCV9Cew0gzFiC66lLbVTugFACN8io1kUG1opml6hQCExpUUVCD7yp6glZKMDu/s640/wQxld+copy.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: 400;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: 400;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: small;&quot;&gt; Image Shows only 7 Samples per half cycles&amp;nbsp;.in our case it is 43&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;And again reduced the sampling to 40 .&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;calculation of Vpeak&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Takes the largest Vpeak from the 40 samples.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Vrms = Vpeak * .707&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;*****************************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Atmega8 ADC StepSize Calculation&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Atmega8 uses &lt;a href=&quot;https://en.wikipedia.org/wiki/Successive_approximation_ADC&quot;&gt;successive approximation adc&amp;nbsp;&lt;/a&gt;&amp;nbsp;,&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;The Atmega8 ADC is a 10 Bit /[ie the Maximum high value is 1023 =1111111111] at which the ADC will give fullscale Value .&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;The ADC&amp;nbsp; require a clock as well as a reference voltage .&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;The resolution of ADC output decide the Step size.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;ADC o/p = Vin * 1024 / Vref&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Examples;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&amp;nbsp; Vin =5volt , Vref =5volt&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ADC o/p = 5 * 1023 /5 = 1023 [ADC highest Value]&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Step Size&amp;nbsp; voltage = Vref / 1023 = 0.004887 volt =4.88millivolt&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;One binary digit changes when 4.88volt changes takes place&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixjbdYPVuCotpPUtFlkcerw7kf4PvWpiGSoNQ_nzpOf14P4C10QkaS-p9LtZWBaAkjz5EKO1_ijpQRyuCvbeJz-wnzAR3hfhWynLV1F_3TV6FpXEHNmAmcm1zeAW4l8AcpQjImSN-eM2cc/s1600/e7529f241109.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;168&quot; data-original-width=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixjbdYPVuCotpPUtFlkcerw7kf4PvWpiGSoNQ_nzpOf14P4C10QkaS-p9LtZWBaAkjz5EKO1_ijpQRyuCvbeJz-wnzAR3hfhWynLV1F_3TV6FpXEHNmAmcm1zeAW4l8AcpQjImSN-eM2cc/s1600/e7529f241109.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Image&#39;s Step Size is 1.25 volt&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;*******************************************************************************************************&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;http://www.gelectron.co.in/2017/12/design-of-digital-voltmeter-by-using_28.html&quot;&gt;Go Here for Part 2&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/8315905910563462216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/atmeag8-avr-based-voltmeter_3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8315905910563462216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8315905910563462216'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/atmeag8-avr-based-voltmeter_3.html' title='Atmeag8 /AVR based Voltmeter'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuzfGQby4Ur0iup0oeX_cNHjtyFURNkJI3oqxaFfkErTnSX-dqeKYfStJZEW2SaOsYcJd8vqpdzdBQ3CqxLUHcFqqWHiLWt2fNjJ2o-Sx-xWMky-YiOxwpWBvCnIv-60xDg_OSTPi7idC/s72-c/fig1-1.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-3685714464214288058</id><published>2019-04-03T19:48:00.002+05:30</published><updated>2019-04-03T19:48:08.767+05:30</updated><title type='text'>Atmeag8 /AVR based Voltmeter</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: x-large;&quot;&gt;Tutorial for Atmeag8 /AVR based Voltmeter&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;I&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;t measures the Ac voltage and shows readings in RMS value.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Basics Of AC signal&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;The AC signal ,its amplitude varying in accordance with time. In india AC frequency is 50Hz.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Then the Time period one full cycle &lt;/b&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuzfGQby4Ur0iup0oeX_cNHjtyFURNkJI3oqxaFfkErTnSX-dqeKYfStJZEW2SaOsYcJd8vqpdzdBQ3CqxLUHcFqqWHiLWt2fNjJ2o-Sx-xWMky-YiOxwpWBvCnIv-60xDg_OSTPi7idC/s1600/fig1-1.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;299&quot; data-original-width=&quot;450&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuzfGQby4Ur0iup0oeX_cNHjtyFURNkJI3oqxaFfkErTnSX-dqeKYfStJZEW2SaOsYcJd8vqpdzdBQ3CqxLUHcFqqWHiLWt2fNjJ2o-Sx-xWMky-YiOxwpWBvCnIv-60xDg_OSTPi7idC/s320/fig1-1.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; T = 1/frequency&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; T = 1/50Hz = .002second&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 20milli Second&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 10 Milli second &lt;/b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;for Half Cycle&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;There are a lot of methods for measuring AC volt digitally&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;we could find the RMS value by multipliying the Peak Voltage with 0.707.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;Vrms = Peak Voltage * 0.707 .&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Approximatly Indian Line AC Peak volatge is 325v.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; Example :&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;325v *0.707 = 229.775Volt&amp;nbsp; &amp;nbsp; &amp;nbsp; .(appro = 230Vrms).&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;But Microcontroller could only sense&amp;nbsp; up to 5 volt&amp;nbsp; as well as it couldnt sense negative values&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;so we cannot&amp;nbsp; give 230 volt directly to It .&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;It can be rectify&amp;nbsp;by using a Stepdown transformer ,which has an advantage of&amp;nbsp;safety.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Ac voltage can be reduce by using transformer to comfortable range . (ie 0 to 5volt DC)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;make the calculation&amp;nbsp; as&amp;nbsp; &amp;nbsp;,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;The voltage Divider would give a 5 volt when the Vrms 230v. &lt;/b&gt;[&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;will be more give details on the way&lt;/b&gt; &lt;/span&gt;].&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghLDfw04UYSJ9BjXYnTv88o8Fi1zcjwkM5lYwCqkM8851HGno1cMJ5kM23g7slbnvk0JYoyK7wA7FMp4S8OnsB0xF8NraocaE5MnmB-DdCU6V0IXxoOExLXVvoD6w6jH5j1RLUpLxoEj1P/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;278&quot; data-original-width=&quot;857&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghLDfw04UYSJ9BjXYnTv88o8Fi1zcjwkM5lYwCqkM8851HGno1cMJ5kM23g7slbnvk0JYoyK7wA7FMp4S8OnsB0xF8NraocaE5MnmB-DdCU6V0IXxoOExLXVvoD6w6jH5j1RLUpLxoEj1P/s1600/Capture.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;The full wave rectifier output will give to ADC of micro controller&amp;nbsp;. Then do corresponding coding.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;Microcontroller Section&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;I am using here &lt;/span&gt;&lt;a href=&quot;https://www.google.co.in/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwj68_HXuaDYAhUMRo8KHZ9PDBcQFggoMAA&amp;amp;url=http%3A%2F%2Fwww.atmel.com%2FImages%2FAtmel-2486-8-bit-AVR-microcontroller-ATmega8_L_datasheet.pdf&amp;amp;usg=AOvVaw3TZJjZKL3jYrLyxAg6v1Vc&quot; style=&quot;font-size: medium;&quot;&gt;Amega8.&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;we need to mesure only one half cycles repeatedly because&amp;nbsp;&amp;nbsp;the waves same are repeating&amp;nbsp;&lt;/span&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;Basics&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;I selected , the F_cpu frequency is the internal RC Oscillator 8MHz.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Atmega8 ADC uses Prescalar [frequency reducer or divider by 2th,4th etc]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Atmega ADC&amp;nbsp; Prescale Frequency is in between 50Khz to 200Kz&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;ADC conversion time is in between 13 to 260 micro second.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;ADC frequency = F_cpu / Prescaler&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 800,000HZ&amp;nbsp; / 8&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 62.5KHz&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;At high frequency ADC conversion would be fast while at lower frequency the conversion will be more accuracy.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;ADC conversion time Calculation&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Conversion Time = 1/ADC frequency&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 1/62500&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 0.000016 Second&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 0.016 Milli Second&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 16 Micro Second.&amp;nbsp; &amp;nbsp; &amp;nbsp;[At 62.500KHz]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;So 16 mirco second would taken for one cycle of&amp;nbsp; conversion.with 62,5KHz.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;13 ADC cycles required for one conversion&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;ie,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; 13 * 16Micro Second = 230 Micro Second [approximately]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 230us.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The Half wave has 10milli second time duration.[100000microsecond].&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;There the available conversion times is&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;nbsp; Total time period for a half cycle /one ADC conversion time&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 10000 micro second / 230 micro second&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 43.4 samples&amp;nbsp; [ for one half cycleie 10 milli second]&lt;/span&gt;&lt;/div&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- 34 --&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-8429441124104529&quot; data-ad-format=&quot;auto&quot; data-ad-slot=&quot;9743413999&quot; style=&quot;display: block;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;




&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivNYe9f6KpmSEUNAH4lIGRGif64ieKidE8i1Ef55_8CP_4SXZia0HrHOewTrWBBmIjE-ovqJYavhxVFE0eCV9Cew0gzFiC66lLbVTugFACN8io1kUG1opml6hQCExpUUVCD7yp6glZKMDu/s1600/wQxld+copy.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;221&quot; data-original-width=&quot;410&quot; height=&quot;344&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivNYe9f6KpmSEUNAH4lIGRGif64ieKidE8i1Ef55_8CP_4SXZia0HrHOewTrWBBmIjE-ovqJYavhxVFE0eCV9Cew0gzFiC66lLbVTugFACN8io1kUG1opml6hQCExpUUVCD7yp6glZKMDu/s640/wQxld+copy.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small; font-weight: 400;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small; font-weight: 400;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: small;&quot;&gt; Image Shows only 7 Samples per half cycles&amp;nbsp;.in our case it is 43&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;And again reduced the sampling to 40 .&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;calculation of Vpeak&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Takes the largest Vpeak from the 40 samples.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Vrms = Vpeak * .707&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;*****************************************************************************&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Atmega8 ADC StepSize Calculation&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Atmega8 uses &lt;a href=&quot;https://en.wikipedia.org/wiki/Successive_approximation_ADC&quot;&gt;successive approximation adc&amp;nbsp;&lt;/a&gt;&amp;nbsp;,&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;The Atmega8 ADC is a 10 Bit /[ie the Maximum high value is 1023 =1111111111] at which the ADC will give fullscale Value .&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;The ADC&amp;nbsp; require a clock as well as a reference voltage .&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;The resolution of ADC output decide the Step size.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;ADC o/p = Vin * 1024 / Vref&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Examples;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&amp;nbsp; Vin =5volt , Vref =5volt&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ADC o/p = 5 * 1023 /5 = 1023 [ADC highest Value]&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Step Size&amp;nbsp; voltage = Vref / 1023 = 0.004887 volt =4.88millivolt&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;One binary digit changes when 4.88volt changes takes place&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixjbdYPVuCotpPUtFlkcerw7kf4PvWpiGSoNQ_nzpOf14P4C10QkaS-p9LtZWBaAkjz5EKO1_ijpQRyuCvbeJz-wnzAR3hfhWynLV1F_3TV6FpXEHNmAmcm1zeAW4l8AcpQjImSN-eM2cc/s1600/e7529f241109.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;168&quot; data-original-width=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixjbdYPVuCotpPUtFlkcerw7kf4PvWpiGSoNQ_nzpOf14P4C10QkaS-p9LtZWBaAkjz5EKO1_ijpQRyuCvbeJz-wnzAR3hfhWynLV1F_3TV6FpXEHNmAmcm1zeAW4l8AcpQjImSN-eM2cc/s1600/e7529f241109.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Image&#39;s Step Size is 1.25 volt&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
*******************************************************************************************************&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.gelectron.co.in/2017/12/design-of-digital-voltmeter-by-using_28.html&quot;&gt;Go Here for Part 2&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/3685714464214288058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/atmeag8-avr-based-voltmeter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/3685714464214288058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/3685714464214288058'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/atmeag8-avr-based-voltmeter.html' title='Atmeag8 /AVR based Voltmeter'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuzfGQby4Ur0iup0oeX_cNHjtyFURNkJI3oqxaFfkErTnSX-dqeKYfStJZEW2SaOsYcJd8vqpdzdBQ3CqxLUHcFqqWHiLWt2fNjJ2o-Sx-xWMky-YiOxwpWBvCnIv-60xDg_OSTPi7idC/s72-c/fig1-1.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-8559891285031553746</id><published>2019-04-03T19:46:00.003+05:30</published><updated>2020-09-30T07:35:06.749+05:30</updated><title type='text'> Microcontroller based Digital AC Meter Part 2 Code And Circuit</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Microcontroller based Digital AC Meter Part 2 Code And Circuit&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;First Part available&lt;a href=&quot;http://www.gelectron.co.in/2017/12/design-of-digital-voltmeter-by-using.html&quot;&gt; here&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Circuit Diagram&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_RsnJA9WYywNEPn_ZI1FaUYEpzOof5TopveWMU8w_FZULzwvTj06kbcNdW7Ga5nXKJEJRvBZh3uGqISnRWv9KmMdueY1WsqTaDntkG4r8z5NdmIthb5aVysh3Uo8_GaBH-a6pXqCuQAJ/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;476&quot; data-original-width=&quot;963&quot; height=&quot;316&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_RsnJA9WYywNEPn_ZI1FaUYEpzOof5TopveWMU8w_FZULzwvTj06kbcNdW7Ga5nXKJEJRvBZh3uGqISnRWv9KmMdueY1WsqTaDntkG4r8z5NdmIthb5aVysh3Uo8_GaBH-a6pXqCuQAJ/s640/Capture.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class=&quot;brush:c++&quot;&gt;&lt;avr io.h=&quot;&quot;&gt;&lt;util delay.h=&quot;&quot;&gt;#include&quot;lcd.h&quot;&lt;br /&gt;#include &quot;adc.h&quot;&lt;br /&gt;#include &quot;delay.h&quot;&lt;br /&gt;double volt_read_disply();&lt;br /&gt;int main(void)&lt;br /&gt;  &lt;br /&gt;{   &lt;br /&gt;     int adc_value1=0;  &lt;br /&gt;  LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PB_4,PB_5,PB_6,PB_7);&lt;br /&gt;  LCD_Init(2,16);     &lt;br /&gt;     adc_init();&lt;br /&gt;    &lt;br /&gt;     LCD_Clear();&lt;br /&gt;  LCD_GoToXY(0,0);  &lt;br /&gt;  &lt;br /&gt;  LCD_DisplayString(&quot;  g-Electron&quot;); &lt;br /&gt;  _delay_ms(1000); &lt;br /&gt;  &lt;br /&gt; while(1) &lt;br /&gt; {  &lt;br /&gt;       adc_value1 =  volt_read_disply();&lt;br /&gt;    LCD_GoToLine(1);  &lt;br /&gt;    LCD_DisplayString(&quot; Volt : &quot;);    &lt;br /&gt;    LCD_DisplayNumber(10,adc_value1,3);   &lt;br /&gt;    LCD_DisplayString(&quot;V&quot;);  &lt;br /&gt;    _delay_ms(1300);&lt;br /&gt; } &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;double volt_read_disply()&lt;br /&gt;{   int i,adc_value[40]={0}; int temp =0;&lt;br /&gt; &lt;br /&gt; adc_init();&lt;br /&gt;&lt;br /&gt;  for(i=0; i&amp;lt;40;i++)                        // samples taking from 41 times 9.4milli second taken about on complte half cycle&lt;br /&gt;   { &lt;br /&gt;   adc_value[i] = read_adc(0);  // reading voltage           &lt;br /&gt;  }&lt;br /&gt;   &lt;br /&gt;  temp = adc_value[0];  &lt;br /&gt; for(i=0; i&amp;lt;40; i++)&lt;br /&gt; {&lt;br /&gt;  if(temp&amp;lt;adc_value[i])&lt;br /&gt;  temp=adc_value[i];&lt;br /&gt; }  &lt;br /&gt; &lt;br /&gt;      return ((double)temp*0.224828935); // int to double casting&lt;br /&gt;   &lt;br /&gt;}&lt;/util&gt;&lt;/avr&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/8559891285031553746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/microcontroller-based-digital-ac-meter_3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8559891285031553746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8559891285031553746'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/microcontroller-based-digital-ac-meter_3.html' title=' Microcontroller based Digital AC Meter Part 2 Code And Circuit'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_RsnJA9WYywNEPn_ZI1FaUYEpzOof5TopveWMU8w_FZULzwvTj06kbcNdW7Ga5nXKJEJRvBZh3uGqISnRWv9KmMdueY1WsqTaDntkG4r8z5NdmIthb5aVysh3Uo8_GaBH-a6pXqCuQAJ/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-2055761786491595324</id><published>2019-04-03T19:46:00.002+05:30</published><updated>2019-04-03T19:46:33.976+05:30</updated><title type='text'> Microcontroller based Digital AC Meter Part 2 Code And Circuit</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Microcontroller based Digital AC Meter Part 2 Code And Circuit&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;First Part available&lt;a href=&quot;http://www.gelectron.co.in/2017/12/design-of-digital-voltmeter-by-using.html&quot;&gt; here&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Circuit Diagram&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_RsnJA9WYywNEPn_ZI1FaUYEpzOof5TopveWMU8w_FZULzwvTj06kbcNdW7Ga5nXKJEJRvBZh3uGqISnRWv9KmMdueY1WsqTaDntkG4r8z5NdmIthb5aVysh3Uo8_GaBH-a6pXqCuQAJ/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;476&quot; data-original-width=&quot;963&quot; height=&quot;316&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_RsnJA9WYywNEPn_ZI1FaUYEpzOof5TopveWMU8w_FZULzwvTj06kbcNdW7Ga5nXKJEJRvBZh3uGqISnRWv9KmMdueY1WsqTaDntkG4r8z5NdmIthb5aVysh3Uo8_GaBH-a6pXqCuQAJ/s640/Capture.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:c++&quot;&gt;&lt;avr io.h=&quot;&quot;&gt;&lt;util delay.h=&quot;&quot;&gt;#include&quot;lcd.h&quot;
#include &quot;adc.h&quot;
#include &quot;delay.h&quot;
double volt_read_disply();
int main(void)
  
{   
     int adc_value1=0;  
  LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PB_4,PB_5,PB_6,PB_7);
  LCD_Init(2,16);     
     adc_init();
    
     LCD_Clear();
  LCD_GoToXY(0,0);  
  
  LCD_DisplayString(&quot;  g-Electron&quot;); 
  _delay_ms(1000); 
  
 while(1) 
 {  
       adc_value1 =  volt_read_disply();
    LCD_GoToLine(1);  
    LCD_DisplayString(&quot; Volt : &quot;);    
    LCD_DisplayNumber(10,adc_value1,3);   
    LCD_DisplayString(&quot;V&quot;);  
    _delay_ms(1300);
 } 
}

double volt_read_disply()
{   int i,adc_value[40]={0}; int temp =0;
 
 adc_init();

  for(i=0; i&amp;lt;40;i++)                        // samples taking from 41 times 9.4milli second taken about on complte half cycle
   { 
   adc_value[i] = read_adc(0);  // reading voltage           
  }
   
  temp = adc_value[0];  
 for(i=0; i&amp;lt;40; i++)
 {
  if(temp&amp;lt;adc_value[i])
  temp=adc_value[i];
 }  
 
      return ((double)temp*0.224828935); // int to double casting
   
}&lt;/util&gt;&lt;/avr&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/2055761786491595324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/microcontroller-based-digital-ac-meter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2055761786491595324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2055761786491595324'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2019/04/microcontroller-based-digital-ac-meter.html' title=' Microcontroller based Digital AC Meter Part 2 Code And Circuit'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_RsnJA9WYywNEPn_ZI1FaUYEpzOof5TopveWMU8w_FZULzwvTj06kbcNdW7Ga5nXKJEJRvBZh3uGqISnRWv9KmMdueY1WsqTaDntkG4r8z5NdmIthb5aVysh3Uo8_GaBH-a6pXqCuQAJ/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-1073593748819114551</id><published>2018-05-08T11:33:00.004+05:30</published><updated>2020-09-30T07:35:07.018+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Microcontroller"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Attepmt to Accessing Keyboad Up and down Key  by C programm for a project </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&amp;lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&amp;gt;&lt;br /&gt;&amp;lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; data-original-height=&quot;604&quot; data-original-width=&quot;846&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s640/Capture.PNG&quot; width=&quot;640&quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:csharp&quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:c++&quot;&amp;gt; *&amp;lt;b&amp;gt; main.c&amp;lt;/b&amp;gt;&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp; Created on: Aug 12, 2017&lt;br /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: thannara123&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#include&amp;lt;stdio .h=&quot;&quot;&amp;gt;&lt;br /&gt;#define FALSE 0&lt;br /&gt;#define TRUE&amp;nbsp; 1&amp;nbsp; // 0r //!FALSE&lt;br /&gt;struct menu&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; char menu_up_key;&lt;br /&gt;&amp;nbsp;&amp;nbsp; char menu_down_key;&lt;br /&gt;&amp;nbsp;&amp;nbsp; char menu_enter_key :1; // bit feild 1 bit&lt;br /&gt;&amp;nbsp;};&lt;br /&gt;struct menu s1= {0}; //s1.menu_up-key =1;&lt;br /&gt;void struct_1( struct menu,const char *menu_display[]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const char *menu_display[10];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[0] = &quot;Menu0&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[1] = &quot;Menu1&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[2] = &quot;Menu2&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[3] = &quot;Menu3&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[4] = &quot;Menu4&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[5] = &quot;menu 5&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[6] = &quot;menu 6&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct_1(s1,menu_display);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getchar();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void struct_1(struct menu s1 ,const char *menu_display[])&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char ch;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch=getch();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch!=&#39;\0&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch=getch();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==&#39;H&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(s1.menu_up_key==7)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key =0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // printf(&quot;UP\n&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot; %s\n&quot;,*(s1.menu_up_key+menu_display));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==&#39;P&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key--;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(s1.menu_up_key==-1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; s1.menu_up_key =6;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto here;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //printf(&quot;down\n&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; here:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%s\n&quot;,*(s1.menu_up_key+menu_display));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(ch!=&#39;e&#39;);// while oka key&lt;br /&gt;}&lt;br /&gt;&amp;lt;/stdio&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:csharp&quot;&amp;gt;/*&lt;br /&gt;&amp;nbsp;* button_key.c&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* Created: 7/30/2017 12:02:39 PM&lt;br /&gt;&amp;nbsp;*&amp;nbsp; Author: Krishna&lt;br /&gt;&amp;nbsp;*/ #include &amp;lt;avr io.h=&quot;&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;#include &quot;delay.h&quot;&lt;br /&gt;&amp;nbsp; #include &quot;button_key.h&quot;&lt;br /&gt;&amp;nbsp; #include &quot;lcd.h&quot;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;void menu_key_display(struct menu s1,const char *menu_display[]);&lt;br /&gt;void UP_Down_Keyvalue(struct menu s1,int i,int j);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;/* Function Key Value For get key&amp;nbsp; */&lt;br /&gt;int Key_pressed(void)&lt;br /&gt;&amp;nbsp;{ &lt;br /&gt;&amp;nbsp;while(1){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (LEFT_S) {&amp;nbsp; while(LEFT_S);return 1; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;if (RIGHT_S){&amp;nbsp; while(RIGHT_S);return 2; }&lt;br /&gt;&amp;nbsp;if (UP_S)&amp;nbsp; {&amp;nbsp; while(UP_S); return 3; }&lt;br /&gt;&amp;nbsp;if (DOWN_S) { while(DOWN_S);return 4 ; }&lt;br /&gt;&amp;nbsp;if (OK_S) { while(OK_S);return 5 ; }&lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;/* Function Key Value For Up Key&amp;nbsp; &amp;amp;amp; Enter*/&lt;br /&gt;&lt;br /&gt;&amp;nbsp;void menu_key_display(struct menu s1,const char *menu_display[])&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; int ch; &lt;br /&gt;&amp;nbsp;&amp;nbsp; int a; &lt;br /&gt;&amp;nbsp; int&amp;nbsp; menu_position =0;&lt;br /&gt;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[menu_position]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do{&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; repat:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch = Key_pressed();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==1||ch==2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; if(ch==2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { if(s1.menu_side_key==4)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_side_key = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(*((++s1.menu_side_key)+menu_display)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_position=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(ch==1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {if(s1.menu_side_key==1 ||s1.menu_side_key==0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_side_key=5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(*((--s1.menu_side_key)+menu_display));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_position=1;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(menu_position==0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto repat;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }while(ch!=5);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = s1.menu_side_key; &lt;br /&gt;&amp;nbsp; switch(a)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;case 1: // set time&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[5]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot;&amp;nbsp; HH:MM:SS:PM/AM&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,4);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;case 2: // Set date&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[6]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot;&amp;nbsp; DD:MM:YY&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,3);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;case 3: // set alarm&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[7]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot; HH:MM:SS:AM/PM&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,4);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;case 4:&amp;nbsp; // set alarm&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[8]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot;&amp;nbsp; HH:MM:SS:PM/AM&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,4);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; while(Key_pressed()!=5); &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;/* Function Key Value For UP_Down Key */&lt;br /&gt;&amp;nbsp;void UP_Down_Keyvalue(struct menu s1,int i,int j)&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; int ch,lower,upper;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; do{&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(j==4)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==2)upper=1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==3)upper=9;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==5)upper=5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==8)upper =5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==9)upper =9;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(UP_S)&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(UP_S);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(s1.menu_up_key==upper)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key = lower-1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToXY(1,i); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Printf(&quot;%d&quot;,++s1.menu_up_key);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.time[i-2]=s1.menu_up_key;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; else if(DOWN_S) // down &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; while(DOWN_S);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (s1.menu_up_key==lower)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key = upper+1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToXY(1,i);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Printf(&quot;%d&quot;,--s1.menu_up_key);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.time[i-2]=s1.menu_up_key;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(RIGHT_S)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { while(RIGHT_S);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==9) goto exit1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==3||i==6)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++i;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit1:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (LEFT_S)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { while(LEFT_S);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==2) goto exit2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==5||i==8)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --i;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit2:continue;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; } while (ch!=5);&amp;nbsp; // if Okay key exit loop&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/avr&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/1073593748819114551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/attepmt-to-accessing-keyboad-up-and_8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1073593748819114551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1073593748819114551'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/attepmt-to-accessing-keyboad-up-and_8.html' title='Attepmt to Accessing Keyboad Up and down Key  by C programm for a project '/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-1420377594076554226</id><published>2018-05-08T11:33:00.003+05:30</published><updated>2018-05-08T11:33:25.320+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Microcontroller"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Attepmt to Accessing Keyboad Up and down Key  by C programm for a project </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&amp;gt;&lt;br /&gt;&amp;lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; data-original-height=&quot;604&quot; data-original-width=&quot;846&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDK4I6uKmMOILPqNPi34Ip8Jwp2iKWsVp15PjpH9nZMlCEo36DmJom5qQ3M555omOA68qZ0A_Ei5kFY1O_bkQCOqvx5l4XWL4GdcoFuR3GyuMJIp3g8jERYCBfjlaCvGKzSo7hwhd4TDvF/s640/Capture.PNG&quot; width=&quot;640&quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:csharp&quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:c++&quot;&amp;gt; *&amp;lt;b&amp;gt; main.c&amp;lt;/b&amp;gt;&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*&amp;nbsp; Created on: Aug 12, 2017&lt;br /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: thannara123&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#include&amp;lt;stdio .h=&quot;&quot;&amp;gt;&lt;br /&gt;#define FALSE 0&lt;br /&gt;#define TRUE&amp;nbsp; 1&amp;nbsp; // 0r //!FALSE&lt;br /&gt;struct menu&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; char menu_up_key;&lt;br /&gt;&amp;nbsp;&amp;nbsp; char menu_down_key;&lt;br /&gt;&amp;nbsp;&amp;nbsp; char menu_enter_key :1; // bit feild 1 bit&lt;br /&gt;&amp;nbsp;};&lt;br /&gt;struct menu s1= {0}; //s1.menu_up-key =1;&lt;br /&gt;void struct_1( struct menu,const char *menu_display[]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const char *menu_display[10];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[0] = &quot;Menu0&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[1] = &quot;Menu1&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[2] = &quot;Menu2&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[3] = &quot;Menu3&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[4] = &quot;Menu4&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[5] = &quot;menu 5&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_display[6] = &quot;menu 6&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct_1(s1,menu_display);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getchar();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void struct_1(struct menu s1 ,const char *menu_display[])&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char ch;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch=getch();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch!=&#39;\0&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch=getch();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==&#39;H&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(s1.menu_up_key==7)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key =0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // printf(&quot;UP\n&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot; %s\n&quot;,*(s1.menu_up_key+menu_display));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==&#39;P&#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key--;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(s1.menu_up_key==-1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; s1.menu_up_key =6;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto here;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //printf(&quot;down\n&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; here:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%s\n&quot;,*(s1.menu_up_key+menu_display));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(ch!=&#39;e&#39;);// while oka key&lt;br /&gt;}&lt;br /&gt;&amp;lt;/stdio&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:csharp&quot;&amp;gt;/*&lt;br /&gt;&amp;nbsp;* button_key.c&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* Created: 7/30/2017 12:02:39 PM&lt;br /&gt;&amp;nbsp;*&amp;nbsp; Author: Krishna&lt;br /&gt;&amp;nbsp;*/ #include &amp;lt;avr io.h=&quot;&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;#include &quot;delay.h&quot;&lt;br /&gt;&amp;nbsp; #include &quot;button_key.h&quot;&lt;br /&gt;&amp;nbsp; #include &quot;lcd.h&quot;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;void menu_key_display(struct menu s1,const char *menu_display[]);&lt;br /&gt;void UP_Down_Keyvalue(struct menu s1,int i,int j);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;/* Function Key Value For get key&amp;nbsp; */&lt;br /&gt;int Key_pressed(void)&lt;br /&gt;&amp;nbsp;{ &lt;br /&gt;&amp;nbsp;while(1){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (LEFT_S) {&amp;nbsp; while(LEFT_S);return 1; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;if (RIGHT_S){&amp;nbsp; while(RIGHT_S);return 2; }&lt;br /&gt;&amp;nbsp;if (UP_S)&amp;nbsp; {&amp;nbsp; while(UP_S); return 3; }&lt;br /&gt;&amp;nbsp;if (DOWN_S) { while(DOWN_S);return 4 ; }&lt;br /&gt;&amp;nbsp;if (OK_S) { while(OK_S);return 5 ; }&lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;/* Function Key Value For Up Key&amp;nbsp; &amp;amp;amp; Enter*/&lt;br /&gt;&lt;br /&gt;&amp;nbsp;void menu_key_display(struct menu s1,const char *menu_display[])&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; int ch; &lt;br /&gt;&amp;nbsp;&amp;nbsp; int a; &lt;br /&gt;&amp;nbsp; int&amp;nbsp; menu_position =0;&lt;br /&gt;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[menu_position]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do{&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; repat:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch = Key_pressed();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==1||ch==2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; if(ch==2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { if(s1.menu_side_key==4)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_side_key = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(*((++s1.menu_side_key)+menu_display)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_position=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(ch==1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ch==1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {if(s1.menu_side_key==1 ||s1.menu_side_key==0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_side_key=5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(*((--s1.menu_side_key)+menu_display));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu_position=1;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(menu_position==0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto repat;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }while(ch!=5);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = s1.menu_side_key; &lt;br /&gt;&amp;nbsp; switch(a)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;case 1: // set time&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[5]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot;&amp;nbsp; HH:MM:SS:PM/AM&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,4);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;case 2: // Set date&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[6]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot;&amp;nbsp; DD:MM:YY&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,3);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;case 3: // set alarm&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[7]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot; HH:MM:SS:AM/PM&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,4);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;case 4:&amp;nbsp; // set alarm&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Clear();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(menu_display[8]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToLine(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_DisplayString(&quot;&amp;nbsp; HH:MM:SS:PM/AM&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UP_Down_Keyvalue(s1,2,4);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; while(Key_pressed()!=5); &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;/* Function Key Value For UP_Down Key */&lt;br /&gt;&amp;nbsp;void UP_Down_Keyvalue(struct menu s1,int i,int j)&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; int ch,lower,upper;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; do{&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(j==4)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==2)upper=1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==3)upper=9;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==5)upper=5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==8)upper =5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==9)upper =9;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(UP_S)&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(UP_S);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(s1.menu_up_key==upper)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key = lower-1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToXY(1,i); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Printf(&quot;%d&quot;,++s1.menu_up_key);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.time[i-2]=s1.menu_up_key;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; else if(DOWN_S) // down &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; while(DOWN_S);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (s1.menu_up_key==lower)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key = upper+1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_GoToXY(1,i);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_Printf(&quot;%d&quot;,--s1.menu_up_key);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.time[i-2]=s1.menu_up_key;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(RIGHT_S)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { while(RIGHT_S);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==9) goto exit1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==3||i==6)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++i;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit1:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (LEFT_S)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { while(LEFT_S);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s1.menu_up_key=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==2) goto exit2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==5||i==8)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --i;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit2:continue;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; } while (ch!=5);&amp;nbsp; // if Okay key exit loop&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/avr&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/1420377594076554226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/attepmt-to-accessing-keyboad-up-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1420377594076554226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/1420377594076554226'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/attepmt-to-accessing-keyboad-up-and.html' title='Attepmt to Accessing Keyboad Up and down Key  by C programm for a project '/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-6598705936469322141</id><published>2018-05-08T11:30:00.003+05:30</published><updated>2020-09-30T07:35:07.280+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Timer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Timer&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;What is a Timer ?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A Timer is device it sense the&lt;b&gt; &lt;span style=&quot;color: red;&quot;&gt;time interval&lt;/span&gt; &lt;/b&gt;and produce an output at a set value . example alarm Timer setting.(&lt;a href=&quot;https://en.wikipedia.org/wiki/Timer&quot;&gt;Timer in Wikipedia&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;,What is the need of a timer in Micro controller ?&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;1) Some time &amp;nbsp;micro controller Code need some accurate &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Delay&lt;/span&gt; &lt;/b&gt;&amp;nbsp;( Example blinking An LED in each &amp;nbsp; &amp;nbsp; &amp;nbsp;accurate 1 sec.&amp;nbsp;&lt;a href=&quot;http://circuits-collection.blogspot.in/2011/11/led-blinking-using-8051.html&quot;&gt;Look LED Blinking example&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2)Some Time the code needs the code &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Repeat &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3) Most of the &lt;span style=&quot;color: red;&quot;&gt;Interfacing devices&lt;/span&gt; with micro-controller needs a clock (accurate interval of clocks)&lt;br /&gt;&amp;nbsp; &amp;nbsp;Example: &amp;nbsp; LCD module require Clock &amp;nbsp;Signal &lt;a href=&quot;http://circuits-collection.blogspot.in/2012/03/lcd-interfacing.html&quot;&gt;Look LCD Interfacing&lt;/a&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxBtXK0gLRVanvJM076Jhep2lAlHaZtWp41r0Ahmyume9nJ2abuu704vgGwxGWRJw8R_IZrsD9G6L4QowFbJaRxKqFfmm5xF-nuzANO_kOVT0kMA_uW5wwX_qQbQGdGRbKJC-iT6cixKIE/s1600/lcd.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxBtXK0gLRVanvJM076Jhep2lAlHaZtWp41r0Ahmyume9nJ2abuu704vgGwxGWRJw8R_IZrsD9G6L4QowFbJaRxKqFfmm5xF-nuzANO_kOVT0kMA_uW5wwX_qQbQGdGRbKJC-iT6cixKIE/s400/lcd.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Timer in 8051&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Also a Timer actually require a clock pulse &amp;nbsp;(&lt;span style=&quot;color: blue;&quot;&gt;pling&lt;/span&gt;) .These pulse are given from controller &amp;nbsp;(actually it is in software based not giving ) see below picture&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_ASUSV_MOlFbNM_SCfQJ8MlY0OBSmShwnbElTsotEQmZ7KLJkSu4g-7-9B1yNvy4dgJj4aceHhyphenhyphen92pxuIefVl33JaNhC69LF4OKdcXcfH4HDc3hHW_ZjF93YrPhMgZnDs8VflUW-0Wwn/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_ASUSV_MOlFbNM_SCfQJ8MlY0OBSmShwnbElTsotEQmZ7KLJkSu4g-7-9B1yNvy4dgJj4aceHhyphenhyphen92pxuIefVl33JaNhC69LF4OKdcXcfH4HDc3hHW_ZjF93YrPhMgZnDs8VflUW-0Wwn/s400/Capture.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;8051 type controller has &amp;nbsp;two Timer Timer 0 and Timer 1 (These two timer is the length of 16 bit ,0000 to &amp;nbsp;FFFF ).These Timer is named as TR0 and TR1.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk3ddHlbxO5TigD0e-yc8_dqFpjqINdMeKm4olosto6IYHe9453xazuQcz5lHyoA9X-OdoxYzmWGpv9AxfzHAOVAP5ZpKvNxTImthiOLYkJFv0kgBEX6XXeIEkIQjv9Aj0vlTlffJ0SZ4d/s1600/Timer+Registers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk3ddHlbxO5TigD0e-yc8_dqFpjqINdMeKm4olosto6IYHe9453xazuQcz5lHyoA9X-OdoxYzmWGpv9AxfzHAOVAP5ZpKvNxTImthiOLYkJFv0kgBEX6XXeIEkIQjv9Aj0vlTlffJ0SZ4d/s400/Timer+Registers.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jMec0s5bTB1luYzjLxQNJeAwyEsXbfWUIaLWCmhmwcysDz507R0NPwYTaIs9cKWhdwWjeSQtM1lCjqjikKUho5lzm5CD716DQ5d74maZmJD-ssvzaEQ8N7q5QoeLhH68cGWsr25_bJ5x/s1600/8051-chapter-02-image-020.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;101&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jMec0s5bTB1luYzjLxQNJeAwyEsXbfWUIaLWCmhmwcysDz507R0NPwYTaIs9cKWhdwWjeSQtM1lCjqjikKUho5lzm5CD716DQ5d74maZmJD-ssvzaEQ8N7q5QoeLhH68cGWsr25_bJ5x/s400/8051-chapter-02-image-020.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The Timer Setting/configuring &amp;nbsp;can controlling by the TMOD register&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxp2mErtjLa10dp6zU0LI7x6cBanwAizvebXZHEQbXR-ZPiRtjh-S8zjShwbxP277GksSvYwMddESkoKd0i0TwOP2nvm0LfwjjTUF0Rg-TlidObtQ3m1Sui1oZh9p2PMySBlb_6NN7a7AJ/s1600/t.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;76&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxp2mErtjLa10dp6zU0LI7x6cBanwAizvebXZHEQbXR-ZPiRtjh-S8zjShwbxP277GksSvYwMddESkoKd0i0TwOP2nvm0LfwjjTUF0Rg-TlidObtQ3m1Sui1oZh9p2PMySBlb_6NN7a7AJ/s640/t.gif&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;These TMOD register Values is used to decide how the Timer Works .&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTwJ9eu3rObXDyOICOvMZdv5kHAAjM_mhsV8K822lJDOtyhaEA_BKfBNnLBArUyO47ISWRnjoiW21FNydU6EBhShyEuhCml20_dLmOkk5n5B7LxE-8j0XsJ4S_u1ZzVbf2n3D2B6XexD7G/s1600/tmod.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTwJ9eu3rObXDyOICOvMZdv5kHAAjM_mhsV8K822lJDOtyhaEA_BKfBNnLBArUyO47ISWRnjoiW21FNydU6EBhShyEuhCml20_dLmOkk5n5B7LxE-8j0XsJ4S_u1ZzVbf2n3D2B6XexD7G/s640/tmod.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Sample program&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsiMvjVOJ8n27cyy0thJDwQvOlJx7bUzYTYj916zGvMGanL_rbt1BO-oc43MNfE6TUz58aLmjsQMpxa7HdadCPnonbgEuwpRwoGNBLGFyuS1_uGQwt79UNnEfiOJO7Upo-EimGV9nI4_o9/s1600/timer1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsiMvjVOJ8n27cyy0thJDwQvOlJx7bUzYTYj916zGvMGanL_rbt1BO-oc43MNfE6TUz58aLmjsQMpxa7HdadCPnonbgEuwpRwoGNBLGFyuS1_uGQwt79UNnEfiOJO7Upo-EimGV9nI4_o9/s640/timer1.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVU96C4nHNoVAYFpfYM2bLy1OWt9sZNkAm0x7MQyYnrpBgEQEKwyb4CNrnPktPnTqJFJyF8vSSNRTFt_9C2A5By8CmU-4VLgCuBA7-ihhdv6pBz95RJZF-MGmkKdvRaretXUVFSdJJSsIT/s1600/timer.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVU96C4nHNoVAYFpfYM2bLy1OWt9sZNkAm0x7MQyYnrpBgEQEKwyb4CNrnPktPnTqJFJyF8vSSNRTFt_9C2A5By8CmU-4VLgCuBA7-ihhdv6pBz95RJZF-MGmkKdvRaretXUVFSdJJSsIT/s640/timer.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;download the full&lt;a href=&quot;https://drive.google.com/file/d/0B0pTqKFEGreLTVRMcGpuZnRsNGs/view?usp=sharing&quot;&gt;code and Test&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/6598705936469322141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/timer_8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/6598705936469322141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/6598705936469322141'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/timer_8.html' title='Timer'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxBtXK0gLRVanvJM076Jhep2lAlHaZtWp41r0Ahmyume9nJ2abuu704vgGwxGWRJw8R_IZrsD9G6L4QowFbJaRxKqFfmm5xF-nuzANO_kOVT0kMA_uW5wwX_qQbQGdGRbKJC-iT6cixKIE/s72-c/lcd.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-8010720350346906568</id><published>2018-05-08T11:30:00.002+05:30</published><updated>2018-05-08T11:31:05.606+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Timer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;Timer&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
What is a Timer ?&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A Timer is device it sense the&lt;b&gt; &lt;span style=&quot;color: red;&quot;&gt;time interval&lt;/span&gt; &lt;/b&gt;and produce an output at a set value . example alarm Timer setting.(&lt;a href=&quot;https://en.wikipedia.org/wiki/Timer&quot;&gt;Timer in Wikipedia&lt;/a&gt;&amp;nbsp;)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
,What is the need of a timer in Micro controller ?&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
1) Some time &amp;nbsp;micro controller Code need some accurate &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Delay&lt;/span&gt; &lt;/b&gt;&amp;nbsp;( Example blinking An LED in each &amp;nbsp; &amp;nbsp; &amp;nbsp;accurate 1 sec.&amp;nbsp;&lt;a href=&quot;http://circuits-collection.blogspot.in/2011/11/led-blinking-using-8051.html&quot;&gt;Look LED Blinking example&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2)Some Time the code needs the code &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Repeat &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3) Most of the &lt;span style=&quot;color: red;&quot;&gt;Interfacing devices&lt;/span&gt; with micro-controller needs a clock (accurate interval of clocks)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Example: &amp;nbsp; LCD module require Clock &amp;nbsp;Signal &lt;a href=&quot;http://circuits-collection.blogspot.in/2012/03/lcd-interfacing.html&quot;&gt;Look LCD Interfacing&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxBtXK0gLRVanvJM076Jhep2lAlHaZtWp41r0Ahmyume9nJ2abuu704vgGwxGWRJw8R_IZrsD9G6L4QowFbJaRxKqFfmm5xF-nuzANO_kOVT0kMA_uW5wwX_qQbQGdGRbKJC-iT6cixKIE/s1600/lcd.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxBtXK0gLRVanvJM076Jhep2lAlHaZtWp41r0Ahmyume9nJ2abuu704vgGwxGWRJw8R_IZrsD9G6L4QowFbJaRxKqFfmm5xF-nuzANO_kOVT0kMA_uW5wwX_qQbQGdGRbKJC-iT6cixKIE/s400/lcd.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;Timer in 8051&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Also a Timer actually require a clock pulse &amp;nbsp;(&lt;span style=&quot;color: blue;&quot;&gt;pling&lt;/span&gt;) .These pulse are given from controller &amp;nbsp;(actually it is in software based not giving ) see below picture&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_ASUSV_MOlFbNM_SCfQJ8MlY0OBSmShwnbElTsotEQmZ7KLJkSu4g-7-9B1yNvy4dgJj4aceHhyphenhyphen92pxuIefVl33JaNhC69LF4OKdcXcfH4HDc3hHW_ZjF93YrPhMgZnDs8VflUW-0Wwn/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_ASUSV_MOlFbNM_SCfQJ8MlY0OBSmShwnbElTsotEQmZ7KLJkSu4g-7-9B1yNvy4dgJj4aceHhyphenhyphen92pxuIefVl33JaNhC69LF4OKdcXcfH4HDc3hHW_ZjF93YrPhMgZnDs8VflUW-0Wwn/s400/Capture.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
8051 type controller has &amp;nbsp;two Timer Timer 0 and Timer 1 (These two timer is the length of 16 bit ,0000 to &amp;nbsp;FFFF ).These Timer is named as TR0 and TR1.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk3ddHlbxO5TigD0e-yc8_dqFpjqINdMeKm4olosto6IYHe9453xazuQcz5lHyoA9X-OdoxYzmWGpv9AxfzHAOVAP5ZpKvNxTImthiOLYkJFv0kgBEX6XXeIEkIQjv9Aj0vlTlffJ0SZ4d/s1600/Timer+Registers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk3ddHlbxO5TigD0e-yc8_dqFpjqINdMeKm4olosto6IYHe9453xazuQcz5lHyoA9X-OdoxYzmWGpv9AxfzHAOVAP5ZpKvNxTImthiOLYkJFv0kgBEX6XXeIEkIQjv9Aj0vlTlffJ0SZ4d/s400/Timer+Registers.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jMec0s5bTB1luYzjLxQNJeAwyEsXbfWUIaLWCmhmwcysDz507R0NPwYTaIs9cKWhdwWjeSQtM1lCjqjikKUho5lzm5CD716DQ5d74maZmJD-ssvzaEQ8N7q5QoeLhH68cGWsr25_bJ5x/s1600/8051-chapter-02-image-020.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;101&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jMec0s5bTB1luYzjLxQNJeAwyEsXbfWUIaLWCmhmwcysDz507R0NPwYTaIs9cKWhdwWjeSQtM1lCjqjikKUho5lzm5CD716DQ5d74maZmJD-ssvzaEQ8N7q5QoeLhH68cGWsr25_bJ5x/s400/8051-chapter-02-image-020.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
The Timer Setting/configuring &amp;nbsp;can controlling by the TMOD register&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxp2mErtjLa10dp6zU0LI7x6cBanwAizvebXZHEQbXR-ZPiRtjh-S8zjShwbxP277GksSvYwMddESkoKd0i0TwOP2nvm0LfwjjTUF0Rg-TlidObtQ3m1Sui1oZh9p2PMySBlb_6NN7a7AJ/s1600/t.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;76&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxp2mErtjLa10dp6zU0LI7x6cBanwAizvebXZHEQbXR-ZPiRtjh-S8zjShwbxP277GksSvYwMddESkoKd0i0TwOP2nvm0LfwjjTUF0Rg-TlidObtQ3m1Sui1oZh9p2PMySBlb_6NN7a7AJ/s640/t.gif&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
These TMOD register Values is used to decide how the Timer Works .&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTwJ9eu3rObXDyOICOvMZdv5kHAAjM_mhsV8K822lJDOtyhaEA_BKfBNnLBArUyO47ISWRnjoiW21FNydU6EBhShyEuhCml20_dLmOkk5n5B7LxE-8j0XsJ4S_u1ZzVbf2n3D2B6XexD7G/s1600/tmod.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTwJ9eu3rObXDyOICOvMZdv5kHAAjM_mhsV8K822lJDOtyhaEA_BKfBNnLBArUyO47ISWRnjoiW21FNydU6EBhShyEuhCml20_dLmOkk5n5B7LxE-8j0XsJ4S_u1ZzVbf2n3D2B6XexD7G/s640/tmod.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Sample program&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsiMvjVOJ8n27cyy0thJDwQvOlJx7bUzYTYj916zGvMGanL_rbt1BO-oc43MNfE6TUz58aLmjsQMpxa7HdadCPnonbgEuwpRwoGNBLGFyuS1_uGQwt79UNnEfiOJO7Upo-EimGV9nI4_o9/s1600/timer1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsiMvjVOJ8n27cyy0thJDwQvOlJx7bUzYTYj916zGvMGanL_rbt1BO-oc43MNfE6TUz58aLmjsQMpxa7HdadCPnonbgEuwpRwoGNBLGFyuS1_uGQwt79UNnEfiOJO7Upo-EimGV9nI4_o9/s640/timer1.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVU96C4nHNoVAYFpfYM2bLy1OWt9sZNkAm0x7MQyYnrpBgEQEKwyb4CNrnPktPnTqJFJyF8vSSNRTFt_9C2A5By8CmU-4VLgCuBA7-ihhdv6pBz95RJZF-MGmkKdvRaretXUVFSdJJSsIT/s1600/timer.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVU96C4nHNoVAYFpfYM2bLy1OWt9sZNkAm0x7MQyYnrpBgEQEKwyb4CNrnPktPnTqJFJyF8vSSNRTFt_9C2A5By8CmU-4VLgCuBA7-ihhdv6pBz95RJZF-MGmkKdvRaretXUVFSdJJSsIT/s640/timer.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
download the full&lt;a href=&quot;https://drive.google.com/file/d/0B0pTqKFEGreLTVRMcGpuZnRsNGs/view?usp=sharing&quot;&gt;code and Test&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/8010720350346906568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/timer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8010720350346906568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/8010720350346906568'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/timer.html' title='Timer'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxBtXK0gLRVanvJM076Jhep2lAlHaZtWp41r0Ahmyume9nJ2abuu704vgGwxGWRJw8R_IZrsD9G6L4QowFbJaRxKqFfmm5xF-nuzANO_kOVT0kMA_uW5wwX_qQbQGdGRbKJC-iT6cixKIE/s72-c/lcd.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-2067869075460859185</id><published>2018-05-08T11:29:00.003+05:30</published><updated>2020-09-30T07:35:07.540+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Microcontroller"/><category scheme="http://www.blogger.com/atom/ns#" term="Power Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Switch Bounce Tutorials</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt; &lt;h2 style=&quot;text-align: center;&quot;&gt; &lt;b&gt;Switch Bounce&lt;/b&gt;&lt;/h2&gt; &lt;div&gt; &lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt; Microcontrolers may not in Human thinking frequency .Human thinking frequency is lies in some of low Hz . &amp;nbsp;Microcontroler works variety range of frequency ie ,12Mhz,20 Mhz etc . &amp;nbsp;In a push Button &amp;nbsp;micro controller interfacing, Human and Micro controller are feels that whether the push is pressed or not &amp;nbsp;in different way as follows in the graph .&lt;br /&gt; &lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9xBTtzuHp6wWVYkB8tcXgpQ2awODLR_dZQJAsEy_e1ear5gtK_Oz1VKZ772VrzSjchbP1WF4NvS5kSN04WfYFooIMcQKx4OMhyphenhyphensv-ix8VtERu1HbsnqDh6vQNgo-_84I-kwwY6X4fV0k/s1600/switch_debounce_04_lrg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9xBTtzuHp6wWVYkB8tcXgpQ2awODLR_dZQJAsEy_e1ear5gtK_Oz1VKZ772VrzSjchbP1WF4NvS5kSN04WfYFooIMcQKx4OMhyphenhyphensv-ix8VtERu1HbsnqDh6vQNgo-_84I-kwwY6X4fV0k/s320/switch_debounce_04_lrg.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ukxrpqkzx9cIO72lZPqHyqgx-j1dMWdP2F-CFg3_I6vN42xwIdvQ-uNro2GaTI4dCtSurpaCp10aOwS8CgUxG4kfZhB0mbo2J8X_FCoAr2BZiSNuNZY7uPP0LvK5tSObOMkXAx4e9-M/s1600/switch_tutorial5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ukxrpqkzx9cIO72lZPqHyqgx-j1dMWdP2F-CFg3_I6vN42xwIdvQ-uNro2GaTI4dCtSurpaCp10aOwS8CgUxG4kfZhB0mbo2J8X_FCoAr2BZiSNuNZY7uPP0LvK5tSObOMkXAx4e9-M/s400/switch_tutorial5.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;br /&gt; &lt;br /&gt; Some small duration pulse due to denounce generated as multiple touch error&lt;br /&gt; &lt;b&gt;&lt;u&gt;Hardware solution&lt;/u&gt;&lt;/b&gt;&lt;br /&gt; &lt;div&gt; It can be made by a resistor and a capacitor in the following manner or any other for comfortable&lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;/div&gt; &lt;/div&gt; &lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5sGAKIbljIRryXv81smKhb9ABx50DesYc8zH-1OkrMhEmptkSAaR2a5nQFVzXphvrpf-Ga5OMPKIBuBjCcq1hxygJeKekj8uCi1BmxnCOms1bESqAJZ1a0YmD5ywkBj3NFrTI_oVA0u8/s1600/images+%25281%2529.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5sGAKIbljIRryXv81smKhb9ABx50DesYc8zH-1OkrMhEmptkSAaR2a5nQFVzXphvrpf-Ga5OMPKIBuBjCcq1hxygJeKekj8uCi1BmxnCOms1bESqAJZ1a0YmD5ywkBj3NFrTI_oVA0u8/s400/images+%25281%2529.png&quot; width=&quot;346&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; When ever the switch is pressed the capacitor will charge &amp;nbsp;rapidly ,practically the first charge wil be across &amp;nbsp;the &amp;nbsp;,capacitor ,&lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5dFA2BhJMxHS0SHoNLDd_YEr2-JI9dqz1dFuq-WfwmAzmWnxAHFD2ftqHoxj8XM91sYfHtj1hLEx1ompSdqK4iMSWcY1m_9r8F6QJtYu6S2LYjS8JoRJ6LYAV0EvNUEEuepdhyYhCXH4/s1600/switch_tutorial7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5dFA2BhJMxHS0SHoNLDd_YEr2-JI9dqz1dFuq-WfwmAzmWnxAHFD2ftqHoxj8XM91sYfHtj1hLEx1ompSdqK4iMSWcY1m_9r8F6QJtYu6S2LYjS8JoRJ6LYAV0EvNUEEuepdhyYhCXH4/s400/switch_tutorial7.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; So we can avoid the denouncing effect .&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; The capacitor and the resistor will be select in accordance with time constant . as follows&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJ8IxNFifi7hQqbl0uR_0AEBFWBCxu0SjXn2NTyYkiA86ICibd8QRT5LMAY-laaz92RJkVy365zoGaoQccitPphx8gCvbzzsRmy2uF1711g4g-L_quPEamzseLAU_V1F3MH-Gm6ox6N8/s1600/debounceR.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJ8IxNFifi7hQqbl0uR_0AEBFWBCxu0SjXn2NTyYkiA86ICibd8QRT5LMAY-laaz92RJkVy365zoGaoQccitPphx8gCvbzzsRmy2uF1711g4g-L_quPEamzseLAU_V1F3MH-Gm6ox6N8/s1600/debounceR.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-3z72l8ET2cUoHVOWh2D-n4uCii7ktC395Jh9IcZ0FTpVs7TjLP-h8_EDgCQRKi4ZesLh3sLcjc9y16i_3PKhm7V4CfYrdWWLaDyj1zIAdjEGRHcRBntUBBFYnQ1lHJ6sujKHmrbvSI/s1600/debouncevcap.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-3z72l8ET2cUoHVOWh2D-n4uCii7ktC395Jh9IcZ0FTpVs7TjLP-h8_EDgCQRKi4ZesLh3sLcjc9y16i_3PKhm7V4CfYrdWWLaDyj1zIAdjEGRHcRBntUBBFYnQ1lHJ6sujKHmrbvSI/s640/debouncevcap.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUrDdyLAYJWkzacNaRmo6nO7RY4PKkvstWZR9d94kp5KNHlcdeeeasL4ufVZldmaMMfaLr8zigqcdBMZ_P_DKGBYIcV2rDmKei1GHsaovqZnV09a9sDD2VlcJZGClsy4lv-fIldzjgow/s1600/debounceR.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUrDdyLAYJWkzacNaRmo6nO7RY4PKkvstWZR9d94kp5KNHlcdeeeasL4ufVZldmaMMfaLr8zigqcdBMZ_P_DKGBYIcV2rDmKei1GHsaovqZnV09a9sDD2VlcJZGClsy4lv-fIldzjgow/s1600/debounceR.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; For more information &lt;a href=&quot;http://www.ganssle.com/debouncing-pt2.htm&quot;&gt;go here&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; Will be update&amp;nbsp;&lt;/div&gt; &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;&lt;/div&gt; &lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/2067869075460859185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/switch-bounce-tutorials_8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2067869075460859185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2067869075460859185'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/switch-bounce-tutorials_8.html' title='Switch Bounce Tutorials'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9xBTtzuHp6wWVYkB8tcXgpQ2awODLR_dZQJAsEy_e1ear5gtK_Oz1VKZ772VrzSjchbP1WF4NvS5kSN04WfYFooIMcQKx4OMhyphenhyphensv-ix8VtERu1HbsnqDh6vQNgo-_84I-kwwY6X4fV0k/s72-c/switch_debounce_04_lrg.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-4112380063808504024</id><published>2018-05-08T11:29:00.002+05:30</published><updated>2020-03-15T20:44:17.863+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Microcontroller"/><category scheme="http://www.blogger.com/atom/ns#" term="Power Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Switch Bounce Tutorials</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

&lt;h2 style=&quot;text-align: center;&quot;&gt;

&lt;b&gt;Switch Bounce&lt;/b&gt;&lt;/h2&gt;

&lt;div&gt;

&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;

Microcontrolers may not in Human thinking frequency .Human thinking frequency is lies in some of low Hz . &amp;nbsp;Microcontroler works variety range of frequency ie ,12Mhz,20 Mhz etc . &amp;nbsp;In a push Button &amp;nbsp;micro controller interfacing, Human and Micro controller are feels that whether the push is pressed or not &amp;nbsp;in different way as follows in the graph .&lt;br /&gt;

&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9xBTtzuHp6wWVYkB8tcXgpQ2awODLR_dZQJAsEy_e1ear5gtK_Oz1VKZ772VrzSjchbP1WF4NvS5kSN04WfYFooIMcQKx4OMhyphenhyphensv-ix8VtERu1HbsnqDh6vQNgo-_84I-kwwY6X4fV0k/s1600/switch_debounce_04_lrg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9xBTtzuHp6wWVYkB8tcXgpQ2awODLR_dZQJAsEy_e1ear5gtK_Oz1VKZ772VrzSjchbP1WF4NvS5kSN04WfYFooIMcQKx4OMhyphenhyphensv-ix8VtERu1HbsnqDh6vQNgo-_84I-kwwY6X4fV0k/s320/switch_debounce_04_lrg.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ukxrpqkzx9cIO72lZPqHyqgx-j1dMWdP2F-CFg3_I6vN42xwIdvQ-uNro2GaTI4dCtSurpaCp10aOwS8CgUxG4kfZhB0mbo2J8X_FCoAr2BZiSNuNZY7uPP0LvK5tSObOMkXAx4e9-M/s1600/switch_tutorial5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ukxrpqkzx9cIO72lZPqHyqgx-j1dMWdP2F-CFg3_I6vN42xwIdvQ-uNro2GaTI4dCtSurpaCp10aOwS8CgUxG4kfZhB0mbo2J8X_FCoAr2BZiSNuNZY7uPP0LvK5tSObOMkXAx4e9-M/s400/switch_tutorial5.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;br /&gt;

Some small duration pulse due to denounce generated as multiple touch error&lt;br /&gt;

&lt;b&gt;&lt;u&gt;Hardware solution&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;

&lt;div&gt;

It can be made by a resistor and a capacitor in the following manner or any other for comfortable&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;/div&gt;

&lt;/div&gt;

&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5sGAKIbljIRryXv81smKhb9ABx50DesYc8zH-1OkrMhEmptkSAaR2a5nQFVzXphvrpf-Ga5OMPKIBuBjCcq1hxygJeKekj8uCi1BmxnCOms1bESqAJZ1a0YmD5ywkBj3NFrTI_oVA0u8/s1600/images+%25281%2529.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5sGAKIbljIRryXv81smKhb9ABx50DesYc8zH-1OkrMhEmptkSAaR2a5nQFVzXphvrpf-Ga5OMPKIBuBjCcq1hxygJeKekj8uCi1BmxnCOms1bESqAJZ1a0YmD5ywkBj3NFrTI_oVA0u8/s400/images+%25281%2529.png&quot; width=&quot;346&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;

When ever the switch is pressed the capacitor will charge &amp;nbsp;rapidly ,practically the first charge wil be across &amp;nbsp;the &amp;nbsp;,capacitor ,&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5dFA2BhJMxHS0SHoNLDd_YEr2-JI9dqz1dFuq-WfwmAzmWnxAHFD2ftqHoxj8XM91sYfHtj1hLEx1ompSdqK4iMSWcY1m_9r8F6QJtYu6S2LYjS8JoRJ6LYAV0EvNUEEuepdhyYhCXH4/s1600/switch_tutorial7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5dFA2BhJMxHS0SHoNLDd_YEr2-JI9dqz1dFuq-WfwmAzmWnxAHFD2ftqHoxj8XM91sYfHtj1hLEx1ompSdqK4iMSWcY1m_9r8F6QJtYu6S2LYjS8JoRJ6LYAV0EvNUEEuepdhyYhCXH4/s400/switch_tutorial7.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

So we can avoid the denouncing effect .&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

The capacitor and the resistor will be select in accordance with time constant . as follows&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJ8IxNFifi7hQqbl0uR_0AEBFWBCxu0SjXn2NTyYkiA86ICibd8QRT5LMAY-laaz92RJkVy365zoGaoQccitPphx8gCvbzzsRmy2uF1711g4g-L_quPEamzseLAU_V1F3MH-Gm6ox6N8/s1600/debounceR.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGJ8IxNFifi7hQqbl0uR_0AEBFWBCxu0SjXn2NTyYkiA86ICibd8QRT5LMAY-laaz92RJkVy365zoGaoQccitPphx8gCvbzzsRmy2uF1711g4g-L_quPEamzseLAU_V1F3MH-Gm6ox6N8/s1600/debounceR.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-3z72l8ET2cUoHVOWh2D-n4uCii7ktC395Jh9IcZ0FTpVs7TjLP-h8_EDgCQRKi4ZesLh3sLcjc9y16i_3PKhm7V4CfYrdWWLaDyj1zIAdjEGRHcRBntUBBFYnQ1lHJ6sujKHmrbvSI/s1600/debouncevcap.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-3z72l8ET2cUoHVOWh2D-n4uCii7ktC395Jh9IcZ0FTpVs7TjLP-h8_EDgCQRKi4ZesLh3sLcjc9y16i_3PKhm7V4CfYrdWWLaDyj1zIAdjEGRHcRBntUBBFYnQ1lHJ6sujKHmrbvSI/s640/debouncevcap.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUrDdyLAYJWkzacNaRmo6nO7RY4PKkvstWZR9d94kp5KNHlcdeeeasL4ufVZldmaMMfaLr8zigqcdBMZ_P_DKGBYIcV2rDmKei1GHsaovqZnV09a9sDD2VlcJZGClsy4lv-fIldzjgow/s1600/debounceR.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUrDdyLAYJWkzacNaRmo6nO7RY4PKkvstWZR9d94kp5KNHlcdeeeasL4ufVZldmaMMfaLr8zigqcdBMZ_P_DKGBYIcV2rDmKei1GHsaovqZnV09a9sDD2VlcJZGClsy4lv-fIldzjgow/s1600/debounceR.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

For more information &lt;a href=&quot;http://www.ganssle.com/debouncing-pt2.htm&quot;&gt;go here&lt;/a&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

Will be update&amp;nbsp;&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;br /&gt;&lt;/div&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/4112380063808504024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/switch-bounce-tutorials.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4112380063808504024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/4112380063808504024'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/switch-bounce-tutorials.html' title='Switch Bounce Tutorials'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9xBTtzuHp6wWVYkB8tcXgpQ2awODLR_dZQJAsEy_e1ear5gtK_Oz1VKZ772VrzSjchbP1WF4NvS5kSN04WfYFooIMcQKx4OMhyphenhyphensv-ix8VtERu1HbsnqDh6vQNgo-_84I-kwwY6X4fV0k/s72-c/switch_debounce_04_lrg.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-2080519343227775998</id><published>2018-05-08T11:28:00.004+05:30</published><updated>2020-09-30T07:35:07.804+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Making multiple input by 3 wire Interfacing .</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Parallel to serial &amp;nbsp;Interfacing with Micro controller&amp;nbsp;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;Interfacing with 74HC165 with 8051&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp;I am trying to make multiple input with using minimum input port of micro controller ,ie 3 wire .&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;By using a 3 wire we can interface more input as we wish.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;I am making a tutorial for it , Basics of 74HC165 &amp;nbsp;which is a parallel to serial shift register .&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;https://www.google.co.in/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjo_4mgsoTMAhWIFJQKHXZlAAoQFggcMAA&amp;amp;url=http%3A%2F%2Fwww.nxp.com%2Fdocuments%2Fdata_sheet%2F74HC_HCT165.pdf&amp;amp;usg=AFQjCNF0DQaExmxrHtx8Y3cFVPTbwZOPxg&amp;amp;sig2=J16sjhukPlULD9DE2OnPvw&quot;&gt;Data sheet of 74HC165&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGdn9J3u-xa0VqSrUUbkiom40gf0zs_gcZYKejduMNsFRhYWY7Boc0ct2LvnJF1-JsHRi2HlLBUzxwsLDK1-6H93eKAWGfKuUBELqbBrKBCrQkcT1mE1I4e-_3loBFJf8wi10IRaCEAURf/s1600/images.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGdn9J3u-xa0VqSrUUbkiom40gf0zs_gcZYKejduMNsFRhYWY7Boc0ct2LvnJF1-JsHRi2HlLBUzxwsLDK1-6H93eKAWGfKuUBELqbBrKBCrQkcT1mE1I4e-_3loBFJf8wi10IRaCEAURf/s1600/images.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Only three pin is connected with this IC .&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;1) &amp;nbsp; SH/LD &amp;nbsp;or PL &amp;nbsp;is used load &amp;nbsp;parallel data to the IC .A low pulse (ground) is applied for store the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parallel data at the pin from A to H . And a High (5 Volt) is applied to stop the reading from the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PIN A to H .&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;2) Then to read the loaded or saved data to Micro controller we have to give clock to the PIN 2 of &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 74HC165 &amp;nbsp;(CLK) . 8 pulses is applied to read 8 bit (Pin A to B)&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;3) QH / SO . serial out pin is used to get the stored parallel data to serially.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The CLK INH pin must be connect in ground for enable clock.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; To use cascaded 74HC165 for increasing i/p .connect the Seriall output pin (PIN 9) of first satge into serial input of first stage see the following circuit.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgLVYtc_MnoXAG5PO8f9xBvY-0zhkw5krohe8WQJk3bPbgvi-HMVLaQx9UG6dKwZoSC52C6bt-go_0Bed1_-dPFF8KETI0WD-vB6NE0cESMbrzn8L9mnC1LO-_TD63xPj_KhW8xvpQcS1/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgLVYtc_MnoXAG5PO8f9xBvY-0zhkw5krohe8WQJk3bPbgvi-HMVLaQx9UG6dKwZoSC52C6bt-go_0Bed1_-dPFF8KETI0WD-vB6NE0cESMbrzn8L9mnC1LO-_TD63xPj_KhW8xvpQcS1/s1600/Capture.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;see the code below&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;  #include &lt;regx51 .h=&quot;&quot;&gt; &lt;br /&gt;#include&lt;stdio .h=&quot;&quot;&gt;&lt;br /&gt;#include &quot;lcd.h&quot;  &lt;br /&gt;sbit PL  = P1^0;   // Loading parallel data to HC165.&lt;br /&gt;sbit CLK = P1^1;   // Clock pulse to HC165.&lt;br /&gt;sbit Beep  = P1^2;   // &lt;br /&gt;sbit data_in  = P1^3;&lt;br /&gt;&lt;br /&gt;  void clock(void);&lt;br /&gt;  void display(unsigned char value);&lt;br /&gt;     &lt;br /&gt;void main()&lt;br /&gt;{  &lt;br /&gt; unsigned char position ,no_of_ip = 17;&lt;br /&gt;  lcd_init();&lt;br /&gt;  string(&quot;   gElectron&quot;);     &lt;br /&gt;  while(1)&lt;br /&gt;&lt;br /&gt;   {  &lt;br /&gt;      PL = 0 ;&lt;br /&gt;  delay(2);&lt;br /&gt;  PL = 1;&lt;br /&gt;&lt;br /&gt;   for(position = 1; no_of_ip &amp;gt; position; position++ , clock())&lt;br /&gt;  {     &lt;br /&gt;  &lt;br /&gt;    if(data_in == 1)&lt;br /&gt;     display(position);   &lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;   } &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt; void clock(void)&lt;br /&gt; {&lt;br /&gt;   CLK = 1;&lt;br /&gt;   delay(1);&lt;br /&gt;   CLK = 0;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;void display(unsigned int value)&lt;br /&gt;  {  &lt;br /&gt;  unsigned int a[1];&lt;br /&gt;    Beep =   1;&lt;br /&gt;    lcd_init();&lt;br /&gt; lcd_cmd(0x01);   &lt;br /&gt;    string(&quot;Pressed key &quot;);&lt;br /&gt;    lcd_cmd(0xc0); &lt;br /&gt;  sprintf(a,&quot;%d&quot;,value);  &lt;br /&gt;     string(a); &lt;br /&gt;     delay(1);&lt;br /&gt;     Beep = 0;&lt;br /&gt;     &lt;br /&gt;  }   &lt;br /&gt;&lt;/stdio&gt;&lt;/regx51&gt;&lt;/pre&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;regx51 .h=&quot;&quot;&gt;&lt;stdio .h=&quot;&quot;&gt;&lt;br /&gt;&lt;/stdio&gt;&lt;/regx51&gt;&lt;/pre&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;/pre&gt;Download the whle file here&amp;nbsp;&lt;a href=&quot;https://github.com/thannara123/Parallel_to_serial&quot;&gt;github.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/2080519343227775998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/making-multiple-input-by-3-wire_8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2080519343227775998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2080519343227775998'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/making-multiple-input-by-3-wire_8.html' title='Making multiple input by 3 wire Interfacing .'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGdn9J3u-xa0VqSrUUbkiom40gf0zs_gcZYKejduMNsFRhYWY7Boc0ct2LvnJF1-JsHRi2HlLBUzxwsLDK1-6H93eKAWGfKuUBELqbBrKBCrQkcT1mE1I4e-_3loBFJf8wi10IRaCEAURf/s72-c/images.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-5615910683781486214</id><published>2018-05-08T11:28:00.003+05:30</published><updated>2018-05-08T11:28:55.664+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Making multiple input by 3 wire Interfacing .</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Parallel to serial &amp;nbsp;Interfacing with Micro controller&amp;nbsp;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;Interfacing with 74HC165 with 8051&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;I am trying to make multiple input with using minimum input port of micro controller ,ie 3 wire .&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
By using a 3 wire we can interface more input as we wish.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;I am making a tutorial for it , Basics of 74HC165 &amp;nbsp;which is a parallel to serial shift register .&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://www.google.co.in/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjo_4mgsoTMAhWIFJQKHXZlAAoQFggcMAA&amp;amp;url=http%3A%2F%2Fwww.nxp.com%2Fdocuments%2Fdata_sheet%2F74HC_HCT165.pdf&amp;amp;usg=AFQjCNF0DQaExmxrHtx8Y3cFVPTbwZOPxg&amp;amp;sig2=J16sjhukPlULD9DE2OnPvw&quot;&gt;Data sheet of 74HC165&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGdn9J3u-xa0VqSrUUbkiom40gf0zs_gcZYKejduMNsFRhYWY7Boc0ct2LvnJF1-JsHRi2HlLBUzxwsLDK1-6H93eKAWGfKuUBELqbBrKBCrQkcT1mE1I4e-_3loBFJf8wi10IRaCEAURf/s1600/images.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGdn9J3u-xa0VqSrUUbkiom40gf0zs_gcZYKejduMNsFRhYWY7Boc0ct2LvnJF1-JsHRi2HlLBUzxwsLDK1-6H93eKAWGfKuUBELqbBrKBCrQkcT1mE1I4e-_3loBFJf8wi10IRaCEAURf/s1600/images.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Only three pin is connected with this IC .&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
1) &amp;nbsp; SH/LD &amp;nbsp;or PL &amp;nbsp;is used load &amp;nbsp;parallel data to the IC .A low pulse (ground) is applied for store the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parallel data at the pin from A to H . And a High (5 Volt) is applied to stop the reading from the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PIN A to H .&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
2) Then to read the loaded or saved data to Micro controller we have to give clock to the PIN 2 of &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 74HC165 &amp;nbsp;(CLK) . 8 pulses is applied to read 8 bit (Pin A to B)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
3) QH / SO . serial out pin is used to get the stored parallel data to serially.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The CLK INH pin must be connect in ground for enable clock.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; To use cascaded 74HC165 for increasing i/p .connect the Seriall output pin (PIN 9) of first satge into serial input of first stage see the following circuit.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgLVYtc_MnoXAG5PO8f9xBvY-0zhkw5krohe8WQJk3bPbgvi-HMVLaQx9UG6dKwZoSC52C6bt-go_0Bed1_-dPFF8KETI0WD-vB6NE0cESMbrzn8L9mnC1LO-_TD63xPj_KhW8xvpQcS1/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYgLVYtc_MnoXAG5PO8f9xBvY-0zhkw5krohe8WQJk3bPbgvi-HMVLaQx9UG6dKwZoSC52C6bt-go_0Bed1_-dPFF8KETI0WD-vB6NE0cESMbrzn8L9mnC1LO-_TD63xPj_KhW8xvpQcS1/s1600/Capture.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
see the code below&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;  #include &lt;regx51 .h=&quot;&quot;&gt; 
#include&lt;stdio .h=&quot;&quot;&gt;
#include &quot;lcd.h&quot;  
sbit PL  = P1^0;   // Loading parallel data to HC165.
sbit CLK = P1^1;   // Clock pulse to HC165.
sbit Beep  = P1^2;   // 
sbit data_in  = P1^3;

  void clock(void);
  void display(unsigned char value);
     
void main()
{  
 unsigned char position ,no_of_ip = 17;
  lcd_init();
  string(&quot;   gElectron&quot;);     
  while(1)

   {  
      PL = 0 ;
  delay(2);
  PL = 1;

   for(position = 1; no_of_ip &amp;gt; position; position++ , clock())
  {     
  
    if(data_in == 1)
     display(position);   

  }
   } 
}  

 void clock(void)
 {
   CLK = 1;
   delay(1);
   CLK = 0;

 }

void display(unsigned int value)
  {  
  unsigned int a[1];
    Beep =   1;
    lcd_init();
 lcd_cmd(0x01);   
    string(&quot;Pressed key &quot;);
    lcd_cmd(0xc0); 
  sprintf(a,&quot;%d&quot;,value);  
     string(a); 
     delay(1);
     Beep = 0;
     
  }   
&lt;/stdio&gt;&lt;/regx51&gt;&lt;/pre&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;regx51 .h=&quot;&quot;&gt;&lt;stdio .h=&quot;&quot;&gt;
&lt;/stdio&gt;&lt;/regx51&gt;&lt;/pre&gt;
&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;/pre&gt;
Download the whle file here&amp;nbsp;&lt;a href=&quot;https://github.com/thannara123/Parallel_to_serial&quot;&gt;github.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/5615910683781486214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/making-multiple-input-by-3-wire.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/5615910683781486214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/5615910683781486214'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/making-multiple-input-by-3-wire.html' title='Making multiple input by 3 wire Interfacing .'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGdn9J3u-xa0VqSrUUbkiom40gf0zs_gcZYKejduMNsFRhYWY7Boc0ct2LvnJF1-JsHRi2HlLBUzxwsLDK1-6H93eKAWGfKuUBELqbBrKBCrQkcT1mE1I4e-_3loBFJf8wi10IRaCEAURf/s72-c/images.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-2233794675577971489</id><published>2018-05-08T11:26:00.003+05:30</published><updated>2020-09-30T07:35:08.066+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Rotation Counter using 8051</title><content type='html'>&lt;h2 style=&quot;text-align: center;&quot;&gt;&lt;u&gt;Rotation Counter using 8051&lt;/u&gt;&lt;/h2&gt;&lt;div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&amp;nbsp;I need to make a counter for a transformer winding&amp;nbsp;machine&amp;nbsp;.In that the winding is made by hand . so the roation &amp;nbsp;need to be keep in mind ,that is too much difficult .So the winding shaft rotaion counting by an infrared sensor module which is connected with 89S52 microcontroler and a LCD .&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;h2&gt;&lt;b&gt;Infrared based Rotation Counter by 805 or &amp;nbsp;(contact less&amp;nbsp;&lt;/b&gt;&lt;b&gt;Rotation Counter &amp;nbsp;or Rotation counter without using&amp;nbsp;Interrupt.&lt;/b&gt;&lt;/h2&gt;&lt;h2&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLd36oCpXxJoJLUxgOxYxYMdLRFmVNRyKMhaN0ucEshQG_FYOxOis9cO7-zU_cXq3RIjmXvO1BD1ezDfJXnVycDkIcxiz7zrIL9rL7BjfCT7Yyq-W0QcIvfT2TdcSp9ab4zkHg2fVdWU/s1600/pro3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLd36oCpXxJoJLUxgOxYxYMdLRFmVNRyKMhaN0ucEshQG_FYOxOis9cO7-zU_cXq3RIjmXvO1BD1ezDfJXnVycDkIcxiz7zrIL9rL7BjfCT7Yyq-W0QcIvfT2TdcSp9ab4zkHg2fVdWU/s640/pro3.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-_ANo3kCZnJtoPqcamZqU2ghdxa5K3uNRABUcpT_xTuWLyPHfIE0QXiA_jfzp05WPKm8aUyiHvCGuamWNEHiuEcY_N1dwzXuQb0lr8be-IIIuqPljn_NKPBQk-h95ESEU6fZwMwWb5fA/s1600/pr.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;416&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-_ANo3kCZnJtoPqcamZqU2ghdxa5K3uNRABUcpT_xTuWLyPHfIE0QXiA_jfzp05WPKm8aUyiHvCGuamWNEHiuEcY_N1dwzXuQb0lr8be-IIIuqPljn_NKPBQk-h95ESEU6fZwMwWb5fA/s640/pr.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;Code :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOnNYysHMJCz4Jr9VW8kiNnJlhJ5oKF_UhiFUBU2uIDA_0lr5DATxggHueAIV0npVUT7zh4K9eGn2gKcZ4_l4Eu3IlGjgdTzserKgdaZcxRz4d0EAz_n7NT-t_mEjGcITe4rkYyGJBx98/s1600/pro1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOnNYysHMJCz4Jr9VW8kiNnJlhJ5oKF_UhiFUBU2uIDA_0lr5DATxggHueAIV0npVUT7zh4K9eGn2gKcZ4_l4Eu3IlGjgdTzserKgdaZcxRz4d0EAz_n7NT-t_mEjGcITe4rkYyGJBx98/s640/pro1.PNG&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;img class=&quot;image-thumb-body&quot; src=&quot;blob:https://web.whatsapp.com/68ce3405-faa9-4dd7-8df7-26175eccddb3&quot; style=&quot;width: 330px;&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;INFRARED Module&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV3xVRihtF-sbepddiUupYpjr9BncqBhG93HqlFgTZl38wCpEPdXfiFIwP5x5nOBCytw3yI46F5Dsc7na75qHsNTaTitoQNt8XSQDqPOc2NcLAMRCFqX_F5hZohU-Gk8DGLVtL3Bm9RIg/s1600/robodo-ir-infrared-obstacle-proximity-line-following-sensor-400x400-imae5yfnufshgnnh.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV3xVRihtF-sbepddiUupYpjr9BncqBhG93HqlFgTZl38wCpEPdXfiFIwP5x5nOBCytw3yI46F5Dsc7na75qHsNTaTitoQNt8XSQDqPOc2NcLAMRCFqX_F5hZohU-Gk8DGLVtL3Bm9RIg/s320/robodo-ir-infrared-obstacle-proximity-line-following-sensor-400x400-imae5yfnufshgnnh.jpeg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/n7nYV6M2SeE/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/n7nYV6M2SeE?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Download the Full Project &amp;nbsp;CODE and with Proteus &amp;nbsp;&lt;a href=&quot;https://drive.google.com/file/d/0B94_MQ2kmgG4WDZ6WnF1MXRVRjg/view?usp=sharing&quot;&gt;Here&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/2233794675577971489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/rotation-counter-using-8051_8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2233794675577971489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/2233794675577971489'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/rotation-counter-using-8051_8.html' title='Rotation Counter using 8051'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLd36oCpXxJoJLUxgOxYxYMdLRFmVNRyKMhaN0ucEshQG_FYOxOis9cO7-zU_cXq3RIjmXvO1BD1ezDfJXnVycDkIcxiz7zrIL9rL7BjfCT7Yyq-W0QcIvfT2TdcSp9ab4zkHg2fVdWU/s72-c/pro3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-670140039674211556</id><published>2018-05-08T11:26:00.002+05:30</published><updated>2018-05-08T11:26:28.453+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Rotation Counter using 8051</title><content type='html'>&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;u&gt;Rotation Counter using 8051&lt;/u&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&amp;nbsp;I need to make a counter for a transformer winding&amp;nbsp;machine&amp;nbsp;.In that the winding is made by hand . so the roation &amp;nbsp;need to be keep in mind ,that is too much difficult .So the winding shaft rotaion counting by an infrared sensor module which is connected with 89S52 microcontroler and a LCD .&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;b&gt;Infrared based Rotation Counter by 805 or &amp;nbsp;(contact less&amp;nbsp;&lt;/b&gt;&lt;b&gt;Rotation Counter &amp;nbsp;or Rotation counter without using&amp;nbsp;Interrupt.&lt;/b&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLd36oCpXxJoJLUxgOxYxYMdLRFmVNRyKMhaN0ucEshQG_FYOxOis9cO7-zU_cXq3RIjmXvO1BD1ezDfJXnVycDkIcxiz7zrIL9rL7BjfCT7Yyq-W0QcIvfT2TdcSp9ab4zkHg2fVdWU/s1600/pro3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLd36oCpXxJoJLUxgOxYxYMdLRFmVNRyKMhaN0ucEshQG_FYOxOis9cO7-zU_cXq3RIjmXvO1BD1ezDfJXnVycDkIcxiz7zrIL9rL7BjfCT7Yyq-W0QcIvfT2TdcSp9ab4zkHg2fVdWU/s640/pro3.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-_ANo3kCZnJtoPqcamZqU2ghdxa5K3uNRABUcpT_xTuWLyPHfIE0QXiA_jfzp05WPKm8aUyiHvCGuamWNEHiuEcY_N1dwzXuQb0lr8be-IIIuqPljn_NKPBQk-h95ESEU6fZwMwWb5fA/s1600/pr.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;416&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-_ANo3kCZnJtoPqcamZqU2ghdxa5K3uNRABUcpT_xTuWLyPHfIE0QXiA_jfzp05WPKm8aUyiHvCGuamWNEHiuEcY_N1dwzXuQb0lr8be-IIIuqPljn_NKPBQk-h95ESEU6fZwMwWb5fA/s640/pr.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;b&gt;Code :&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOnNYysHMJCz4Jr9VW8kiNnJlhJ5oKF_UhiFUBU2uIDA_0lr5DATxggHueAIV0npVUT7zh4K9eGn2gKcZ4_l4Eu3IlGjgdTzserKgdaZcxRz4d0EAz_n7NT-t_mEjGcITe4rkYyGJBx98/s1600/pro1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOnNYysHMJCz4Jr9VW8kiNnJlhJ5oKF_UhiFUBU2uIDA_0lr5DATxggHueAIV0npVUT7zh4K9eGn2gKcZ4_l4Eu3IlGjgdTzserKgdaZcxRz4d0EAz_n7NT-t_mEjGcITe4rkYyGJBx98/s640/pro1.PNG&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;img class=&quot;image-thumb-body&quot; src=&quot;blob:https://web.whatsapp.com/68ce3405-faa9-4dd7-8df7-26175eccddb3&quot; style=&quot;width: 330px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
INFRARED Module&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV3xVRihtF-sbepddiUupYpjr9BncqBhG93HqlFgTZl38wCpEPdXfiFIwP5x5nOBCytw3yI46F5Dsc7na75qHsNTaTitoQNt8XSQDqPOc2NcLAMRCFqX_F5hZohU-Gk8DGLVtL3Bm9RIg/s1600/robodo-ir-infrared-obstacle-proximity-line-following-sensor-400x400-imae5yfnufshgnnh.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV3xVRihtF-sbepddiUupYpjr9BncqBhG93HqlFgTZl38wCpEPdXfiFIwP5x5nOBCytw3yI46F5Dsc7na75qHsNTaTitoQNt8XSQDqPOc2NcLAMRCFqX_F5hZohU-Gk8DGLVtL3Bm9RIg/s320/robodo-ir-infrared-obstacle-proximity-line-following-sensor-400x400-imae5yfnufshgnnh.jpeg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/n7nYV6M2SeE/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/n7nYV6M2SeE?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Download the Full Project &amp;nbsp;CODE and with Proteus &amp;nbsp;&lt;a href=&quot;https://drive.google.com/file/d/0B94_MQ2kmgG4WDZ6WnF1MXRVRjg/view?usp=sharing&quot;&gt;Here&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/670140039674211556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/rotation-counter-using-8051.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/670140039674211556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/670140039674211556'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/rotation-counter-using-8051.html' title='Rotation Counter using 8051'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDLd36oCpXxJoJLUxgOxYxYMdLRFmVNRyKMhaN0ucEshQG_FYOxOis9cO7-zU_cXq3RIjmXvO1BD1ezDfJXnVycDkIcxiz7zrIL9rL7BjfCT7Yyq-W0QcIvfT2TdcSp9ab4zkHg2fVdWU/s72-c/pro3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5685383281063442688.post-3328392894551286554</id><published>2018-05-08T11:25:00.002+05:30</published><updated>2020-09-30T07:35:08.331+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="Electronics"/><category scheme="http://www.blogger.com/atom/ns#" term="Interfacing"/><category scheme="http://www.blogger.com/atom/ns#" term="Microcontroller"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>16 Bit Event Counter &amp;amp; Displaying on LCD1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-large;&quot;&gt;&lt;b&gt;&lt;u&gt;An External Pulse Counter Using 8051 and Dispalying on 16x2 LCD&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-large;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444; font-size: x-large;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;A circuits which is used to count the external pulses And which is displaying on an 16x2 LCD display . You can simply use this project for various purpose .It is a&amp;nbsp;default&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp;project for counting Purpose.&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfw1ZJVDePMm4aSDPwB1h1qg4aWFZR4TQHBWZ-XAj6N3ImWRd46FKhNfnU0jyFEm63poo6kllcHdJi1Hp7zJIDsxhpa8IaAS1bsZEumZ314Iv6Bo3pz7Z5y_PY1BwYlGN1_kxMuNDCSKu/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;377&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfw1ZJVDePMm4aSDPwB1h1qg4aWFZR4TQHBWZ-XAj6N3ImWRd46FKhNfnU0jyFEm63poo6kllcHdJi1Hp7zJIDsxhpa8IaAS1bsZEumZ314Iv6Bo3pz7Z5y_PY1BwYlGN1_kxMuNDCSKu/s640/Capture.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Tutorials : -&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;To use 16 Bit counter we need to configure some register in 8051 as follows&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;TMOD Register is need to configure as follows&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;16 bit counter Setting with timer 0&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;TMOD=0x05; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;//&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt; &amp;nbsp;Giving 0x05 it configured so .&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;8051 has Two Timer (each has 16 bit ) i am taking here Timer 0 It has to part First 8 bit (TL)) and the&amp;nbsp;second&amp;nbsp;part is (TH0) .&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;This timer is using to store the Pulses from the external (ie it will increment up to 65535 or FFFF)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;color: #444444; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;TL0 = 0; // &lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;that timer&amp;nbsp;clearing&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;TH0 = &lt;/b&gt;0;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;nbsp;//&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;that timer&amp;nbsp;clearing&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp;TR0 = 1 // TR0 setting to start the counting .&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Done .................................&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp; &amp;nbsp; After setting the above register as said &amp;nbsp;the resulted value (counting value ) will save periodically in TL0 and TH0 . That value&amp;nbsp;displaying&amp;nbsp;after converting it to&amp;nbsp;decimal&amp;nbsp;. for LCD Tutorials&amp;nbsp;&lt;a href=&quot;http://circuits-collection.blogspot.in/2015/09/lcd-4-bit-mode-interfacing.html&quot;&gt;Go Here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXXaZwxr8Phs8h7wDs4lVshvkWC2rDecsJyjPrB_PJPolYvf0fMi-VKO8oJbfEgyqySh_q30R2thlnHd6FVtuBQNIabBVjnsw6H8gNC7mviI4yf4tsMygtJY4uTkspvLYuxK9gd_3hqvC/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;492&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXXaZwxr8Phs8h7wDs4lVshvkWC2rDecsJyjPrB_PJPolYvf0fMi-VKO8oJbfEgyqySh_q30R2thlnHd6FVtuBQNIabBVjnsw6H8gNC7mviI4yf4tsMygtJY4uTkspvLYuxK9gd_3hqvC/s640/Capture.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;Download Her the all Project Including Proteus file  &lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;!-- circuits-collection_sidebar_AdSense1_250x250_as --&gt;&lt;br /&gt;&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-8429441124104529&quot; data-ad-slot=&quot;5847926949&quot; style=&quot;display: inline-block; height: 250px; width: 250px;&quot;&gt;&lt;/ins&gt;&lt;script&gt;(adsbygoogle = window.adsbygoogle || []).push({}); &lt;/script&gt;&lt;a href=&quot;https://drive.google.com/open?id=0B0pTqKFEGreLZEo4dmNYNGFkU3c&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; Click Here&lt;/span&gt;&lt;/a&gt;       &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://circuits-collection.blogspot.com/feeds/3328392894551286554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/16-bit-event-counter-displaying-on-lcd1_8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/3328392894551286554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5685383281063442688/posts/default/3328392894551286554'/><link rel='alternate' type='text/html' href='http://circuits-collection.blogspot.com/2018/05/16-bit-event-counter-displaying-on-lcd1_8.html' title='16 Bit Event Counter &amp;amp; Displaying on LCD1'/><author><name>Gireesh</name><uri>http://www.blogger.com/profile/03798448816218052662</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfw1ZJVDePMm4aSDPwB1h1qg4aWFZR4TQHBWZ-XAj6N3ImWRd46FKhNfnU0jyFEm63poo6kllcHdJi1Hp7zJIDsxhpa8IaAS1bsZEumZ314Iv6Bo3pz7Z5y_PY1BwYlGN1_kxMuNDCSKu/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>