Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs
Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Microcontroller Simulators and emulators

Sometimes you just haven’t ability to flash microcontroller in order to test program functionality in development phase. For this there may be many reasons like you don’t have a prototype ready or you need to test parts of code and so on. For this there are software simulators used which simulates microcontroller work without microcontroller itself. Simulators usually don’t have connection to real world all operations are simulated in software. Microcontroller simulator is a program model which imitates its work. Modern simulators now simulates not only arithmetic operations but also I/O operations and even peripherals like timers, ADC, USART, I2C and so on. In many cases there is possible to prepare whole project jus using simulator and then burn compiled code to real microcontroller. Simulators usually allow: debugging at source code level; follow operation time in slow motion but with real world values; connect stimulus signals like they are real world signals. Simulator can be expressed as several blocks interconnected with each other:   This is basic illustration because many moder simulators may have much more blocks. Memory block imitates work of real memory. Microcontroller program has to be loaded to this memory. O course this memory can be split…

Continue reading

Protect you car from rusting using cathode protection

Car owners know, that small scratch may cause a rusting which will expand even under painted areas. Fighting rusting is a pretty hard task. There are lots of methods that car keepers are using to prevent from rusting. Many are using anti-rust coating, but it has shortcomings – success depends on how good it has been done. The rusted area needs to be cleaned with care and sometimes requires to disassemble some pieces of a car. Such an operation requires a decent amount of time and constant control. Besides, the car is always in a stressed environment: cold, salt, water, vibrations, stones, and other harsh conditions. There is still a chance of damaging surface coating. For constant prevention from further rusting, there is an electronic device used which requires only one installation. Cathode rusting protection isn’t a new thing. It has been used for protecting various objects on top and underground. Ships are actively using cathode protection, which is aggressive in salty waters. The idea is to use a special protector who melts in salty water instead of the protected metal. Water piping companies who use metal pipes first of all paints pipes with protection coating then wrap them in…

Continue reading

How does tri-state buffers work

Those who work with microcontrollers probably know about data buses. Only one device(memory, peripherals), that are connected to bus can work at one moment. So only one unit can have direct connection to bus besides CPU which usually is a host. So decoding circuit determines the desired unit and connects it to bus. Other devices are effectively disconnected so that they wouldn’t have any affect to bus operations. They are carried out by tri-state buffers. Tristate buffers allow to isolate circuits from data bus. This means that circuit is switched to high impedance state. Usually we know dual state circuits that can have two logical levels “0” and “1”. But there is also widely used tristate logic, where is ability to switch I/O to high impedance state. Tristate logic can simply be made by two transistors:   Using such circuit we can have following output results according to input variations:   Q1 Q2 Output OFF OFF High Impedance OFF ON 0V ON OFF +5V   Simply speaking when output pin is in high impedance state it is physically disconnected from circuit.  

Continue reading

Using Gray code for rotary encoders

Gray code is well known and widely used in angular movement systems where angular positions has to be known. Gray code encoder can be constructed pretty easily by masked wheel where tracks are read with photocells.   Did you look at the picture and thought for yourself that gray code is same binary code. Well no… main problem with binary system that using binary code in tracks there are many positions where several tracks change state at same time. This may result in error. Actually in gray code only one track can change at same time during rotation. So then if error occur, the resulting erro will be only one bit. Gray code is easy to convert to binary this task can be done by any microcontroller using a lookup table:     Also you can convert Gray code to binary analytically. To convert from binary to Gray, start at the MSB and compare it to 0. If MSB is equal to0, then write 0 as the MSB for the Gray coded number, otherwise write 1. Next compare the next MSB and compare it to the MSB. If they are equal write a 0 in the position for the Gray…

Continue reading

Nonlinearity and span of transducers

Every time when developer is selecting a transducers for their projects they have to look through various parameters and select part which best fits the design needs. This time lets look at some transducer characteristics that can be found in specifications. Transducer Range First of all lets clear out what is a range of a transducer. Range is understand as maximum and minimum input and output signal. For instance we can take simple thermal sensor which input range can be from -50 to 120ºC and output range of 0 to 5V. Range can be understand not as only measured signal range but working environment parameters like working temperature range, power supply voltage range etc. Full scale deflection – Span Span is the maximum variation in the input or output. Span can variate due an error that mostly is linear and can be adjusted. Span error is measured in percents which shows how much the output value is different from correct value.   Another linear error close to span error is zero offset. This error occur because of calibration errors or other changes like aging or environmental conditions change. Zero offset error is constant over all range. It can be fixed…

Continue reading

X-10 interface for home automation projects

Simply speaking X10 protocol allows transmitting data over power lines. X10 uses a PLC(Power Line Carrier) technology. How does this work? Specification says that each time 60Hz AC signal crosses zero line there is a 120kHz burst transmitted with duration of 1ms.   One crossing burst forms one information bit. Simply speaking if wee need to form “1” you need to burst at first crossing but nont at second and for “0” is reversed pattern – you need to burst at second cross but none on first.

Continue reading

DIY 4x22W car audio amplifier based on TDA7384

I decided to make pretty simple but powerful enough audio amplifier. For this, I’ve chosen quad-bridge car audio amplifier IC – TDA7384, which has four input and four output channels with power capability 4x35W(4Ω). If connected to a car battery where the operating voltage is about 13.2V, then each channel can give 22W what is more than enough for me. This amplifier I probably will use to test audio processor TDA7313, which is still in the development phase. I didn’t find much information about this chip on the internet, so I decided to build it and try on my own. As datasheets of TDA,7384 says, it is low distortion, low output noise, low external component count. Also has Stand-By function and Mute function. It has several protections like from output short circuit to GND. or to Vs, capable of handling very inductive loads, thermal limiter, load dump voltage. TDA7384 is an AB power amplifier cased in flexiwatt25 (eagle library is included in project archive) package which is designed for high-end car radio applications. It allows the rail to rail output voltage swing with no need of bootstrap capacitors. (click to enlarge) I have followed the schematic in datasheet when building…

Continue reading