IrDA interface for an embedded systems

IrDA is a transmission standard commonly used in computer and peripherals like mobile phones. The primary purpose of IrDA is to provide device-to-device communication over short distances. IrDA solves the problem of usage cables, that may differ from machine to machine. With IrDA, no wires are required so this is easy to connect the same device to multiple device types like your mobile phone to laptops, other mobile phones or PDA’s. Full IrDA description can be found at https://www.irda.com. IrDa standard requires close communication of devices. This is low power transmission. It is essential because regulations are guarding the maximum level of IR radiation that can be emitted. Also, it is reasonable to assume that the two devices that are to communicate will be physically pointed toward each other before use. And only two devices can communicate at the same time. So IrDA doesn’t have to deal with collisions. And the main thing that IrDa is simple, cheap and require low-cost parts. The IrDA standard specification states that supported data rates can be between 2400bps and 115.2kbps over 1-meter distances. Later standard has expanded to support 1.152 and 4 mbps. Transmitter beam angle is from 15 to 30 degrees, and…

Continue reading

Clockless CPU design

Clockless CPUs are so called asynchronous CPUs where are not clock generator needed which clocks every synchronous operation. Asynchronous processors gives results not after defined number of clocks, but after it finishes operations. This is a key of effective usage of energy and asynchronous processors generates less noise than synchronous. Asynchronous processors have couple advantages against synchronous: Components can run in different speeds inside clockless CPU while clocked CPU components are tied to clock generator. Clockless CPU operation stages doesn’t depend on clocks and can be finished faster than normal and there is no time gap between stages as there is no need to wait for next clock cycle. For instance in it can show results of operation rather than waiting for next clock cycle like it is in sychronous CPU. So why asynchronous processors aren’t so popular? There are many factors but I think the biggest is historical, because instead asynchronous technology engineers of middle of nineteenth century decided to develop synchronous technology as they looked potentially more productive, reliable and there were easier to project them. So now there is a lack of professionals in this area. In other hand it is problematically to match synchronous and asynchronous…

Continue reading

Embedded RTOS System

RTOS – Real Time Operating system is a program environment which interfaces hardware and desired tasks. RTOS usually has built in set of services (interfaces and functions) which allow to interact between tasks and hardware. Because most low level functions are performed by RTOS realisation of programs becomes much easier. What is difference between Embedded RTOS System and regular OS (Operating System)? The main difference is that RTOS performs tasks according to reaction time on one or another event. Many microcontrollers have ability to support one or another Real Time Operating System. According to this we can say, that RTOS is a background application which controls multiple tasks and alleviates managing those tasks. Note that Operational system is able to perform multiple tasks at one time. This is called multitasking. We all know that microcontroller can perform only one task at one time, but if we cut time in to small pieces and perform all tasks in row for a bit time, then we achieve multitasking. This like illusion of performing tasks at one time. If you are familiar with system programming of PC, then you should know what is processes and flow and about planning of tasks (including real…

Continue reading

Testing Your Embedded System

Every time you are making some circuit or more complex system, you always do some testing to make sure that your electronic “baby” is working properly and you can expose it to publicity. Lets say you are constructing some kind of robot. Then typical list of testing task may be as follows: Stability tests using various working modes and critical supply voltages (like 4,75 and 5,25V); Start up testing – purpose is to check system readiness to accept commands after power up; Checking correctness of executed commands; Checking correctness of sensors; sometimes you will need to prepare good documentation where every node reliability is calculated. Also testing methods of each nodes may be included in documentation. Of course many devices may work in wider range of supply voltages, but there are always some electronic components that needs more than 5% stability. If your system is bigger and may be dangerous to your health or to itself. For instance if it is a robotic system, then you should know, that it can brake itself in some obstacles. In this case should include some blockage of tires in case if you loose control of your robot. When testing electronic circuit there is…

Continue reading

Microcontroller Brown-out detection

Mostly all microcontrollers have built-in Brown-out detection (BOD) circuit, which monitors supply voltage level during operation. BOD circuit is nothing more than the comparator, which compares supply voltage to a fixed trigger level. If microcontroller doesn’t have On-Chip Brown-Out detector, then there can be external circuit used : The image above there is a discrete brown-out detector circuit. In a real word, there are particular IC where additional delay circuitry and hysteresis used as normalizing of supply voltage may take some time. Such IC’s are cheaper than one built from discrete components. Brown-out meaning Brownout is an important safety feature in electronics and microcontrollers. There are two main tasks of brown-out function in microcontroller – hardware and software. Hardware brown-out feature resets the microcontroller and keeps it until the power supply is returned to operating range. This ensures that all parts of the circuit work correctly. Software brown-out part – an interrupt based functionality which detects falling voltage, which allows the software to take care of critical components like saving vital information to non-volatile memory before resetting. What causes a brown-out As an example, let us see how Atmega128 microcontroller, which has an On-chip Brown-Out detector reacts to the brown-out…

Continue reading

How to measure signal period using microcontrollers

Measuring signal period is common problem in embedded systems. This can be measuring time between two events or measuring signal frequency f=1/T and so on. Measuring of time interval or period is based on comparing of event time t with discrete time usually produced by timer. This usually is done by filling the event time t with discrete time intervals Δt. According to this, discrete time signal period has to be much shorter than event time: Δt

Continue reading

Why to move from ASM to C

ASM language is a low level programming language. It takes tons of time to develop embedded programs. Now even 8 bit microcontrollers arent as smal as they were earlier. The program memories are climbing to megabyte(s). Program structure becoming more complicated because of bigger functionality demand. This is why it is better to use higher level programming languages like C. By using C language you are not overwhelmed by details. You don’t have always to think about hardware logic to be able to program its restricted tasks. It is better to give this work to C compiler which helps you to avoid bugs in silicon level. Another C language benefit against ASM language is portability. Lets say you work on one embedded system architecture and decide to move to other maybe more advanced. If your previous program were written in ASM language, then you will need to rewrite (modify) this code from scratch. Using C language you are able tu run program on different microcontroller without significant modifications. This also reduces the costs of your project upgrade. Continuing the thought it is good to mention, that using C it is easy to save specific hardware routines to libraries which are…

Continue reading