Showing posts with label microcontroller. Show all posts
Showing posts with label microcontroller. Show all posts

April 27, 2012

Usb Microcontroller Communications Architecture for Human Interface device (Hid)

The Usb communications architecture is designed to enable computing devices such as desktop Pcs and laptops to interconnect with many other peripheral devices. A Usb uses a two wire serial communications link running at one of three dissimilar speeds: 1.5 megabits per second (low speed), 12 Mbps (full speed) and 480 Mbps (high speed). Usb devices are categorized into discrete device classes such as display, communication, audio, mass warehouse and human interface.

The Human Interface device (Hid) Class defines coarse behaviors and functions for touch screen interfaces. The Hid class includes peripherals such as keyboards, mice, trackballs, joysticks, touch pads and touch screens that enable end users to operate and interact with the computing system. Hid also includes provisions for output directed to the end user. The Hid specification requires one operate endpoint and one interrupt endpoint with the host.

The operate pipe typically handles enumeration and device configuration while the interrupt pipe is used for data transfer. Descriptors define a Usb device to the host regarding the type of device, the device manufacturer, Usb1.x or 2.0 or 3.0 support, device configuration, endpoints quantities and types, etc. Touch screen device descriptors tell the host which endpoints and transfer types are supported. In addition to handling approved Usb requests, Hid devices must riposte to all approved Hid requests. Data must be transferred within defined structures called reports, which can be transferred over either the operate pipe or interrupt pipe.




Hid devices can transfer information stored in reports with the host through the operate pipes. This transfer is typically reserved for configuration information or device identification. The Usb specification defines the transfer sequence for the operate pipe, which has a higher level of error checking than other transfer methods. The host application programming interface (Api) calls used to send data through the operate pipe differ from those used for the interrupt pipe. While enumeration, the device requests how often it wants the host to ask for the data or send the data. After enumeration is complete, the host schedules data transfers on a periodic basis. If the enumerated device is a touch screen, the touch screen Usb bridge or the touch controller (e.g., a controller that supports Usb natively) assembles the coordinates of the finger(s), as well as other associated information such as finger width, signal strengths, finger speed and gestures, and shop that data in a buffer. The data is transmitted to the host at the interval specified previously or upon unavoidable events such as a finger's touch.

Usb Microcontroller Communications Architecture for Human Interface device (Hid)

xBox Motion Sensor Celtic Goals Clip Faster Wireless Router

April 23, 2012

Functions and Advantages of Microchip Pic Microcontroller

Microchip Pic microcontroller is a gadget which is used in electronics media. Pic belongs to the family of microcontrollers which are made by microchip technology. The word Pic here means peripheral interface controller. The Pic are beloved and in high quiz, throughout the world because of the attributes it contains like it is widely available, it has low cost, it is a large user base device, it can work as an comprehensive variety of application notes, the improvement tools connected with it are free of cost sometimes ready at low cost, and serial programming capability. These are some of the perfect functions of microchip Pic microcontroller. The electronic devices are gaining popularity day by day round the globe because in modern days, this is an era of addition innovation and technology development.

The microchip Pic is characterized by few other attributes which are as follows: detach coding and data spaces. The instructions in small numbers of fixed length, most of the instructions are singular cycle execution, one accumulator, all Ram locations, hardware stack for storing return addresses; it is a fairly small estimate of data space which is extended straight through banking. Moreover data space mapped Cpu, port and peripheral registers and the program counter is also mapped in to the data space and writable, it is used to implement indirect jumps. Some of the advantages of using microchip microcontroller are: it needs to give small instructions, Risc architecture, built in oscillator with selectable speeds, easy entry level makes it user friendly, the low cost and reasonable nature of the chips allows every personel to buy it. Additionally, it includes wide range of interfaces together with I2C, Spi, Usb, Usart, A/D, programmable comparators, Pwm, Lin, Can and Psp.

Most of the population do not know that from where to buy microchip Pic, there are many modes to buy this Pic, you can have online modes and hand-operated ways. The hand-operated ways are mostly used in buying such items so that one can attach the chip to its ideas and can check numerous Pics that which one gets fit into the space ready for. On the other hand some population still refers to buy straight through online channels, there are some online websites which allows you to buy straight through them. You just have to agree the most proper Pic and can place the order. The items would be delivered to your home. The buying of these microchips Pic are not time involving nor are they cost consuming, your abundance of data get restore in few seconds.




Some of the limitations attached to the usage of microchip Pic could be: it has one accumulator, register bank switching is required to entrance the entire Ram of many devices, operations are not orthogonal, and some of its constructions can address Ram while others only make use off the accumulator.

However, the latest devices in this technology section have come with some improvements and they do not contain the similar drawbacks like the old ones. One of the examples of latest gadget which comes up in full complete usage form is Pic18.

Functions and Advantages of Microchip Pic Microcontroller

Ingersoll Rand Air Compressor Troubleshooting Electric Motors and Drives Xbox 360 Wireless Network Adapter

April 2, 2012

Interfacing a Microcontroller With a Pc Using Rs232 and the Pc Serial Port

Serial Communication

Serial communication is a technique of transmitting data between two pieces of hardware. The smallest piece of data that is transmitted is the byte. A byte is made up of 8 bits. When data is transmitted between two pieces of hardware, the bits are sent one at a time. The hardware sends these bits by sending varying voltages over the wires connecting the devices. The sender and the receiver agree on how often a bit (or voltage level) will be sent.

How often a bit will be sent is referred to as baud rate or bits per second (bps). Then with the help of very accurate clocks they can send a series of voltage levels between each other and then reassmble these voltage levels into bytes.




The question Communicating between a Pc and a Microcontroller

The Rs232 serial port on a Pc uses +3 to +25 volts to signify a logic level of 0, and -3 to -25 volts to signify a logic level of 1.

Most microcontrollers use Ttl / Cmos logic levels which use 0 to some threshold voltage to signify a logic level of 0, and some threshold voltage to 5 volts to signify a logic level of 1.

In order for the Pc and a microcontroller to successfully review some logic level translation is necessary.

Using a Ttl / Cmos To Rs232 Converter

There are many associates that originate modules that take care of the required logic level translation. The Ttl / Cmos To Rs232 Converter is one such module. Typically, these modules associate to the Rs232 port on the Pc and associate to the microcontroller's send and receive pins. supply 5 volts and ground and you are ready to communicate.

Applications Ideas

Once you have your microcontroller communicating with your Pc it opens up all kinds of potential applications fluctuating from data loggers, pc based oscilloscopes, controlling your pc from your microcontroller, controlling your microcontroller from your pc, etc.

Interfacing a Microcontroller With a Pc Using Rs232 and the Pc Serial Port

Homemade Chocolate Cupcake Recipe

March 28, 2012

Methods for Debugging Microcontroller Hardware

Most of these debugging techniques can be applied to any microcontroller since they do not use any specific tools.

General debugging methods

There are many ways to debug hardware:




  • Ice.
  • Icd.
  • Simulation.
  • Serial Rs232.
  • Lcd.
  • Led.
  • Hardware pins.
  • Logic Analyzer.

Ice

The In Circuit Emulator is the most expensive way to debug your hardware. You buy a extra processor that physically takes the place of the normal processor. This extra processor allows software access to the internal carrying out of the processor (you can set breakpoints on hardware modules).

Icd (Pic microcontroller)

The next best thing to Ice is Icd (In Circuit Debug) Sometimes known as (Bdm - Background Debug Mode - for non Pic microcontrollers) let you singular step straight through code undoubtedly running in the target processor.

For Icd the processor has a small estimate of built in hardware that can halt the processor when the program reaches a specific address. The software can then read back all the registers and processor state.

Simulation

With a source code simulator you can step straight through the high level language code and see its follow on memory and variables without having to look at the collector code directly. This lets you focus on the high level language carrying out and lets you combine on the question you are trying to solve.

One great advantage of the simulator is that you do not have to wait to download and program the target processor (you do have to re-compile the code after changing its source code though). So you can cut out the time enchanting programming task just by using the simulator.

Note: Simulators are no good for debugging interrupts.

Debugging using hardware

Serial Rs232

Newer microcontrollers have a built in Uart giving you a virtually free debug tool that uses minimal resources and needs very small software coding.

For debug output you need to join together the Uart output pin (Tx) to a favorable level translator circuit e.g. A Max232 chip. You may even get away with direct connection (via a resistor) to the input of your Pc serial port (but this depends on the specifics of your Pc hardware) - using a translator chip will always work.

Advantages

  • Minimal coding.
  • Simple to use.
  • Minimal extra hardware.

Disadvantages

  • Takes a long time to output a character (~1ms).
  • Takes even longer for blocks of characters (~10s of ms).
  • Needs extra hardware.

Even straight through it takes time to output a character it is a beneficial debug tool as you can output the value of a variable to see what the microcontroller is undoubtedly doing.

Lcd

An Lcd (Liquid Crystal Display) gives a favorable way of displaying debugging information. It is also beneficial for many separate applications that need a text display output.

It is a module that displays text characters and a coarse screen size is 2 rows of 16 characters.

Most Lcd modules use the Hd44780 controller chip which is why Lcd routines built into high level languages always work.

Advantages

  • Very quick update (40us 4 bit data bus).
  • Useful in many projects as the main display interface.
  • Simple to interface to an 8 bit port (only needs six of the 8 bits).

Disadvantages

  • Uses up an 8 bit port.
  • Hardware is more expensive (e.g. Compared to a serial port chip).

Led

Using an Led as a microcontroller 'alive' indicator.

Even though it is such a simple thing to blink an Led on and off it is very beneficial as a debugging tool as you can tell at a look whether the code you just downloaded is working.

Sometimes you can will incorrectly set parameters on the programming software or compiler which will stop the code dead.

The Led indicator gives a quick health check for your microcontroller which is easy to see.

Pin Debugging

This is the simplest and crudest debugging method; using any ready port pin. Plainly set or reset this pin at any point in the code that you want to monitor.

It has minimal impact on the code speed or size and can give you the following information:

  • You can tell if the code is active.
  • It gives you the repetition rate.
  • It gives you the routine time length (if you set the pin at the start and reset it at the end).

Note: To do testing you need an oscilloscope or a frequency counter and time interval measuring tool.

Logic Analyzer

This tool attaches to the pins you want to survey and captures the waveforms displaying multiple traces on a singular display. It uses a trigger module that can be set to begin on combinations of the input signals or on their length. So you can trigger on specific patterns or on glitches or both.

For non-microcontroller based systems (e.g. 80486 based) where the data and address bus are exposed a logic analyzer can show the address and data organized into hex words i.e. Readable. Some can disassemble the instructions showing what the processor was doing at the trigger point.

For a microcontroller based principles the logic analyzer can be beneficial in examining peripheral carrying out e.g. For debugging the Spi or I2C busses some logic analyzers also have built in withhold for these protocols.

Another use for the logic analyzer is to capture output over a long period of time depending on the memory capacity of the logic analyzer.

Summary

In short there are many techniques to debug your hardware ranging from simple (an output pin) to involved (a logic analyzer). All of them can be beneficial depending on the question you want to solve.

You can find more data here and how to build a website like it here.

Methods for Debugging Microcontroller Hardware

Car AC Compressor Troubleshooting USB Cable Adapter iPhone S.S.C. Napoli News Blog

March 15, 2012

Hcs08 Microcontroller instruction Sets Explained

The Full Hcs08 instruction Set

All S08 instructions (arguably all computer instructions) can be plan of as three basic types.

Data movement - a value is read from one location and written to another. All of the load/store instructions are examples of movement from one location to a separate one. One of the locations is commonly somewhere in main memory and has an associated address, the other is in one of the Cpu registers and has only a name. Information flow can occur in either direction (depends on the instruction). Also the load/store instructions that involve a Cpu register and main memory there are several replacement that move (copy) data from one Cpu register to another. There is one instruction, mov, that copies from one memory location to another. There are also a estimate of instructions that write an implied value (usually ones or zeros) to a Cpu register or memory location. Clra, is an example.




Data processing (Alu) - there are two types; unary and binary. Unary instructions control on only a single value obtained from either a Cpu register or a memory location and write it back (the same place) after some modification (processing). Nega is an example. Binary instructions control on a pair of values which they couple in some fashion to yield a result. These instructions approximately always have at least one of the values come from a Cpu register and place the consequent back in that register. Add is an example. A value is obtained from register A and from a memory location. These values are combined (processed) using the arithmetic increasing operation, and the consequent is written back in register A

Program-flow altering - where the value of the Pc is (or in the case of conditional branches, might be) changed from its normal upward counting sequence. This type of instruction is used to make subroutine calls, code loops, and code if-then-else style program constructs, to name a few.

Hcs08 Microcontroller instruction Sets Explained

Spanish Fan Club La Liga

March 12, 2012

engaging Diy Microcontroller Projects! - Digital proclamation law

1.1) Objectives

In this project, we look at how we can implement a "Digital 2.4km Run proclamation System".

1.2) Design Methodology The whole design process can be partitioned into a pyramid as follows.




Specifications and Requirement Capture

Components comprises of Led display, a voice synthesizer, a keypad and an infrared Interceptor.

1) Button on keypad is depressed when the runners are flagged off.

2) The display will show continuously the time lapse at 0.1 second resolution.

3) When the infrared ray over the track of the runner is intercepted, the time at the point of interception will be announced.

4) The time will also be logged on the system.

System Concept

The system is capable of displaying the time on the Led display once the start button is pressed. At the same time, the infrared interceptor is started, and is continuously checking if its infrared ray is intercepted, and if so, trigger the system to announce the time of interception to the runners, and make a log of the time of interception to the system. The runner should also be able to see the time they took on the Led display. If the Stop button is pressed, the timer should stop timing, and log the time of disconnection on the system. When disconnected, the infrared interceptor and Led Display are also to be off.

Working Principles

In order to implement such a system, background knowledge about the workings of each component in the system is required. In this case, we need to know the controlling of the Led display, the voice synthesizer, the infrared interceptor, and the keypad, and finally we will show a flowchart on integrating these devices.

Led Display

As found, Leds run on about 2 volts, hence we need a simple resistor in series to Ant. Eject some of the voltage and limit the current the Led can draw. Assuming an input voltage of 5V and a current of 10 ma, and applying V=Ir, we can find the required resistance as R = V/I = (5 - 2)/.010 = 300 ohms.

To have a brighter Led, I can pick the resistor as 270 ohms allowing more current flow, making the Led brighter. With that, the new current drawn is I=V/R = 3 / 270 = 11ma.

Given a 7 segment Led, the basic configurations looks as follows:

The 7 segment Led tasteless Anode will be adopted because the microchip is now driving up to 8 Leds (segments) at a time off a singular port. Just as each I/O pin has a limit to the number of current it will source or sink, each port also has a limit. To do the least damage, we are sinking the current to ground rather than sourcing it to 5 volts.

To add more displays, the cathodes from a singular segment of each display are all connected together and then connected to a Pic I/O line straight through a series resistor. The tasteless anode is made controllable by a Pic I/O pin. In this way, the segment value for a given display can be configured and straight through turning on the anode for that display, we can see the message. The same policy can be applied to the other Led displays, and when a favorable timing is chosen, we should be able to see the full display of all Leds without flicker. The favorable timing is chosen by finding out the time constant of the Led using a datasheet, and from this value, we can pick the accepted refresh time such that it is less than the time constant, allowing the Led to appear spellbinding all the time.

Also a transistor is placed between the Pic and the tasteless anode to each display. Since the current for the whole display runs straight through this one pin, it could overload a singular I/O line. To overcome this issue, the transistor amplifies the current drive quality of the I/O. To operate, put ground on the I/O pin to turn on the transistor and enable a given display, or put 5 volts on the pin to turn off the transistor and the display.

The form below shows the case for 4 Led displays:

With this way of using Led displays, we can plump the numbers to display based on the configuration as follows:

Take segment 'dp' as the Msb, and segment 'a' as the least necessary bit, and to enable a singular segment to light up, we must apply a low to the corresponding segment, since it is an active low input. The table below shows the segments which we have to operate to display each digit from 0 to 9.

Voice Synthesizer

In order to announce the time of interception to the runners, there is a need to store each digit from 0 to 9 in human voice and depending on the situation, announce the strict time by finding the location of the voice segment corresponding to the strict digit.

As found, the average human voice frequency is estimated at 2 Khz to 4 Khz. Hence, we need to sample at a Nyquist sampling rate of f(sample)>2*f(voice)= 8 Khz. We pick the minimum sampling frequency as 8 Khz. Given this frequency, it implies that the voice should be sampled every 1 / 8 Khz = 125 us.

The voice corresponding to a singular digit can also be broken down into distinct syllabus, and each syllabus should take up equal frequency of sampling. For example, the rate of sampling a singular digit of 3 syllabuses will have each syllabus taking up 8000 / 3 = 2667 Hz To start, we can use the sound recorder in case,granted under Microsoft Windows to store the voice as a wave format. We have to set the settings as 8 kHz, 8 Bit, Mono. Next, we take off the header bytes by using a binary editor such as Hexplorer. After which the voice data corresponding to each digit can be stored in the Eprom, and being referred to as and when needed.

To recover an analogue signal from the digital signal stored in the Eprom, a Digital to Analogue converter is used. The digital signal has to be fed to the analogue converter at a rate of 8 kHz or every 125 us. The yield from the D/A is then fed into a Lpf of 4 kHz to take off any noise. The final yield is then fed straight through a power amplifier such as Lm386, and straight through current amplification, we can accumulate load matching with the 8 ohm speaker, and get max power output.

Infrared Interceptor

The infrared interceptor is made up of the infrared Led, the infrared detector Gp1U5. The infrared detector contains both the Ir detector and a small circuit that detects a 40kHz modulation. This detector is able to reject noisy light signals and hence has better performance. It works by detecting the modulated infrared light from the Ir Led, and straight through amplifier and band pass filter of 40 Khz, get a clean signal.

If there is any runner crossing, the detector will sense a dissimilarity and we can use the signal to feed into the interrupt pin of the microprocessor which will then announce the time and also make a log on the system.

Keypad

The form on the left shows the schematics of the 4*4 keypad. The needed outputs can be fed to the Programmable Peripheral Interface 82C55 of the microcontroller for reading the status, and straight through the 82C55, settle the type of interrupt invite to the microprocessor.

In our system, button 1 is designed to start the run, the Led display and the infrared interceptor. Button 2 is designed to stop the run, turn the Led display and infrared interceptor off. All other buttons should not interfere with the doing of the system.

Realization

We use a flowchart to show how these distinct devices can work together.

With this done, we have already gotten ourselves a very concrete design on paper, and it is now time to implement this into stock straight through the necessary hardware and software implementation.

Hope my little project has inspired you with lots of creativity for you to start your very own Diy projects as well.

engaging Diy Microcontroller Projects! - Digital proclamation law

Homemade Natural Ant Killer

March 9, 2012

C Programming For the Pic Microcontroller

The C programming language surely reigns consummate in the embedded electronics community. Microprocessors can be found in 99% of all electronic appliances these days from car radios to cookers and it is the software that the microprocessors run that gives personality to the whole design.

Many hobby electronic enthusiasts cut their teeth on microprocessors by learning assembly language. Admittedly the Pic Microcontroller from Microchip is the processor of choice for many beginning on this path.

Assembly language presents a free of payment entry into this shop - ideal for the beginner on a little budget. Any way assembly language is somewhat laborious if a complicated task needs to be coded. Now free of payment C compilers are ready for download, so students can begin their programming sense in a high level universal language that can be used on many other high and low end microprocessors.




Assembly language is little to use with one single processor house and if the engineer migrates to someone else processor, he has to start again from scratch. C is a universal language and it is the headache of the compiler designer, not the engineer, to make sure the C code is compatible with the processor.

Most software written by non-hobbyists is written in C. Schedule snippets can be collected and used across many projects with separate processors until whole libraries of code are amassed. Code writing then becomes a simple task of choosing which code functions are needed and gluing them together - a task that the C programming language is particularly distinguished to.

Simple C for the Pic microcontroller gets anyone with little or no sense of C or Pic microcontrollers programming in as little as half a day.

C Programming For the Pic Microcontroller

Loan to Value Definition

March 7, 2012

The Evolution of Prehistoric Intel 4004 Processor to enchanting Microcontroller Embedded principles

The invention of microprocessor was a milestone to the introduction of microcontroller. The first microprocessor was pioneer in 1971 by Intel. It was the 4 bit microprocessor with the clock speed of 740 Khz. It knows as Intel 4004 and the first commercial Cpu in singular chip.

Three years later Intel had manufactured 8 bit microprocessor of Intel 8080. It was determined by many to be the first true microprocessor general purposes used. It has used in variety applications such as traffic light and cash register. The Altair 8800 was one of the first computer as well used the microprocessor.

The complexities of microprocessor had driven to introduce of microcontroller. In order to be used microprocessor other component need to be adding externally such as memory, input port and yield port. Any way microcontroller had combining the Cpu, memory, peripheral, input-output function and analog to digital converter in singular chip.




The year of 1976 was a necessary in microcontroller history. Intel had invented the first world microcontroller. The microcontroller were Intel 8048 and Intel 8748. Since then the uses of microcontroller was growth every year with dozen of vendors. The tasteless vendors to the day were Intel, Freescale, Microchip, Arm and Atmel.

In 1993, the introduction of Eeprom had pump up Microchip sales with their famous chip of Pic16C84. It is allowed to be erase memory electronically and quickly. This electrically erasable memory made it cost less than Cpu that required quartz "erase window" for erasing Eprom.

Later on the Pic16F84 had introduced due to replacing Eeeprom with flash memory. As the affected the cost of singular chip plummeted over time. In 2009 the cheapest 8 bit microcontroller available with cost of .25 in quantity of thousands. Nowadays the microcontroller are low-cost and easily available for hobbyists, with large online communities nearby inescapable processors for hobbyists, with large online communities nearby inescapable processors.

The Evolution of Prehistoric Intel 4004 Processor to enchanting Microcontroller Embedded principles

Air Conditioning Compressor Troubleshooting

February 28, 2012

selecting a Programming Language for Your Microcontroller

Assembler

Assembler is the most unavoidable language that you'll consider using as you probably won't need to buy any other tools to use it. More than likely the builder will contribute an collector for the chip and you won't need any books as all the instructions are in the datasheet and you just start coding.

This route to programming is very easy but you may be setting yourself up for problems later on as:




  1. It is trivial to write short programs.
  2. It becomes progressively more difficult to write large programs.
  3. It seems to be the best option as it gives the fastest code.
  4. It seems to be the best option as it gives the smallest code.

Assembler: Fast & small code

There is no doubt that collector gives the fastest and most optimized code (your brain is great at optimization than any compiler!) but collector is difficult - typically you'll spend ten times as long writing collector as you would writing in a high level language.

Assembler / Compiler Trade off

This is the trade off; to write the fastest most optimized code or to get the task solved more quickly.

Another qoute with collector is that to do even the most trivial task you have to think about every aspect of the code and all implications on registers and register flags.

Even making a microcontroller perform the most trivial task is difficult e.g. For making a loop in collector you need to think about which register to use and which instructions all the while thinking about how those registers should not interact with the loop register/other registers etc.

Assembler: qoute - changing the target

Another mystery is when you change from one microcontroller to another (even in the same expedient family) the collector instructions may be changed e.g. More instructions to heighten microcontroller performance. So you will have to learn an entirely dissimilar education set when inviting either to a new target microcontroller or inviting to a dissimilar expedient within the same house i.e. Code re-use is not potential unless you stay with one microcontroller (or devices with a similar internal architecture).

High level languages

Hll: Retarget

Retargeting code to another microcontroller is easier since the Hll will know the details of the new target i.e. education set, fuses etc. All you need to worry about is the exact differences in the middle of the dissimilar microcontrollers (in the same house this will be setting up the internal peripherals).

The foremost point is that the Hll takes care of the collector code needed to do the job.

Hll: Easy to understand.

The most useful aspect of a high level language (Hll) is that the language is written in a form you can de facto understand - there are no cryptic collector commands that you have to remember and most commands are made up of any engine code instructions - rescue you coding endeavor (often there are built in libraries of code e.g. Lcd driver, Serial port driver, I2C driver etc

So the Hll makes it easy to write code as it generates the definite collector for the target microcontroller.

Hll : Whitespace

You can also make use of white space (areas of no code) to separate out the discrete operations within the program - typically collector code is just one great big list that is de facto very difficult to read - I know there are comments but you need to annotation almost every line so that man else can

understand the code.

Hll: Task splitting

One of the best features of a Hll is that you can split tasks into separate functions that you can consolidate on them individually (as the Hll takes care of local variables etc.). For collector even when using a call education you have to take care of preserving the register state - in the Hll it's all done

for you.

Hll: Code re-use

Once you learn the Hll you will find it easy to read code written by other habitancy and you will be able to re-use code that you have already written whereas with collector you will permanently need to analyze the code to see if it fits in with your new functions.

The only decision then is which high level language? There are de facto three contenders Basic, C and Pascal - these are the most beloved languages and for beloved microcontrollers there will be an Hll compiler for each one. I'll just list the advantages and disadvantages of each

Basic Advantages

  1. Very easy to learn and use.
  2. A Basic compiler will yield code that runs fast as a C compiler.
  3. Many in built functions (depending on compiler).
  4. Very beloved - large user base with many example programs.

Basic Disadvantages

  1. Non approved language.
  2. If using an interpreted Hll will run very slowly.

Note: Because the language is not standardized it will be difficult to move code to a new processor target type.

Pascal Advantages

  1. Easy to learn and use.
  2. A Pascal compiler will yield code that runs fast as a C compiler.
  3. Many in built functions (depending on compiler).

Pascal Disadvantages

  1. Not as beloved as C - so not as many compilers.
  2. A bit wordy - it was originally intended as a teaching language.
  3. Not as flexible as C.

C Advantages

  1. Compiled language - all the time runs fast.
  2. Standardized language (Ansi)- easier to port to dissimilar compilers / target devices.
  3. Many compilers available.
  4. Many in built functions (depending on compiler).
  5. Very beloved - large user base with many example programs.
  6. Used in many dissimilar industries.
  7. Usable at the hardware level as well as higher abstraction levels (although C++ is great for very abstracted programming models).

C Disadvantages

  1. Hard to learn at first.
  2. Strong type checking means you spend time pleasing the compiler (although this protects you from making errors).

You can find more data from the website here and how to build a website like it here.

selecting a Programming Language for Your Microcontroller

Recipe Homemade Yogurt Sprint HTC Evo 4G Phone

February 12, 2012

Guide to studying The Microcontroller Embedded system

Are you a young school trainee finding for study data to learn microcontrollers?

Are you a high school / college trainee finding for data to found your microcontroller based project?

Are you an old man planning to convert your old digital technology based found to a compact microcontroller based design?






Are you working in an assosication and want to upgrade your skills for microcontroller and embedded law design?

You all are from collection of age, expertise and skill levels. But your need is same. Your basic ask is same. Your objective is same. That's to "Learn Microcontroller based design."

You are on right track as you have decided to go along with microcontrollers for your all electronics projects. There is no other good formula than using a microcontroller in product design.

Here are the steps and data for you to get started:

1. Your knowledge and ability:

Every human is unique in the knowledge he has acquired and the abilities he has.

Knowledge indicates the "experience" and quality indicate "time required to solve a found problem"

e.g. I know C language very well but I can't solve a "Array Sorting program easily."

This indicates having knowledge of C programming is not sufficient but one should have good quality to "Analyze and solve the question statement".

And this is the key and most prominent feature required while working with any microcontroller based embedded found system.

In other word this quality to solve problems is called as "Logic of creating solutions".

2. Hardware & Software

Microcontroller based embedded law designing is aggregate of hardware and software.

Microcontroller is a small Integrated Chip (Ic) and is the hardware part of the system. This small chip called microcontroller has installation to store a "Program" inside it. This is called as software.

You as a product designer, must have both expertise. Lets understand this by one example:

"You have been assigned a simple task to found and found a product to display room temperature"

This scheme will need following components:

1. The temperature sensor (e.g. Lm35)

2. A Microcontroller (e.g. Atmega8 Avr) to read the data from temperature sensor.

3. A 16 chars by 2 lines (16x2) Lcd display

4. Dc Voltage regulator 5V (7805 based)

Once you have this set ready, then its time to create a circuit / schematics for this.

Here is the point where you start learning about internals of microcontroller Atmega8.

Learn the hardware aspect of this microcontroller and then the software. The software writing is using Assembly or C Language.

3. Tools and equipments

A Pc / Laptop, installed with Ide (development environment), Isp Programmer hardware, Starter kit / target board and some books or reference manuals or a Computer based Tutorial.

In above example we have prime Atmega8 microcontroller. This is made by Atmel and is from Avr family of controllers. This is 8 bit controller.

WinAvr/ Avrstudio is used as Ide for writing program.

There are many Isp programmers (hardware) ready in the market.

Starter kit helps you to experiment and test your program by downloading (flashing) the industrialized source code into the Atmega8 microcontroller.

Books, reference manuals and Computer based tutorial will help you to get started with the new and animated world of microcontrollers.

There are some other microcontrollers ready like Pic, 8051, Arm, etc.

Every family has some unique features to offer and you have to decide which feature you need the most.

Cost of the microcontroller is also an prominent factor in selecting. Other factors but prominent are availability of tools like compilers, Ides, starter kits, programmers, books and reference material.

Guide to studying The Microcontroller Embedded system

Wireless Internet Adapter Blu Ray Magnetic Encoder Fundamentals

February 7, 2012

Is the Pic 16F84 Dead? - The Most favorite Microcontroller Of All Time

Is the 16F84 too old for your electronic projects?

If you don't know what a 16F84 is then you have never heard of Microchip(R) - a firm that creates remarkable stand alone microcontrollers. A microcontroller is simply a very small computer but unlike accepted computing systems all is contained within the expedient itself. There are no external peripherals such as Ram, Eprom, I/O devices.

If you are looking for an easy way to generate your own projects then microcontrollers fit the bill because they:






  • Are very Small (some have 8 pins and even smaller have 5).
  • Have many internal peripherals.
  • Are based on reprogrammable internal memory
  • Have built in timers.
  • Have internal Ram.

In short they are ideal for controlling your projects -- all you have to do is program them.

This is one of the spectacular advantages over doing discrete designs since if you make a mistake in a discrete invent you will have to debug and re-wire. With a microcontroller you can just re-program the expedient in circuit (having simulated the code to outline out the mistake first).

Even best is the fact that you can make industrialized projects, because internally the peripherals operate quite fast e.g. You could generate a 50Mhz frequency counter using no external components (except a display).

Languages

In fact you can program them in many different languages but the most beloved is motor code. The infer for it's popularity is the fact that MicroChip(R) created all the tools requisite for amelioration of a motor code program for free so you will find many many examples of accumulator code on the internet.

Personally I don't like motor coding in accumulator (although I can use it if needed e.g. For speed) because it takes a huge whole of time compared to using a high level language. In fact I would say it takes 10 times as long with assembler. Also accumulator is a totally unstructured language; meaning that it is very hard to profess i.e. If you want to add a module then you probably have to enumerate the whole of the code whereas with a high level language areas of code are protected rescue you from development mistakes.

Microchip has released many hundreds of different devices (now vastly improved over the 16F84) but the basic doing of each one is based on the customary invent and even if you only studied the customary 16F84 (Ok there was a 16C84) you would have a pretty good idea of how all of the range of devices work.

That is the great power of the MicroChip(R) devices i.e. You learn something using one expedient and you are adding to your knowledge for the whole range - for instance to program a 12F675, 16F84, 16F88 or 16F877 you need to know only about Icsp because that interface is shared across the whole range. This means your studying curve is greatly reduced.

Of procedure there are some specialized peripherals that are for pro developers such as driving the pins of a dedicated Lcd but you only need to incorporate on the accepted peripherals (good examples are in the 12F675, 16F88, 16F628 and 16F877).

Peripherals

In fact there are about 15 accepted internal peripherals for the contemporary (16F range) expedient whereas the 16F84 has only one.

This is why I believe that the 16F84 has had a good running but it's now time to say goodbye to it. Other reasons for this are that it has a quarter the memory size of a 16F88 and now costs about 5 times as much.

Note The 16F88 and 16F628 borrow heavily from the 16F84 even having the same pinout so you won't have any issue if you are already used to a 16F84.

Summary

The 16F84 is probably too old for serious invent because there are newer (backwards compatible) devices that will allow you to generate far more capable projects.

Is the Pic 16F84 Dead? - The Most favorite Microcontroller Of All Time

Valencia CF News Blog Steven Gerrard FC News Blog Homemade Air Conditioning

February 4, 2012

Pic Microcontroller Timer Calculation

Do you get stuck doing Pic microcontroller timer calculation juggling between datasheet, calculator and your build requirements?

If so then you need some tools to automate the process.

Calculations

Typically you will need to focus on the end consequent which is usually to make the timer originate a frequency or measure a time period. This is fairly difficult when you first have to find the facts in the datasheet and then inventory for prescalers and postscalers etc.

Pic Timer 0 : Calculation example

Here is an example of the typical calculations for creating an 18ms interrupt repeat rate using Pic Timer 0.

Selecting a prescaler ratio of 1:128 gives the following interrupt period (with Fosc/4 or 4Mhz/4 = 1Mhz) and using the maximum overflow from Timer 0.

1/(1Mhz/128/256) = 32.768ms

Obviously this is longer than you need but you can cut it down by changing the overflow point (in the interrupt). To do this you need the period of the frequency input to Timer 0 which is:

1/(1Mhz/128) = 128us

This is the period of time for each count in Timer 0 i.e.

256 * 128us = 32.768ms

So by manipulating the overflow point you can set the overall interrupt period. The required period is 18ms so some calculations:

18ms/128us = 140.625 (nearest integer value is 141)

This is the whole of counts required after which the interrupt is generated. To use it Timer 0 it is loaded in the following manner:

Tmr0 = 256-143; // need 141 but Timer 0 looses 2 at load.

From this point on every 128us is counted by Timer 0 and it will overflow after 141 counts (or 18ms)

141 * 128us = 18ms

Tcl Scripts for Pic Timer calculation

Every time you use any built in Pic timer you have to do these type of calculations and the hardware in each timer is dissimilar and you'll also have to do battle with interrupts.

To make the process easy you can use three on-line (free) interactive script modules written in Tcl (Tool Command Language). They control in a similar way to a Java applets.

Each of these scripts is geared towards the most typical use of each timer and lets you turn prescaler, postscaler or register value using slider controls. This makes it easy to experiment with dissimilar values as the consequent is immediately displayed in the web page (frequency and period are displayed from each part of the timer e.g. After the prescaler, after the register, after the postscaler).

The above calculation is now trivial just move the sliders nearby until you get close to your desired Pic timer period and then adjust the timer value to home in on the spoton answer.

So you can do what-if type operations (all without a calculator in sight) e.g. 'I need a 15ms repeat rate'.

From Timer 2 the closest I could get is 15.136 (took 1 minutes to test) - perhaps I'll try timer 1 - Ah that gives an exact 15ms (took 30 seconds to test). Just check with Timer 0 - this gives 15.040ms (took ~30 seconds to test).

Of course you can also set the main clock frequency (internal or external crystal) as well.

Pic Timer 0

This has an 8 bit prescaler and an 8 bit timer and can be driven from an external clock.

Prescaler : 8 bit

Timer register : 8 bit

Link to Pic-Timer 0 calculator

Pic Timer 1

This has a 4 bit prescaler and an 16 bit timer and can be driven from an external clock. It can also be driven from a slow speed crystal e.g. 32kHz.

Prescaler : 4 bit
Timer register: 16 bit

Link to Pic-Timer 1 calculator.

Pic Timer 2

This has a 4 bit prescaler and an 8 bit timer and an 8 bit period register and is only driven from the internal clock (Fosc/4)

Note: the period register lets you originate an output frequency with no further processing i.e. You don't have to modernize the timer register value in an interrupt routine as you do with Timer 0 or Timer 1 - this makes it easy to use (although it's tricky to get right - unless you use the calculator scripts).

Prescaler : 2 bit (1:1, 1:4, 1:16)

Timer register: 8 bit

Period register : 8 bit

Postscaler : 4 bit (1:1 to 1:16 inclusive)

Link to Pic-Timer 2 calculator.

Pic Microcontroller Timer Calculation

Refrigeration Compressor Troubleshooting

February 2, 2012

About Microcontroller

The microcontroller is a special type of microprocessor and it integrates the components of microprocessor in singular chip which builds a singular integrated circuit, it contains the processor core, input/output peripheral and these microcontrollers needs the devices to procure the data from inputs. The microcontroller can be broadly classified as three types as 8-bit, 16-bit, and 32-bit microcontroller.

The 8-bit microcontroller consists of internal buses and Alu. The Alu is an arithmetic and logic unit. It performs arithmetic operations like addition, subtraction and logical operations like And, Or gate operations. The microcontroller commonly contains some whole of normal purpose input/output pins. Hence, when normal purpose I/O Pins are referred to an input state, they used to read the sensors and when it is configured to output stage. The pins can drive devices as Leds. The architectures of microcontroller have some designs include normal purpose processor with more whole Ram, Rom or I/O functions.

Interrupts:
Interrupt used in the microcontroller is used to wake up the expedient from a low power sleep mode and these interrupt sources are expedient dependent.

Programming:
Generally, many micro-controllers were programmed only in assembly language, but nowadays discrete high-level programming languages can also be used for programming of microcontroller. Hence, the programs of microcontroller should be fit in the available on chip program memory and the memory may be read-only memory or flash read only memory. In microcontroller to turn high-level and collector language codes into motor language, assemblers and compilers are used.

Features:
1. Typically microcontroller includes a Cpu, Rom, Ram, and timers.
2. A microcontroller is independent and self-contained.
3. It is designed for a exact task to control the singular system.
4. It is typically designed using Cmos.

Applications of Microcontroller:
1. Blood cell recorder cum analyzer, Ecg display cum recorder and inpatient monitoring system.
2. Some of communication systems like mobile phones, cable Tv, and Fax machines.
3. Peripheral devices of a computer like Lan Controller, Dram Controller, laser printer Controller.
4. It is also used in automotive applications like breaking system, and a dynamic ride control
5. Crt display controller, a spectrum analyzer, frequency analyzer and so on.

Hence the microcontroller contains its own clock, parallel ports, peripheral functions and especially it contains the own memory. In the Pic microcontroller, it contains both the Ram memory to store only the data and flash memory where the instructions are stored. Additionally, it also contains separate kinds of instructions set and serial communication functions.

About Microcontroller

Michael Owen Fan Club

January 3, 2012

The 12F675 - A PIC Microcontroller Project Guide

The 12F675 is one of the smallest PIC Microcontrollers - it's a tiny device with 8 pins but it's packed with peripherals and it even has a built in 10bit ADC which can read analogue inputs from 4 pins.

It has the following internal peripherals:

How To Program A Pic Microcontroller

1. Two timers.

2. An analogue comparator.

3. 10 bit ADC.

It also has an internal oscillator and internal reset circuit. This means the device uses minimal external components to make it work (other devices require an external crystal oscillator). Of course it also has the usual internal programming memory, EEPROM and RAM needed for programming.

Ideas for projects:

1. 4 channel volt meter.

2. Multi channel Servo controller.

3. Temperature controller.

4. Inductance meter.

5. Touch lamp.

6. Courtesy light time delay.

Note: To get data out of the device you can implement a serial RS232 transmit interface to your PC.

Why use it?
One reason is that because of its size its easy to put into restricted spaces e.g. for a model aircraft or model trains and it's cheaper than the larger devices.

Note: The 12F629 is the same device without the ADC - so it's even more cost effective.

So it's useful in designs that you would not normally think of using a microcontroller for instance you could make a touch lamp dimmer - Note using the microcontroller means you can make far better functionality than using discrete hardware (and even change its programming later on).

With a lamp dimmer you could have an auto off delay function e.g. if no activity for an hour then turn off.

State machines
You could also implement a state machine for more complex control of the functionality e.g. pressing once moves to the next dimming level in the current direction while press and hold changes the dimming direction.

Using a state machine while not trivial lets you control complex operation which you could not achieve (without a great deal of effort) using discrete hardware - and the advantage of using the microcontroller is that if you get it wrong you just re code your software and test it again.

Note: The 12F675 and 12F629 use Flash programming memory i.e. they are re-programmable - you can change their functionality instantaneously with NO re-wiring.

The only problems are:

1. You need to program the device.

2. You need a programming language.

Programming the Device
Surprisingly you can program the device using the standard 4 pin PIC serial interface - ICSP (In Circuit Serial Programming) and with careful design you can even connect your programmer to the same pins that your circuit uses.

Programming language
The programming language normally recommended is assembler and there are good reasons for using assembler - e.g. very fast code and smaller final code size but I would recommend using a high level language such as Basic or C

This is because for assembler you need to work at such a low level that you spend a lot of effort to do trivial tasks and this is better left to the high level language.

For the example mentioned setting up and maintaining a state machine would be extremely difficult in assembler but much easier in C.

The 12F675 - A PIC Microcontroller Project Guide