Can vs LIN bus interfaces in automotive electronics

Modern cars have more electronics than you can think of. Almost every vital part has tons of sensors on it with a dedicated computer called ECU (Electrical Control Unit). Usually, there are from several up to hundreds of ECU’s in a single car. Especially luxury ones. All modules have to work as an organized unit. So this is where a reliable connection interface is needed. Probably you’ve already heard of CAN bus (Controller Area Network). It is a standard bus interface used in most vehicles where the board computer communicates with separate control ECUs taking care of the engine, gearbox, climate, security alarm, and safety bags. CAN devices are connected by using twisted pair signal wires that are more resistant to noises. Signals usually operate at the 5V level. The transfer speed can reach up to 1Mb/s for 40m cable lengths.

Continue reading

MSP-EXP430FR5739 board have just arrived

Over a week ago, I got a notice that Texas Instruments (TI) is giving away a 50% coupon for MSP430_FRAM related devices. Without hesitation ordered their MSP-EXP430FR5739 TI experimenters board that price went down to $14.50, including free shipping. With all functionality and onboard peripherals included – it’s a giveaway. The experimenter’s board came in an excellent complex paper package that feels really solid and professional in hands.

Continue reading

How to drive servo motor control with AVR microcontroller

Servo motors are so-called “closed feedback” systems. This means that the motor comes with a control circuit inside, which senses if the motor mechanism is in the desired position. If not, it continuously corrects an error until the motor reaches the angle. Servo motors are widely used in robotics, remote-controlled planes, vehicles, and many other industrial machines. They come in many shapes and sizes, but they all operate in almost the same way. Usually, servo motors are controlled by a computer, microcontroller, or even a simple timer circuit. How Servo Motor Control Works Usually, servo motors are put in the plastic box, but inside there is a whole system: motor itself, gears, and motor driving and control circuit. The gears reduce motor speed but increase torque. As we mentioned, servos work with a closed feedback loop when the potentiometer is connected to a mechanical shaft and senses the angle of turn. The potentiometer voltage directly indicates the grade of twist. The potentiometer signal goes to a digital controller of the motor, which powers the motor until the potentiometer reaches the desired angle, then the logic circuit shuts the motor.

Continue reading

How to write an LCD menu for AVR in C

Let us write a simple LCD menu for AVR. I am using four buttons: 2 for menu scrolling up and down and two for changing submenu parameters. As the output indicator, I am using three LEDs that flash according to the menu’s parameters. Button states are captured by using timer0 overflow interrupts. The circuit is elementary:  I have excluded the power circuit for simplicity, just left the main parts: LCD, LEDs, and buttons. This circuit works well with the Proteus simulator as it is. The Proteus circuit is attached to the project archive. My idea is to store menu strings in Flash memory without occupying MCU RAM. This way, menu items are limited only by Flash memory, not by RAM.

Continue reading

AVR-GCC 4-bit and 8-bit LCD library

Earlier I have used 4-bit and 8-bit LCD libraries in various projects. It was hard to maintain and update. Now they are merged into one library where the simple logic structure is implemented to select a 4-bit or 8-bit LCD library just by modifying only three code lines. In the library header file there is line added: //Uncomment this is LCD 4 bit interface isused //****************************************** #define LCD_4bit //****************************************** You can select different LCD modes by commenting and uncommenting this line. Also, don’t forget to select proper ports and pins where the LCD is connected:

Continue reading

Getting hands on Arduino Ethernet Shield

Probably everyone knows Arduino and perhaps using it. This development platform is worth its popularity. Probably the best thing about it is open-source ideology. Indeed it is an excellent development platform that includes software and hardware solutions where even non-electronics guru can master great projects. In a few years, Arduino has grown in a great community around the world. And that is great – this means that you have access to endless resources, endless project ideas and lots of members willing to help if you are stuck with something. All the necessary information you can always find in https://www.arduino.cc/. OK, enough of talkies. Let’s see what we have here. Thanks to SparkFun electronics, Arduino Duemilanove stands on my table fully assembled and ready to work. I decided to give a try on Arduino Ethernet shield based on Wiznet W5100 chip. It has a library, so you don’t need to think of details how Ethernet chip is controlled. Few lines and you have some info in your favorite browser.

Continue reading

Temperature sensor with time and date display on graphical LCD

Some time ago, I built a prototyping board with a graphical LCD. It has served for various small projects and prototypes. I had a spare temperature sensor DS18B20 and decided to put on a simple temperature display project. GLCD board is equipped with an Atmega32 microcontroller running at 16MHz. DS18B20 sensor is connected to port D pin 6. LED connected to PD3 is used for indicating EEPROM write activity. The device is navigated with a rotary encoder. It is connected to MCU as follows (more about interfacing rotary encoder here):

Continue reading

Adding external memory to Atmega128

Atmega128 is equipped with internal 4Kbytes of SRAM memory. Is it enough? Well, it depends on what project it’s going to hold. If your project must deal with loads of data or run more extensive RTOS code, you will run out of RAM pretty soon. Atmega128 microcontroller has an external memory interface built-in, which allows expansion of RAM up to 64 Kbytes. With that, you could do much more. I used the Piconomic Atmega128 development board to test things out, which has an XMEM interface header brought out. All we need is to make an XMEM expansion board with some SRAM memory. I’ve chosen a standard 8Kx8 (8Kbytes) memory chip from Alliance Memory Inc. I could use 64Kx8, but this is what I had at the moment. To drive the memory chip, I’ve used a 74HC573 non-inverting latch. As you may know, the latch is used for pins that share the same pins for address and data buses. To access SRAM contents, we need to select a 16-bit address pointing to an 8-bit data cell in the chip. As we are using an 8Kx8 memory chip, we are going to use only 13Address lines. The microcontroller has dedicated pins for…

Continue reading

Arduino introduces new boards – Uno and Mega2560

Arduino is a well-known platform among electronics hobbyists because of its simplicity, robust and intuitive design, and ease of use even for non-electronics enthusiasts. Instead of introducing new PCB variants or different microcontrollers on board, they made some significant upgrades in the Arduino concept. Recent changes came with two new Arduino boards, so-called Uno and Mega2560. Probably the most significant difference is the USB to serial converter. They decided to replace seemed to be hard-positioned FTDI chip FT232RL with microcontroller Atmega8U2 that has a hardware USB interface. With this upgrade, the Arduino board becomes much more flexible as a microcontroller driver can be configured more than a simple USB to serial converter. It also can convert Arduino to a standard keyboard, mouse, MIDI, and mass storage device. So, there are much more ways to use Arduino now. But this is not over yet. Arduino decided to change the bootloader too with the new Optiboot firmware that brings some improvements as well. The new bootloader occupies 1.5kB less code space leaving it for applications and loads firmware to flash faster.

Continue reading

Human And Machines Got Even Closer

In this era, when technology continues to get advanced and better, it may pleasantly surprise many to note that machines are getting closer to humans. They are performing duties that no one hitherto would be possible. In other words, machines and gadgets are being invented that can imitate human functioning, for example, in the human brain, eyes, and so forth. But perhaps one of the latest inventions, a clear manifestation of humans getting even closer to humans, is the machine that has been made and can imitate the human voice. The device was invented as part of completion for the Artificial Conversational Entities, known as the ACE. Several machines that could mimic the human voice were entered for the competition, and the winner was really awesome. During the competition, judges selected some of the five best machines and competed for five minutes to get the best. This comprised a five minute kind of interrogation, where there were unrestricted conversations with the machines, which tried to pass off as human beings. So real did these machines sound that one would not tell whether one was a machine or a human being.

Continue reading