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

ARM7 MCU registers

ARM has 31 general purpose 32 bit register where 16 of these are visible at any time. Other registers are used to speed up processing of exceptions. There also is 6 32bit wide status registers. Lets see how it looks like. Registers are arranged in partially overlapping banks with a different register ban of each MCU mode. As I mentioned at any time 15 general purpose registers(R0 to R14) and one or two status registers and PC are visible. Basically R0-R12 registers are user register, that doesn’t have special purpose. Registers R13 – R15 has special functions. R13 is used as stack pointer (SP), R14 is used as link register (LR) and R15 is as program counter (PC):

Continue reading

Alternatives of MAX232 in low budget projects

Sometimes when you work on low budget projects of don’t want to go shopping for max232 or similar IC you can save your time and money by using other TTL to RS232 converter. We usually used to use MAX232 chip like this: Max232 IC is a specialized circuit which makes standard voltages as required by RS232 standards. This IC provides best noise rejection and very reliable against discharges and short circuits. If your project is more advanced and has to reliable you must use specialized RS232 to TTL converter IC’s. As I said Specialized are more expensive than other solutions. One of such solution is Transistor based interface: Transistors can be any general purpose transistors. This circuit is very easy and works without problems. It is cheapest solution as it require couple of transistors and four resistors. Two transistors does a trick to get a negative voltage as required by some PCs. When the PC does not transmit data, its TX pin is stuck to a negative voltage. The negative voltage is picked up from the TX pin and brought back – through resistor R3 – to the PC’s RD pin. RS232 alternatively can be interfaced using Logic gates. This…

Continue reading

Ease H-Bridge on MOSFET IRF7105 transistors

I think I don’t have to explain what is H-Bridge circuit. Well it is mainly used to drive DC motors that they could be run forward and backwards. Circuit often used in robotics. Usually there is a need to build small powerful and with good characteristics H-Bridge. One solution is to use IRF7105 p and n channel MOSFET pair coated in SO8 SMD case. As you can see MOSFET’s have a good characteristics for driving direct current like maximum current is 3.5A for N and 2.3A for P channel. Main thin here is a voltage drop on transistors which depends on Rds resistance. Controlling is very ease. You may use MCU or any manual switch to produce control levels on F1, F2, B1 and B2 wires: F1=0, F2=1, B1=0 and B2=1 – motor turns forward; F1=1, F2=0, B1=1 and B2=0 – motor turns backwards; F1=1, F2=0, B1=0 and B2=1 – motor stop. Source: www.ironfelix.ru

Continue reading

More about microcontroller oscillators

Choice of the microcontroller oscillator depends on many factors. Before choosing one, you should consider Cost, accuracy and environmental parameters. Clock sources can be grouped into two major groups: based on mechanical resonance(crystals and ceramic resonators) and RC (resistor, capacitor) oscillators. A most popular form of mechanical resonant generators in microcontrollers are Pierce oscillators: Ceramic and crystal based generators provide very high accuracy and low-temperature coefficient. But they have slower startup comparing to RC generators. But the RC generator’s precision suffers from temperature variations and supply voltage. Nominal frequency can variate from 5% to 50%: Oscillator stability can be expressed in figures as ±20ppm’ which means 20 parts per million. How to understand this? Imagine that there are 32 million seconds per year. Then in every million seconds generator may miss 20 seconds. SO over a year generator will lose 32×20 seconds, what is around 10 minutes. Standard crystals are rated from ±10ppm to ±100ppm what means from 5 to 50 minutes a year. For better stability, you need to calibrate oscillator and keep it all time in constant temperature like in the fridge. But it is not practical. There is another option – Temperature Compensated Crystal Oscillators (TCXO). These…

Continue reading

How does ARM7 pipelining works

One of the key features of the fast performance of ARM microcontrollers is Pipelining. ARM7 Core has three-stage pipeline that increase instruction flow through processor up to three times. So each instruction is executed in three stages: Fetch – instruction is fetched from memory and placed in pipeline; Decode – instruction is decoded and data-path signals prepared for next cycle; Execute – instruction from prepared data-path reads from registry bank, shifts operand to ALU and writes generated result to dominant register. Pipelining is implemented in hardware level. Pipeline is linear, what means that in simple data processing processor executes one instruction in single clock cycle while individual instruction takes three clock cycles. But when program structure has branches then pipeline faces difficulties, because it cannot predict which command will be next. In this case pipeline flushes and has to be refilled what means execution speed drops to 1 instruction per 3 clock cycles. But it isn’t true actually. ARM instructions has nice feature that allow to smooth performance of small branches in code that assures optimal performance. This is achieved in hardware level where PC (Program Counter) is calculated 8 bytes ahead of current instruction.

Continue reading

Armega128 bootloader using windows hyper terminal

If you are a windows user, there is a most straightforward solution to program Atmega128 microcontrollers. In https://piconomic.co.za there is nice bootloader binary you can download and use for personal purposes. First of all, you will need to upload bootloader hex file (which is packed in) to Atmega128 and properly program fuses. For my Piconomic board I set fuses like this: Then plug RS232 cable to computer COM2 (or COM1) port and then from windows select Start->All Programs->Accessories->Communication->HyperTerminal. HyperTerminal is a program used for multiple communication purposes like connecting to another computer, telnet, modems and null modems. First of all select connection type – COM2: After pressing OK, you will be taken to COM2 connection properties: After connection settings are done it is time to start bootloader. Select Transfer->Send file in HyperTerminal program: In the opening window select file, you want to download. Just remember that binary has to be compiled as BIN not HEX. The second option is to select a protocol – how data will be sent to the bootloader. The bootloader is programmed to support Xmodem protocol: Press Send button then Hyperterminal starts waiting for a bootloader to respond: Just press the Reset button on your target…

Continue reading

KontrollerLab IDE development software for AVR under Linux

Good news for Linux lovers. The new IDE development software for AVR microcontrollers has shown up. This is KDE based IDE under GPL. It is fully-featured editor which includes serial terminal for debugging, uses AVR-GCC compiler, uisp for serial downloading and avrdude programming software. Few screen-shots of this tool: Main project window Fuse settings window Project configuration window Compiller  settinds Programmer configurations Linker settings This is first release but is is already ready to start developing AVR projects. I think it’s a nice beginning. Download and try KontrollerLab from https://sourceforge.net/projects/kontrollerlab/

Continue reading