Free pascal compiler for 8051 microcontrollers

If you like to work with 8051 microcontrollers and like Pascal programming language, here is Turbo51 – a free Pascal compiler for the 8051 families of microcontrollers. In the 1980s, Intel introduced the 8051 as the first member of the MCS-51 family of microcontrollers. Today hundreds of cheap 8051 derivatives are available from tens of manufacturers. This makes the MCS-51 architecture so interesting for professionals and hobbyists. It is a somewhat surprising fact that this 8-bit architecture is still in use today. In other words, it is still trendy. Several C compilers are available for the 8051. However, there are only a few Pascal compilers for the 8051 families available. There are many debates on which programming language is better. Turbo51 is for those who prefer Pascal. Turbo51 features a fast single pass optimizing compiler, Borland Turbo Pascal 7 syntax, full floating point support, mixed Pascal and assembler programming, full use of register banks, advanced multi-pass optimizer, smart linker, generates compact high-quality code, output formats include binary, Intel HEX and assembler source.

Continue reading

Putting your electronics project in an enclosure

Projects that are probably finished and put in an enclosure always catch an eye rather than a PCB prototype with multiple wires showing up. Of course, a project that does its job is fine enough even without a nice shell. But what if you don’t want your board to be exposed. Then put your project in a box. From this point, you need to be an electronics engineer and designer in one. Probably everyone has their own way of putting projects in the boxes, but few tips can save time and nerves. Let’s go through things to keep in mind while looking for boxes and planning necessary tasks: If you have buttons that need to be accessed through the case, find a shallow enclosure or tall controls. If there is a display you want to read but don’t enjoy a big hole in the lid, look for an enclosure with a clear top. If environmental conditions may be a factor, find an enclosure rated for the needs you expect your product to experience. Take a look at these IP ratings. Many manufacturers follow the IP rating system for describing enclosures. Maybe your project has lots of switches or external ports;…

Continue reading

How to sprintf float numbers with AVR GCC

The float numbers are not recommended to use with smaller 8-bit AVR microcontrollers. The main reason is that the AVR core does not have a floating-point arithmetic unit built-in. The software library emulates the floating-point arithmetic operations. The software library simulates Floating-point arithmetic operations. However, in real-world applications, you may need to use numbers with floating-point. In some particular cases, you can get away without you declaring variables as float type. If operations are simple like division or multiplying by 2, 4, 8, they can be replaced by the byte shift operation (byte<<1)=byte*2 Of course, it depends on the different situations and data you are manipulating – sometimes using floats is inevitable. If your code fits into Program memory and execution speed is not critical, use floats or double number formats, as you like.

Continue reading

Show Your Talent by DIY a Sun Tracking Unit

Probably you saw the Sun tracking system before; however, do you have the urge to challenge yourself to make a Sun Tracking Unit? First of all, get a tiny .7″x1.4″ PC board using the LED3X sensor concept. This circuit uses power MOSFET drivers, which most any DC motor can be used without any modification. You might notice that the power drivers are good enough for delivering about 50 amps of peak current or even more. The current will increase accordingly to the transistor. This means the large power MOSFET, 72A, when operated in low power mode, will eliminate the transistor’s need for a heat sink. Cool, isn’t it?

Continue reading

Safety Protection Guides and Fact about Microcontroller You Should Know

Microcontrollers are widely used in nowadays electronic and modern devices. You can track them whether for personal use for fun or even for serious and confidential applications by banks, security services, government authority, or the military field. Most of the algorithm that uploaded into its memory is well written in Assembler. Many villains out there want to hack or attack the microcontroller, maybe just for fun or for their own purposes (some of them willing to hack and sell the top-secret from companies for profitable) To reduce the risk of being attack by these microcontroller hackers, that is why we must know the types of attack categories.

Continue reading

Microcontroller Development tools on USB stick

Looking for compact but flexible, simple, and cheap development board? You should consider this nice list of microcontroller USB-Stick tools. These are special development tools that include all necessary hardware and software in a portable USB stick. Most of them consist of two parts – a USB stick and attachable target board. For instance, eZ430-RF2500 is the world’s smallest low-power wireless development tool. At only $49, the device includes a USB emulator to program and debug your application in-system and two 2.4-GHz wireless target boards featuring the highly integrated MSP430F2274 ultra-low-power MCU.

Continue reading

Voltage references in embedded design

Embedded systems that are dealing with DAC require good voltage references. Despite all voltage references having their nominal values, specific tolerances indicate how much values can vary from the nominal value. References, as a rule, are semiconductors that characteristics are affected by temperature. For instance, if we decide to use a 2.5V voltage reference then (Zener) diode LM336A-2.5 may be a good choice for this. These diodes have a low-temperature coefficient. It can guarantee that voltage will be in the range between 2.44 and 2.54 at 25ºC. This precise Zener diode has a third lead that can be used to adjust break down voltage. In the following figure, you may see a diode with a potentiometer where breakdown voltage can be adjusted in the range of ±120mV:

Continue reading

Yet Another Simple AVR ISP cable

Probably this programmer cable can be found on every AVR fan website. It is straightforward and easy to build. You need a few passive components that can be packed inside the LPT connector. From my perspective, I wouldn’t recommend using this one ISP programmer if you are more serious about microcontroller projects because it has poor computer port protection. It connects directly to the LPT port without precautions. I recommend using a similar ISP circuit with buffer IC between LPT and target board. But let’s don’t pretend like we are brilliant. The whole beauty is in its simplicity. This thing does its job perfectly as long as the target board power supply is OK.

Continue reading

USB bootloaders for AVR microcontrollers

Probably the most proper microcontroller programming method is using a bootloader program. Because you don’t need any special programming adapters or special knowledge – you need to connect a standard cable from your PC to the target board and run a special program on the PC which communicates with the MCU bootloader program. The idea is simple: If the microcontroller is preconfigured, then after reset, it starts running not from the start memory location, which is usually at 0x0000 address, but at some specific location, where usually bootloader lies.

Continue reading

AVR DDS signal generator V2.0

Finally, the second version of the improved AVR DDS signal generator is here. THE first AVR DDS V1.0 generator was only an attempt to run the DDS algorithm without any analog amplitude control. In this DDS generator version, I still wanted to keep things as simple as possible using a minimum count of widely available components in the updated circuit. Also, I kept a single-sided PCB approach. AVR DDS specification AVR DDS signal generator V2.0 is a firmware-based DDS signal generator that uses a slightly modified Jesper’s mini DDS algorithm adapted to AVR-GCC C code as in-line ASM. The AVR DDS signal generator has two outputs – one for DDS signal and another for high speed [1, 8MHz] square signal – which may be used to bring back to life microcontrollers with wrong fuse settings for other purposes where a high-speed square signal may be needed. A high-speed (HS) signal is output directly from the Atmega16 OC1A(PD5) pin. The DDS output is used for all complex signals generated via the R2R resistor network and is adjusted via LM358N offset and amplitude regulating circuits. Two potentiometers can control offset and amplitude. The offset can be controlled in range +5V..-5V while magnitude…

Continue reading