LED Clock Using PIC (Microcontroller)

Now you can always know
the exact time. With this design you can have an atomic clock in your
room. Isn’t that great? Read on to know more.

First of all, it is not about any radioactive elements here. This is
about building a clock display that can get the time from the DCFF77
facilities in Frankfurt, Germany.All that is needed is a clock LED红包扫雷苹果下载地址 display, DCFF77 receiver, and a microcontroller along with the necessary connections.

Basically, the project allows a signal that is sent by the DCFF77
radio station to be decoded. After that. the microcontroller process it
and sends it to the LED display to show the
exact time. There is no need to build a signal receiver, a good quality
红包扫雷苹果下载地址 receiver can be bought on the internet for a low price.

Once everything has been set in the connection board the PIC
source code should be developed. The orientation of the antenna should
be perpendicular to Frankfurt. It will receive signal if it is within
2000 miles from the city. If there is a signal, the period on the clock LED display will blink in a constant rhytm. When a full cycle of binary pulses is received, the clock will show the exact time.

Microcontroller based running light controller

红包扫雷苹果下载地址this project is a lights effects board using common bulbs.

Description


This project provides some lighting effect by the blinking pattern of the bulbs connected at its output. Up to 8 Bulbs can be connected in between connector CN2 to CN9 and AC power to control them should be connected at Connector CN10. DC Power should be applied at Connector CN11 in accordance with the polarity marked on this connector. Care should be taken while using this it as it contains Main Power on the board.

we can change the blink pattern by the press of the set switch and change the blinking speed by the press of the up and down keys on the pcb. fuse f1 will protect the kit from any possible short circuit and excess current flowing through it.

Features:

– Microcontroller based design for greater flexibility and ease of control
– Triac based switching of loads connected to the circuit
– Industry standard isolation with the help of Opto enabled Triac Control
– Fuse protection for AC output
– SUPPLY 9-12V DC & 230V AC
– LOAD-100W max on each output
– Simple and easy to use 3 tactile switch enabled control of the project
– PBT type connector for connecting supply (AC/DC) and TRIAC output on the PCB
– Onboard regulator for regulated supply to the project
– Diode protection for reverse polarity connection of DC supply to the PCB
– Four mounting holes of 3.2 mm each
– PCB dimensions 86 mm x 173 mm

 

Schematic


Parts List


 

PCB


 

Downloads


PIC Microcontroller Primer – Tutorial #1

Pic microcontroller tutorial
Welcome to the starting line of the PIC Microcontroller Primer. Microchip manufacture a series of microcontrollers called PIC, and this tutorial series will take you from the basic structure of PIC µCs right through to the programming methods and techniques.

红包扫雷苹果下载地址note that there are many different pic µc packages are now available, from some basic low memory types to ones that have analogue to digital converters (adc) and even pulse width modulator (pwm) blocks built in. at first, i am going to focus on the emblematic pic12f675 µc. once you have learnt how to program one type of pic µc, learning the rest is sweet and simple!

PIC 12F675 microcontroller

pic 12f675 is an 8-pin, flash-based 8-bit, pic ® mid-range cmos µc, comes in 8-pin pdip, soic, mlf-s and dfn packages. one advantage of pic12f675 when compared to its predecessor pic 12f629 is that 12f675 has an inbuilt 10-bit adc. in short, the feature-packed 12f675 has 1024 words of program memory, 64 bytes of ram and 128 bytes of eeprom, an internal oscillator, timers, an adc and a comparator. since this tutorial part contains basic device specific information for the pic12f675, additional information may be collected from the datasheet published by microchip.

PIC12F675 pinout
PIC 3

PIC 12F675 Mini Development Board

as a part of learning, it is recommended to build your own pic12f675 mini development board. the circuit shown here is easy enough to make a development board yourself. for hardware all we need is a standard piece of perforated prototyping board, ic socket, headers with a 0.1 inch (2.54 mm) pitch, and a handful of discrete components in addition to the fixed voltage regulator chip and the pic12f675 microcontroller. the components of the development board can be mounted on the top side of the prototyping board (as usual) and soldered on its underside. then attach the headers to the prototyping board with solder joints on its underside. remember to leave a little gap between the underside of the prototyping board and the plastic carrier of the headers to allow for soldering there later. ordinary wire can be used to connect between the components and the header pins. the development board can be powered from any 9-12 v standard dc power supply source.

Headers on the prototyping board

(headers on the prototyping board – an example)

here is the circuit diagram of the mini development board. the icsp header in the board allows you to program the pic 12f675 microcontroller using an icsp programmer (will discuss later).

Pic development board circuit

PIC USB Programmer

microchip’s pickit2 is a usb based icsp (in circuit serial programming) programmer. this programmer is preferred here because it is much more comfortable, reliable and powerful than any other programmer we can find all over the internet world.

PICkit 2
PICKit2  Connector Pinout

well, next is a simple programming tutorial on the pic 12f675 microcontroller which shows you how to program and use it as a simple led flasher.

→ part 2 (to continue)

8051 Microcontroller Overview & Hardware – Tutorial #1

the intel 8051 series 8bit microcontroller, originally introduced in 1980, remains popular and has had perhaps the longest product life of all such devices. it has become the industry standard for real-time and boolean control applications.

红包扫雷苹果下载地址while some (who should know better) have said that the 8051 is dead, it continues to be a viable choice for both design upgrades and new applications as faster, more advanced versions appear. most engineering students study this device in order to round out their education. it is generally programmed in assembly code rather than compiled from high level languages. as a result, the speed is optimized and it can often outperform modern devices that are programmed only in high level languages.

红包扫雷苹果下载地址only the also very popular microchip pic microcontrollers can touch the 8051 series features and performance etc. –these were introduced some 13years later, but are essentially limited to one vendor and have not caught on as an industry standard.

红包扫雷苹果下载地址this is the first of a series of tutorials on these devices. while understanding the basics, i realize the limitations of my knowledge –while i can write code, make things work and pride myself on routine optimization, i freely admit that i am no expert. as a result, there will be some shortcomings in my presentation –it will be from my (perhaps myopic) point of view.

Hardware schematic of LED Chaser

AT89C2051 Schematic

Manufacturers (not an exhaustive list –also some have already discontinued this series –perhaps too many players to corner sufficient market share)
The following vendors have either licensed or cloned the intel 8051 microcode:

AMD
Philips /NXP
Atmel 89x
Dallas-Maxim
Infineon C500
SiLabs
Cypress Semiconductor
Analog Devices
Texas Instruments
Matra /Harris
Oki
Siemens
SSI
Zilog

Initial 8051 versions

“8051” is simply the generic name given to the entire series because it was the first single chip microcontroller solution of the series. following are six basic intel versions with which the reader should be familiar –other vendors generally construct part numbers from their own prefix and the last two digits of the these intel versions. the physical package is subsequently denoted by the suffix. beyond this there are numerous differences, so it is necessary to study the specific datasheets.

  • 8031 128 bytes RAM, external code memory (3 chip solution –CPU, address latch, external ROM)
  • 8032 256 bytes RAM, external code memory
  • 8051 128 bytes RAM, 4K Internal mask ROM for code memory (single chip solution)
  • 8052 256 bytes RAM, 8K Internal mask ROM for code memory
  • 8751 128 bytes RAM, 4K UV erasable EPROM (quartz window) (single chip, reprogrammable)
  • 8752 256 bytes RAM, 8K UV erasable EPROM (quartz window)

红包扫雷苹果下载地址the initial devices were power hungry nmos technology –later, more efficient cmos devices were introduced –some have various power shutdown modes to further conserve power, but in no way can they match modern “flea power” devices that are designed for long-life battery applications.

Types of memory –FYI

  • RAM Static memory for variables and the stack –variables and return address are stacked during interrupts and sub-routines etc.
  • ROM or PROM Read only (external program code memory)
  • Mask PROM Internal code memory that is masked upon manufacture and cannot be altered
  • Flash or EEPROM Electrically Erasable internal, reprogrammable code memory)
  • EPROM Read only (internal or external code memory) UV erasable via quartz window –requires programmer in order to generate the high voltage (12V) required for programming
  • OTP One time programmable (internal code memory) EPROM without quartz window

note that the larger microcontroller devices (e.g. 40pin or larger) can access either internal or external code memory via an external data bus –the smaller devices (e.g. 20pin) access only internal code memory and cannot manage a tri-state data bus.

Atmel –best for experimenters

红包扫雷苹果下载地址of the many vendors who offer these devices, atmel shines brightest. while other vendors have added features, flash program memory, increased the clock rate and reduced the number of clock cycles per instruction, atmel has both doubled the speed and blown the bottom out of the price with many devices selling for approximately $1 each. very popular is the bare bones atmel 89c2051 in a dip-20 package. it must be programmed in a programmer. also very popular is the at89s52 in either a dip-40 or plcc-44 package. it may be programmed in a programmer, but also has provision for in-circuit programming via the isp serial programming interface feature that uses a simple 10pin connector –no, it cannot bootload like the avr devices. both devices are very inexpensive and great for the experimenter –software and programmers will also be chosen for minimum cost. future tutorials will focus on these two atmel devices.

Datasheets
AT89C2051

Microcontroller Photos

Microcontroller Photos

For more reading

Challenge

someone, pick up the gauntlet of writing a tutorial on the pic microcontroller.

For the future (partial list)

  • LED Chaser (basic AT89C2051 schematic driving 8LEDs)
  • AT89 Features
  • Assembly code
  • Programming tools
  • ASM51 assembler software

Undocumented words and idioms –for our ESL friends

  • flea power –extremely low power for long battery life –literally, the power of the tiny fea
  • bare bones –most simple version –literally the bones of a skeleton

Bootload an ATmega Microcontroller & Build Your Own Arduino – 2

红包扫雷苹果下载地址since you lacked the usb interface in your own arduino board, it becomes necessary to use a homemade/ready-made usb to serial converter module as an efficient and economical solution. inexpensive and easy-to-use usb to serial converter modules are now widely available, such as one shown here. with the help of this little module you can program your own arduino through a simple interfacing as described.

USB to Serial Converter Module

usually, one usb interface connection, and six output connections (dtr, rxi, txo, 5v, cts, gnd) are available in the module. you need only 5 connections for our arduino, so just leave the cts terminal and connect the rest to the arduino as shown in this table.

Arduino USB interface connection

if you want to make your own usb to serial converter module, then refer this tried & tested circuit diagram of the usb to serial converter (ftdi) module. good skill in smd soldering is a prerequisite!

USB to Serial Converter (FTDI) module circuit

got it? now you have a little arduino board using an atmega328p (pre-loaded with arduino bootloader) as its brain. further, you can upload your sketch from the arduino ide to the arduino board with the help of an ftdi module.

since you have an avr usbasp programmer in hand,is it possible to upload bootloader and/or program code to arduino using the same usb asp programmer, instead of the proven methods described earlier? the answer is yes! avr usbasp is a usb in-circuit programmer and it can use to program most of the atmel avr controllers. it simply consist of an atmega8 and a couple of passive components such as resistors, capacitors, leds, etc. the programmer uses a firmware-only usb driver and there is no special usb controller is needed.

Burning Arduino Bootloader with AVR USBasp

红包扫雷苹果下载地址here, i am going to show you the simplest way of burning the arduino bootloader firmware into the atmega328p microcontroller chip on arduino board. first of all, follow the wiring indicator, just pick your usbasp programmer, and connect it to the arduino board/atmega328p chip.

USBasp programmer

Note that the output socket/connection cable of the USBasp programmer is not compatible with the ICSP connector on Arduino board, so you need to find a way to connect the USBasp interface to the Arduino board/ATmega chip. After connecting the AVR-USBasp programmer from your computer to the Arduino board, open the Arduino IDE and click on Tools menu and under the Programmer sub-menu select USBasp. Then, click on the Burn Bootloader to start burning the bootloader under Tools menu. Arduino IDE will display “Done burning bootloader” after it is done. That’s all!

Arduino menu

No USBasp in Tools Menu?

don’t panic…by default,you can’t find such an option in the arduino ide. there is a simple trick that you should use if you want to work with your avr usbasp programmer. using the trick you can use your avr usbasp programmer to program avr microcontrollers without pre-loaded bootloaders,too! the steps are given below:

  • Go to the Drive where you installed your Arduino software (for example C:\Arduino IDE -0022)
  • Now open the program folder,go to the preferences.txt file (for example: C:\Arduino IDE-0022\Arduino-0022\lib\preferences), find the sentence upload.using = bootloader, and change it to upload.using = usbasp
  • After this modification,save it and close it. Next,open the hardware folder (for example: C:\Arduino IDE-0022\Arduino-0022\hardware\arduino\programmers),open the programmers.txt file and add another two lines below the final line in the text file (see the notepad window):
    USBasp.name=USBasp
    USBasp.protocol=usbasp

红包扫雷苹果下载地址finally, save and close the text file,then open the arduino ide as usual,write your program in it and load the sketch (code) to your avr microcontroller using the avr usbasp programmer.

Sketch ps

红包扫雷苹果下载地址arduino makes electronics projects easier,and that’s why arduino is intentionally included in this avr tutorial series. next,we are going to start a simple robotic project using an avr microcontroller. before that interesting move, i would like to introduce arduino builder to you!

Arduino Builder

arduino builder is a fully standalone utility for viewing, compiling and uploading arduino sketch file and compiled elf or hex file (usually bootloader) to arduino board with arduino serial programming interface, usbasp or arduino isp, without the need for arduino ide. this can be easily done with no more than 3 steps. when compiling is required (for uploading sketch file), the utility scans the sketch for referenced libraries and build the necessary libraries automatically. arduino builder comes in gui (graphic user interface) version, for normal end users.

Arduino builder

Why prefer this utility as the Arduino IDE can do everything?

sometimes, we only want to compile a pre-written sketch and upload it to arduino. normally we do this with arduino ide, but it’s not the best experience. sometimes, we just want to burn bootloader in hex file for a board. there are many guis to avrdude out there for doing this. but many of them are out-dated and do not handle for leonardo (atmega32u4 based), not mentioning they are just guis to avrdude which can’t compile.

红包扫雷苹果下载地址you can download the latest (windows) version of arduino builder from here:

→ Part 23:
红包扫雷苹果下载地址 ← Part 21:

Build Your Own Arduino & Bootload an ATmega Microcontroller – part 1

红包扫雷苹果下载地址there are many reasons to build your own arduino circuit on a protoboard or a custom-designed printed circuit board. at the heart of the arduino platform is an avr microcontroller, in usual way you need a special hardware programmer and suitable hex files to program the atmel avr chip. fortunately, arduino is a beginner-friendly platform because a bootloader is included in the avr chip which allows you to program the board over the serial port without any dedicated avr programmer.

the bootloader is basically a small hex file that runs when you turn on the arduino board. at first looks around to see if the computer (at the serial port) is trying to program it. if so, it absorbs the program code from the computer and transfers it into the avr chip, in a specific location so as not to overwrite the bootloader. if the computer isn’t trying to upload any code, it instructs the microcontroller to run the code that’s already stored inside.

Arduino uno r3 schematic

红包扫雷苹果下载地址original circuit diagram: arduino uno r3

now, have a look at our favorite arduino uno to find out the avr chip inside. it is atmega328p-pu, a low-power version of the traditional atmega328-pu. the p indicates pico for pico-power which is a technology atmel has developed that allows the microcontroller to run with less power. this atmega328 chip holds a pre-burned bootloader, allows you to upload code without using any additional hardware. so if you are in a plan to make your own open source microcontroller platform – arduino, no doubt, you need an avr chip with pre-charged bootloader!

红包扫雷苹果下载地址this part of avr tutorial will teach you how to make your own arduino chip, ie atmega328p with arduino bootloader. first we need one blank atmega328p-pu microcontroller with a few supproting components:

  • Atmega328-PU/ Atmega328P-PU – 1
  • 16Mhz Xstal – 1
  • 22pF Ceramic Capacitor – 2
  • Small Breadboard / Protoboard & 28-Pin (PDIP) IC socket – 1
  • Your Arduino UNO board (here used as a programmer)

红包扫雷苹果下载地址if you go through the arduino ide you can see an example sketch called “arduino as isp”. if you upload this code to your arduino, it will basically act as an avr programmer. next, set-up your arduino as an isp. here is the procedure:

  • Plug in your Arduino UNO (through USB) to your computer
  • Open the Arduino IDE
  • Open → Examples → ArduinoISP
  • Select → Arduino UNOfrom Tools Board →
  • Select your Serial Portfrom Tools Board →
  • Upload the Sketch (When finished, close the IDE and disconnect your Arduino)

Arduino software interface

it is probably easier to just install the bootloader from the arduino ide. arduino takes care of all the messy details for you when you burn bootloaders through it. finally, prepare the hardware by following the wiring diagram shown here. keep an eye on the pins miso, mosi, sck, power, ground, and reset. these are the pins you’ll need to flash the firmware on your chip.

Atmega328p programmable pins

as stated, the easy way to upload the bootloader involves using the arduino ide. open your ide select the board you want to program. then select the programmer (since you are using the arduino as isp you will also need to select the com port that the arduino as isp is connected to). then select burn bootloader. this will take the board you selected and look up the associated bootloader in the board.txt file. next, it will find the bootloader in the bootloader folder and install it.

P21  4

红包扫雷苹果下载地址yes,now you have an arduino chip! you can use this for your next standalone arduino project, or to make your own little arduino board. however, keep it in mind that this is not the one and only proven method for making an independent arduino chip. you can find numerous ideas, tips and tricks everywhere in internet. next is the complete schematic diagram of a little arduino board for your everyday projects. use the atmega328p chip, with arduino bootloader loaded by you, as the brain of this economical circuit.

Diy arduino schematic

红包扫雷苹果下载地址there are many circuit diagrams available online for building an arduino on a protoboard, but after an extensive research and after some little tweaks, i’ve come up with this tried and tested circuit. i hope this will help those who want to play in the arduino world but can’t afford a full fledged, luxurious arduino uno board.

Where is the USB?

yes, you are right! the usb port for interfacing arduino with your pc is missed here. in arduino uno boards, there is an smd chip (ic) which works as a usb to serial converter, allows us to program the arduino using our computer (uno r3 uses an atmega 16u2). fortunately, this is not a serious problem for you because you can buy a ready-made usb to serial converter module as a powerful and economical alternative resolution!


← Part 20:

Microcontroller Bitwise Operators + #2 – Tutorial #9

红包扫雷苹果下载地址this is the leftover part of basic bitwise operators, prepared to draw your attention to some more learning points in connection with the bitwise operation. in the previous tutorial, we learned all about decimal system, binary system, bitwise logic, assignment opeartors, bitshift operators, etc. so to recap: an operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. as you may well know, c++ have many built-in operators including the following:

  • Bitwise Operators
  • Logical Operators
  • Assignment Operators
  • Arithmetic Operators

红包扫雷苹果下载地址bitwise operator works on bits and perform “bit-by-bit” operation. supported logical operators are and, or and not. there are following assignment operators, and arithmetic operators.

Avr assignment operators

The assignment operator assigns a value to a variable. The statement X = 5红包扫雷苹果下载地址 assigns the integer value 5 to the variable X. And the statement X = Y assigns to variable X the value contained in variable Y. The value of X at the moment this statement is executed is lost and replaced by the value of Y. Note that the assignment operation always takes place from right to left.

a word of caution! the assignment operator (operator =, with one equal sign) is not the same as the equality comparison operator (operator ==, with two equal signs). the first one (=) assigns the value on the right-hand to the variable on its left, while the other (==) compares whether the values on both sides of the operator are equal.

Microcontroller arithmetic operators

Literally, operations of addition, subtraction, multiplication and division correspond to their respective mathematical operators. As an example , assume that variable A holds 20 and variable B holds 40, then A + B will give 60 , and A++ will give 21 . The modulus operator, represented by the % sign , gives the remainder of a division of two values. For example, X = 11 % 3 results in variable X containing the value 2, since dividing 11 by 3 results in 3, with a remainder of 2. There are few other operators supported by C++ Language, and a forthcoming chapter will examine them one by one.

Boolean Operations?

a bit (short form of binary digit) is the minimum amount of information, since it only stores either value 1 or 0, which represents either yes or no (true or false). many operations can be performed with bits, either in alliance with other bits or themselves alone. these operations receive the name of boolean operations, comes from the name of the mathematician george boole. next you have a list of the basic boolean operations. combining these operations we can obtain any possible result from two bits.

  • AND: This operation is performed between two bits. The result of applying the AND operation is 1 if both are equal to 1, and 0 in all other cases.
  • OR: This operation is also performed between two bits . The result is 1 if either one of the two bits is 1, or if both are 1. If none is equal to 1 the result is 0.
  • NOT: This operation is performed on a single bit. Its result is the inversion of the actual value of the bit.If it was set to 1 it becomes 0, and if it was 0 it becomes 1.

The operator ! is the C++ operator for the Boolean operation NOT. The logical operators && and || corresponds to the Boolean logical operation AND, the Boolean logical operation OR respectively. When using the logical operators, C++ only evaluates what is necessary from left to right to come up with the combined relational result, ignoring the rest. Look at this example (5==5)||(5>6)红包扫雷苹果下载地址. Here, C++ evaluates first whether 5==5 is true, and if so, it never checks whether 5>6 is true or not. This is known as “short-circuit evaluation”.

Difference between the Bit-wise AND and the Conditional AND operators

The & operator is the “bit-wise AND” operator. This permits you to manipulate individual bits in a number. The &&红包扫雷苹果下载地址 is the “conditional AND” operator, and the && operator is evaluated in short circuit fashion. The & (unconditional) “logical AND” operator, when applied to boolean value yield a boolean value. This operator is similar to the && operator, except that the & operator is not evaluated in “short-circuit” fashion. That is, both operands are first evaluated before computing the result.

i thrashed over a lot that you may catch in later tutorials. you now know just enough to be serious and i hope this learning process hasn’t caused your brow to do too much harm to your tabletop!

Code Snippet of the “LED+Switch” Project in Part 8!

int main(void) {
    init();
    //Set the Data Direction Register for the LED to output
    DDRC |= (1<<5);
    //Set the Data Direction Register for the switch to input
    DDRC &= ~(1<<3);
    //Enable the pullup resistor for the switch
    PORTC|=(1<<3);
    while (1) {
        if (PINC & (1<<3))
            PORTC|=(1<<5);
        else
            PORTC&=~(1<<5);
    }
}

→ Part 10:
← Part 8:

Microcontroller Bitwise Operators + #1 – Tutorial #8

红包扫雷苹果下载地址in this part i am going to shed some light on the background of the coding process. the first attempt is to explain the basic bitwise operators available in the c++ language. for better explanation i will express most integer values using binary notation, also known as base two (in the traditional decimal system, the base is ten). in this system, all integer values use only the values 0 and 1 for each digit.each 0 or 1 digit is called a bit, which is the short form of binary digit.

  • In Decimal System (base 10), a number like 453 means 4×102 + 5×101 + 3×100.
  • In Binary System (base 2), a number like 1101 means 1×23 + 1×22 + 0×21 + 1×20 (ie 8+4+1 = 13). Remember that any number to the power zero equals one!

the binary scale is a method of writing numbers using only 2 figures, 0 and 1, instead of the decimal scale 0 to 9. whereas decimal numbers are formed on the base 10 so that each number position has ten times the value of the adjacent position on the right, binary numbers are formed on the base 2 so that each number position has two times the value of the adjacent position to the right. note that most c++ compilers do not have any means of expressing binary numbers directly in source code. some allow the prefix 0b followed by a series of 0 and 1 digits.

Bitwise AND

The bitwise AND operator in C++ is a single &红包扫雷苹果下载地址, used between two other integer expressions. Here, if both input bits are 1, the resulting output is 1, otherwise the output is 0.

  • 0 & 0 == 0
  • 0 & 1 == 0
  • 1 & 0 == 0
  • 1 & 1 == 1

Bitwise OR

The bitwise OR operator in C++ is the vertical bar symbol |红包扫雷苹果下载地址. The bitwise OR of two bits is 1 if either or both of the input bits is 1, otherwise it is 0.

  • 0 | 0 == 0
  • 0 | 1 == 1
  • 1 | 0 == 1
  • 1 | 1 == 1

Bitwise NOT

The bitwise NOT operator in C++ is the tilde character ~红包扫雷苹果下载地址. Bitwise NOT changes each bit to its opposite: 0 becomes 1, and 1 becomes 0.

  • ~0 == 1
  • ~1 == 0

Bitwise XOR

There is a somewhat unusual operator in C++ called bitwise exclusive OR, also known as bitwise XOR, written using the caret symbol ^.
红包扫雷苹果下载地址 This operator is often used to toggle (i.e. change from 0 to 1, or 1 to 0) some of the bits in an integer expression while leaving others alone. This operator is very similar to the bitwise OR operator, only it evaluates to 0 for a given bit position when both of the input bits for that position are 1:

  • 0 ^ 0 == 0
  • 0 ^ 1 == 1
  • 1 ^ 0 == 1
  • 1 ^ 1 == 0

Assignment Operators

often in programming, you want to operate on the value of a variable x and store the modified value back into x. in most programming languages, for example, you can increase the value of a variable x by 3 using the code:

x = x + 3; // increase x by 3  
/* or you can write it like this: */
x += 3; // increase x by 3

Bit Shift Operators

There are two bit shift operators in C++: the left shift operator << and the right shift operator >>. These operators drive the bits in the left operand to be shifted left or right by the number of positions specified by the right operand. In short, an expression like a<<b will be evaluated as the binary representation of “a” will be shifted “b” times to the left, and the value is getting larger.

Bit shift operators example

Then what about 4>>1?

红包扫雷苹果下载地址here the binary representation of 4 will be shifted 1 time to the right, ie

  • 4 → 00000100
  • 4>>1 = 00000010 (the decimal value is 2)

Note: Don’t think that the bitwise operator in C++ is same as the boolean operator. Remember, the bitwise AND operator (&) is not the same as the boolean AND operator (&&). I will explain this in the forthcoming part.

Bitwise boolean operators

红包扫雷苹果下载地址following is a simple practical test. i just wired a push button switch on pc3, and one led on pc5 of atmega8 as shown in the diagram. i want to turn off the led when push button is pressed. try to write the code snippet for this task. helpful indicators are given in the template (answer will be published on next part)!

AVR 8   F1

int main(void) {
   init();
   //Set the Data Direction Register for the LED to output
   ..................................;
   //Set the Data Direction Register for the push button switch to input
   ..................................;
   //Enable the pullup resistor for the push button switch
   ..................................;
   while (1) {
      if ( …................................ )
         PORTC|=( …................................ );
      else
         PORTC&=~( …................................ );
   }
}

→ Part 9:
← Part 7:

Microcontroller – Invention History and Story Behind the Scenes

Invention History of Microcontroller

红包扫雷苹果下载地址would you believe that each one of you is using at least 20 microcontrollers in your house©©!! well, that’s a fact. there are more than two billion microcontrollers being produced every year. almost everybody in developed as well as developing nations cannot think of a day without using microcontrollers.

红包扫雷苹果下载地址the microcontroller is an embedded computer chip that controls most of the electronic gadgets and appliances people use on a daily basis, right from washing machines to anti-lock brakes in cars. now, how did this idea of a microcontroller emerge© what is the invention story of this powerful chip©

Invention of Microcontrollers

TMS 1802 NC Microcontroller Chip
TMS-1802-NC Microcontroller Chip

It was during 1970 and 1971 when Intel was working on inventing the world’s first microprocessor, that Gary Boone of Texas Instruments was working on quite a similar concept and invented the microcontroller. Boone designed a single integrated circuit chip that could hold nearly all the essential circuits to form a calculator; only the display and the keypad were not incorporated. Surprisingly, this exceptional breakthrough in the field of electronics and communication was rather given a mundane name of TMS1802NC; however, the device wasn’t ordinary. It had five thousand transistors providing 3000 bits of program memory and 128 bits of access memory!! So, it was possible to program it to perform a range of functions.

Story of the first microcontroller

it is a known fact that requirements and needs lead to inventions and discoveries.

business at the texas instruments mos department was mostly a custom business wherein companies like desktop calculator manufacturers came to ti with a set of specific requirements. ti converted those specifications to a chip set, normally four, five or six chips to execute or implement the specifications for popular companies like canon, olympia or olivetti.  for these companies, it was really amazing that ti provided this ultimate service of compressing so many units on to just four or five or six chips because the previously used technology called the ttl would use hundred to two hundred chips. no wonder the business was doing great.

it was during these times that gary boone was with a few other people making extensive research within the country as well as flying to germany, italy and other countries. they were trying to understand the needs of the new customers and work on it. boone was literally bored after doing this a number of times. besides, since their previous projects were all successful and they had a flock of satisfied customers, a new set of customers required them to do the same work they did to someone else the previous year. thus, there was a significant demand for more and more of these projects.

a common rule at texas was “one riot, one ranger” which means “one chip, one engineer.” so texas instruments that had about twenty mos design engineers deployed three or four of these at one project at a time. and, it took about six months to complete one project. therefore, business capacity was the number of engineers divided by the number of chips, once in every six months. though the requirements of these projects differed in terms of detail, the major principle and the overall function was quite identical. so, the engineers were really tired of doing these monotonous projects. they were working for long hours and they felt a better way to accomplish these projects should be explored.

boone and the other engineers ended up thinking of a matrix of customer needs one way and chunks of circuitry or functional blocks the other way. boone could find out the commonality and he, along with the others considered simulating the thought, “okay, now if i had these many bytes of data storage, and i had this many bytes of program storage, and i had these many bits of keyboard scan interface, then that would cover all of the specification i know about, maybe.” as a result of this excellent thought, came the first tms 100 microcontroller chip. isn’t it truly exciting to know that this breakthrough device came out of boredom, a vision of commonalities and high demand that were being inadequately served by deploying large teams with many chips©!

红包扫雷苹果下载地址one crucial technical aspect was that the design technology in those days was quite inefficient in terms of how silicon was utilized. different architectures had to be chosen so that the regular structures and memory had to be emphasized; besides, pitch-matching also had to be given emphasis so that a bit-slice concept wherein everything matching to each of the four bits of a four bit adder was laid out to be of the same dimension in physical terms. only then it would fit together and match in pitch. ultimately, another factor of three or four in terms of silicon density would be achieved.

in spite of the constraint of architectures that were primarily memory and pitch-match oriented, the then invented microcontroller was much better than the previous ttl technology and ended up with much efficient use of silicon. this microcontroller was used at the texas instruments internally in its calculator products between 1972 and 1974. the device was further refined over the years. ti offered this microcontroller for sale to the electronics industry in 1974. it was made available in different configurations of ram and rom sizes. by 1983, nearly 100 million tms 1000 had already been sold.

year after year, microcontrollers were seeing tremendous growth and usage.

Intel Microcontrollers

Intel also created many significant microcontrollers besides producing the world’s first ever microprocessor. The important ones produced by Intel are the 8048 and the 8051 microcontrollers. 8048 was introduced in 1976 and was the first of Intel’s microcontrollers. It was used as the processor in the PC keyboard of IBM. The was introduced in 1980 and is one of the most popular microcontrollers. It is even used now and is considered to be one of the most long-lived microcontrollers (Also go through: )

The revolutionary electrically erasable memories

it was during the 1990s that advanced microcontrollers with electrically erasable and programmable rom memories such as the flash memory started flooding the electronics market. the unique feature of these microcontrollers is that they can be programmed, erased and reprogrammed with the help of just electrical signals. a lot of currently used microcontrollers such as the ones available from atmel and microchip use the flash memory technology.

The latest microcontrollers

Today, in addition to the general purpose gadgets, unique microcontrollers are being created for areas like lighting, automotive, communications, and low-power driven consumer goods. The present day microcontrollers like , and 红包扫雷苹果下载地址 have become smaller and sleeker yet more and more powerful. For instance, there are so tiny microcontrollers available, small and cheap enough to be used in simple products like toothbrushes and toys.

Wi-Fi® Module and 32-bit Microcontroller

Wi-Fi® Module and 32-bit Microcontroller

Wi Fi® Module and 32 bit Microcontroller

红包扫雷苹果下载地址microchip technology inc., a leading provider of microcontroller, analog and flash-ip solutions, announced the wi-fi® comm demo board, which combines microchip’s best-in-class 32-bit pic32 microcontroller family with its low-power mrf24wb0ma agency-certified, ieee 802.11, embedded wi-fi radio transceiver module. additionally, microchip provides a free and full-featured tcp/ip stack, which is available today for download at http://www.microchip.com/get/a3vp. this compact and cost-effective demo board is easy to integrate with existing embedded designs, to evaluate wi-fi connectivity and 32-bit performance with minimal effort.

ask to see this board in action at next week’s embedded systems conference/design west in san jose, at microchip’s booth #1116.

microchip’s free, commercial-grade tcp/ip stack delivers all the key stack layers for a complete wi-fi based design. this includes html, dhcp, dns, ipv4/v6, ssl, etc. in combination with the low-power wi-fi module and a pic32 mcu, this stack delivers a highly optimized embedded wi-fi solution.

the pervasive wi-fi infrastructure continues to enable the rapid growth of the embedded “internet of things” in an expanding number of applications, such as thermostats, appliances, meters, pumps, security systems and sensors. this expansion includes the owners of existing systems, who want to retrofit and add connectivity without installing wires. microchip’s wi-fi module and tcp/ip stack enable this connectivity for control and communication over the internet, while its 32-bit pic32 microcontroller family provides the performance and features to simultaneously process both wi-fi communications and a large number of other functions. these functions include audio, graphic displays and touch sensing, and general system command-and-control operations.

“this demo board makes it easy to evaluate and integrate the combination of microchip’s wi-fi solutions and 32-bit mcus in one compact and cost-effective package,” said steve caldwell, director of microchip’s wireless products division. “our free, full-featured tcp/ip software stack and the fact that our wi-fi module is certified by multiple international communications agencies further speeds development.”

Pricing & Availability

microchip’s wi-fi comm demo board (part # dv102411) is available today for $49 at http://www.microchip.com/get/t66h. microchip’s free tcp/ip stack can be downloaded now from http://www.microchip.com/get/a3vp. ask to see the board in action at next week’s embedded systems conference/design west in san jose, at microchip’s booth #1116.

红包扫雷苹果下载地址for additional information, contact any microchip sales representative or authorized worldwide distributor, or visit microchip’s web site at http://www.microchip.com/get/t66h. to purchase products mentioned in this press release, go to microchipdirect or contact one of microchip’s authorized distribution partners.