Add to Technorati Favorites Electronics Projects and Articles

Friday, May 1, 2026

Samples of my Professional Performance

On this post I will list the links or links to the video tutorials, written tutorials, articles and sample videos that I have made of various projects in which I have participated or that I have developed as samples or pills of my professional performance which is the main intention of this post and for this reason it is linking with my curriculum in: 

 Curriculum Luis Arteaga

Those who are interested in hiring my professional services please contact me at the contact information provided on the previous link.

Obviously I cannot publish information from all the projects in which I have participated, some for confidentiality reasons and others for different reasons.

As I know that this blog and this post will not only be visited by companies or institutions interested in my professional services but also by individuals who love technology topics, then I leave this explanatory note:

Articles or links to them will be published here on projects developed by the blog's Administrator, Electronic Engineer, who will be attentive to your comments. The information contained in these links may be in Spanish or English languages; remember you can use your browser’s translator to read it in another language. Likewise, on this blog and on this post everyone can share their knowledge and exchange opinions or contributions within a framework of respect and tolerance. Those comments that are outside this framework, deal with other topics not related to Electronics, Robotics, IoT, Embedded Systems or Programming will be eliminated.

I also clarify that the projects related here were not prepared in order to satisfy all the requirements that a reader or user of the same may have for their particular applications, I do not commit myself to solving particular problems and I do not offer any type of guarantee on them, as these are for reference only. However, I do promise to guide, suggest or support whoever asks me for help when time allows me to do so in a disinterested way in the comment service found here. 

Well, moving on to the samples of my abilities and without further clarification, below are the links to the video tutorials, written tutorials, articles and video samples, that I have made of various projects in which I have participated. What you will observe below is ordered from the most recent to the oldest, agreeing with what is shown in my professional history in engineering


What is the most common reason for PCB manufacturing defects? 

Category: PCB Design, PCB manufacturing, PCBA

In March 2026, an interesting question appeared in my Quora feed that I decided to answer, as it is far more common than many might think. In my response, I explained the most frequent mistake that often leads to errors in PCB manufacturing.

If you would like to know what that recurring error is, I invite you to read my full answer. 

What is the most common reason for PCB manufacturing defects? 

If you found this helpful, please leave an upvote. 

  

How can algorithmic changes improve performance more effectively than learning assembly language? 

Category: Programming Foundations

Responding to a request I received on Quora in September 2025, I explained the distinction between a well-thought-out algorithm and the choice of programming language. I also covered the basics of how the efficiency of an algorithm is technically measured. If you would like to read my answer or learn a bit more about algorithms, don’t forget to click on this link:

How can algorithmic changes improve performance more effectively than learning assembly language?

If you found this helpful, please leave an upvote. 


Semiconductor History Timeline

Category: Electronics General Knowledge

In June 2024, during a meeting with some colleagues, we asked ourselves: What would be the most important milestones in the history of semiconductors? The question stayed with me, and since one of my hobbies is history, I reviewed my books and created this timeline with the most relevant milestones in the history of semiconductors. If you want to know the top milestones in the discovery and development of electronics, don’t miss this timeline—and if you enjoy it, let me know.

Semiconductor History Timeline


Time Calculator for Asynchronous Serial Communication 

Category: Firmware, Communications, Javascipt

In mid-2023, I was working on the electronic design of a wireless product that required careful consideration of its operating time, since the device was powered by a rechargeable battery. Establishing the recharge time was a critical factor. Because the system involved data transmission over BLE, I did not have a reliable method to calculate transmission and reception times. To address this challenge, I developed an application for the company where I work, which also serves as a useful tool for anyone needing to estimate data or file transmission (TX) and reception (RX) times in asynchronous serial communications.

If you work with embedded systems, wired or wireless serial communications, or simply wish to explore this topic further, I invite you to try it out:

Time Calculator for Asynchronous Serial Communication  

 

Steady vs Transient States 

Category: Electronic Design

In May 2022 I wrote this post. In the field of #electronics, change is often a requirement of the overall functionality of a device. Like most things we encounter in electronics, there are at least two states of existence. For example, with a switch we find that it is off or on open or closed. In electronics there are two classifications of states that are a complex part of the analysis and understanding of the characteristics of a system, as well as the general functionality. These two states are the #Steady State and the #Transitory State. Here is the link to this post:

Steady vs Transient States 


Electronic Protection Devices

Category: Electronic Design

At the beginning of 2020, I started a series of videos about #electronic #protection #devices, starting with the basics. Then I finished that series of videos in the year 2022. The series is very interesting because explain fundamentals for electronic protection are explained from the point of view of #Electronic #Design in a simple way. Here are the respective links of this series of Video Tutorials:

Electronic Protection Devices Part 1/4

Electronic Protection Devices Part 2/4

Electronic Protection Devices Part 3/4

Electronic Protection Devices Part 4/4


Uploading sketches to Arduino microcontrollers with preloaded bootloader

Category: Hardware and Firmware Programming.

In June 2019 I made this tutorial on how to upload #sketches to different #Atmel #microcontrollers with preloaded Arduino #bootloader, that is, upload sketches to Atmel #standalone microcontrollers. In this tutorial you will find the connection diagrams to load #Arduino sketches together with the list of materials used for these diagrams, specifically for #ATMEGA328P-PU, #ATMEGA328-AU (smd) and #ATMEGA32U4 (smd) as explained together with Videotutorial linked to this tutorial. Here is the respective link:

Uploading sketches to Arduino microcontrollers with preloaded bootloader


Arduino Library and Android APP for #Arduino #Dimmer Module

Category:  Firmware and Software Programming (C/C++, Assembly and Java/Android Studio).

In 2018 I designed the #arduino #library with examples for the Phase Control Module and on-off for resistive and inductive AC Loads. Likewise, I developed this simple APP to use it with smartphones that have the #Android and #Bluetooth operating system. The library uses interrupts and registers from the #ATMEGA328P-PU, #ATMEGA328-AU, #ATMEGA328P-AU, ATMEGA2550 and ATMEGA32U4 microcontrollers. Here all links: 

Using Library and App, Videotutorial

Post about Library and APP 

Download APP

Download Library


Difference between Original, Compatible, Generic, Clone and OEM products

Category: General Electronics.

In 2017 they interviewed me about this interesting topic where I explained the differences between an #Original, #Compatible, #Generic, #Clone and #OEM product: 

Difference between Original, Compatible, Generic, Clone and OEM products

 

Post #2 About a Embedded Systems Platform

Category: Embedded Systems, Arduino.

This is a post where I give some guidelines for those who start with #Arduino, things to keep in mind regarding its operation and how far you can go with this platform. It was wrote in 2017 with update in 2022. Here the link to this post:

10 Things You Should Know Before Starting Your First Arduino Project

 

Post #1 About a Embedded Systems Platform

Category: Embedded Systems, ChipKit.

This is a tutorial that I published in 2017 about the tools to program #ChipKit boards from the manufacturer #Digilent. Here is the link to the written tutorial:


Chipkit for everyone


Interactive calculator of the resistive value based on the color code

Category: Software Programming (JavaScript).

It is a handy tool for reading the color codes of 4-band carbon resistors and 5-band precision resistors!

An interactive App that can be used on both desktop computers and smartphones in order to determine the resistive value of a #resistor that is based on the #color #code of either 4 or 5 bands. Here the link to the application:

Interactive calculator of the resistive value based on the color code

How to Use 

 

A Wikipedia Entry

Category: Electronic Desing.

This is an article that I published several years ago on Wikipedia (2014) that deals with a very general description of what Electronic Design is: 

What is Electronic Design

 

Arduino Clap Meter

Category: Analogue Sensors.

This is an application for analog sound sensors with Arduino. I implemented the code, circuit and smd LED bar board for this short demo in 2013. I haven't reviewed it in a while and my surprise it also has quite a number of views. Here is the link to the video tutorial:

Arduino Clap Meter

 

Digital Puzzle with Tactile Proximity Sensors

Category: Contactless Technology.

A demonstration of how to create basic entertainment with contactless technology. This demo video shows the use of reflective optical sensors to detect movements. The HID-USB IR BRIDGE module from Silicon Labs was configured by the author of this post and blog as a demo for the Campus Party 2012. Here is the link to the demo video:

Digital Puzzle with Tactile Proximity Sensors

 

Children Learn Geography of Colombia with Accelerometer

Category: Sensors. 

A demonstration of how interactive technology can be applied in education, in this case for social sciences. This video shows the use of a STEVAL-MKI005V1 Accelerometer by  STMicroelectronics company. I set this module and its use in demo mode for Campus Party 2012. Here is the link to the demo video: 

Accelerometer for learning geography

 

Brief explanation and demonstration of the operation of an analog oscilloscope

Category: Instrumentation.

This is a video tutorial that I made in 2012 about operation of a Tektronix brand oscilloscope. For those who know the subject, you will know that #Tektronix is one of the leading companies in electronic instrumentation. Here the link of the video:

Tektronix 2430


Get started with Arduino Nano

Category: Embedded Systems, Arduino.

Several years ago, back in 2012, when the #Arduino wave was starting in #Colombia, I published this initiation video on Arduino #Nano. This card was being assembled here in Colombia under my guidance at the time. Reviewing it today (see date of this post) I see that this video has quite a few views. Here the video: 

Get started with Arduino Nano

 

Bluetooth RN Series

Category: Wireless Communications.

The #bluetooth modules in this series, formerly Roving Networks and now #Microchip, are in my opinion (without detracting from the opinions that other experts on the subject may have about other manufacturers) one of the best modules on the market that today, of course, have diversified finding many more options of the same series.

In the video that you will see below, in 2012 a board designed and developed by the author of this post is shown, which was the breakout and hardware interface that was assembled here in Colombia under my supervision and about which I made this demonstration video, later of course in said company, other video tutorials on its use were released: 

Basic Demo of ME30024 Board


Motivatrix

Category: Multidisciplinary, Electronic Design.

#Motivatrix was a project in which I participated, which consisted of a #fitness machine either to exercise or to burn calories through video #games. The exercises are guided through a touch screen and their monitoring/measurement and approval/ranking is done by the machine itself through contactless sensors. To continue to the next level the user must meet a certain score or burn a certain number of calories. The same happens with the games that at the time this machine was created absurdly surpassed what we later knew as #nintendo wii, so it was very innovative. In addition, this machine has vital sign sensors so that the user can review them whenever he/she want, routines from their doctor, nutritionist and personal trainer can be included in its software.

My participation in the development of #Motivatrix was in the electronic part, sensors and embedded systems that it has, during  2005  and up to 2007. Here are the links to videos of it working: 

Dance Routine

Personal Trainig Routine

Motivatrix on The Price Right TV Show

 

Other samples can be reviewed by looking at the other posts of this blog.

Please, keep in mid that my curriculum it is: Curriculum Luis Arteaga


 

 



Friday, February 5, 2010

CHARACTERS AND THE ASCII CODE

I've created this blog to write electronics projects and electronics articles which can be used by any person interested in the electronic design. Your questions, doubts, comments and suggestions are welcome providing that they are written in a courteous and respectful way.

--Español-----English



CHARACTERS AND THE ASCII CODE

Abstract: When we talk about information, messages and data in electronic design we must talk about characters and their representation (encoding). This is important because we know that information is sent and received by using digital media. Around the world there are many languages therefore thousands of characters exist. This leads to the existence a lot of code tables in order to represent those characters. This variety confuses users. For instance, there is confusion between ASCII encoding and ALT codes for Microsoft users.
In this article, I try to address the most common questions about the encoding of characters. To illustrate I briefly introduce the ASCII code and its representations in several numeric systems and its use in electronic design.

Goals:
  • To introduce the concepts about representation of information and encoding to the reader of this electronic design blog. I assume that the reader knows about numerical systems and he has worked with them. In this article, the numerical systems are not explained but there are links to their basic explanations.
  • Finding differences between ASCII code, control characters, Extended ASCII code, Code Pages, Unicode code and ALT codes.
  • To develop an online tool in order to facilitate the conversion of ASCII characters to common numerical representations such as: Decimal, Hexadecimal, Binary and BCD. This tool will be developed in Java language.
Utility: Using the online tool in this article to find the equivalent codes of ASCII characters in the Decimal System, Binary System, Hexadecimal System and BCD Systems. Also, to identify the true name for each ASCII character. Finally, understanding why the ASCII characters are used in electronic design.

Fundamentals

In electronics, the majority of the management of information (data) is carried out by using digital media. That implies that standards and rules exist for encoding the data in such a way that machines can interpret that information and show it to a human user or another machine properly.
The main component in a message is the character. A set of characters for a language is named an alphabet.
As we already know, a character uses digital media in order to travel from one machine or device to another. Each character is ascribed with a numeric value in the chosen numerical system and this is what is known as coding.
For example: Someone had the idea to ascribe the numbers from 1 up to 26 to the English alphabet. He has special hardware and firmware and he wants to send word “hello” word from one electronic device to another. He does this using his encoding, therefore the word is: 85121215. This is an example of a simple coding.

Generally, any coding is not dependent on the transmission media which can be wired, wireless or even via satellite.

Note: It is important that you understand the difference between the terms encode and encrypt.

Since the encoding topic is not new, we should take into account that there are many standards and rules used in character encoding. Also, we need to know the numeric systems and the encoding systems most often used. In electronic design the basic numerical systems used to encode characters, are: Decimal, Binary, Hexadecimal and BCD.
When we transmit information it is possible that our receptor, for instance Windows HyperTerminal, shows characters unknown to us and we do not know which it is its interpretation in Hexadecimal or Binary. If we convert the received message to Hexadecimal or Binary this conversion will display the correct characters. Frequently, these sent characters are encoded in ASCII.
The ASCII code or US-ASCII was created in 1963 to transfer information between electric and electronic equipment. The ASCII code is based on the English alphabet. In the beginning, the ASCII code also included some punctuation signs, Arabic numbers and capital letters of the English alphabet. Lowercases were added in 1967. If you want to know more about ASCII history you could click here.

Now, the ASCII code is compound of 128 codes, of which the first 32 (0-31) and the 127 code are known as control characters or unprintable characters. These control characters also can be displayed on your screen but they cannot be printed. As additional information, the control characters were used to control printers and peripheral devices using the parallel port and COM ports of the computer.

With the online tool of this article you can see all ASCII characters and their values for different numeric systems.

In electronic design the ASCII code is often used to communicate between two devices regardless of whether you are making a control (master-slave) or a simple transmission (master-master).
The ASCII code is used because every character has two nibbles which facilitate handling and packaging when many bytes are transmitted. Although each ASCII character is represented by 7 bits, all 8 bits are used, but the MSB is always 0.
Many people will think: If I use the MSB of the byte it will increase the possible characters up to 256 (2^8) and with this I will include new characters and symbols.
This increase up to 256 characters and symbols in ASCII code already exists and it was named Extended ASCII.
Don’t worry; this was what many people and companies thought when they saw that the ASCII code was so limited. Therefore, each company created its own Extended ASCII. Later, these Extended ASCII tables were called code pages.

Since the character encoding is also used to communicate from a keyboard to a computer and to display the characters on the screen all keyboards have their own distribution of characters and this distribution depends on the language and manufacturer. For example, if you want to see Microsoft’s keyboard distribution for several languages you could click here .

Not all characters can be displayed on the keyboard. Many times we need to include special characters into our manuscripts or files in order to present them properly. It is possible, depending on the font used, that some characters can be included and others not. For example, the fonts Arial and Symbol do not have the same characters. Adding this to the code pages may be confusing to the common user.
The characters on a keyboard and the character codes for commercial computers depend on the code page. All code pages have the first 128 ASCII codes, but the codes greater than 128 depend on the particular Extended ASCII used by the manufacturer and the language. Because many code pages exist, this can create confusion for the common user. However, I must add that this is a reason why electronic designers use the ASCII code in order to transmit data because the ASCII code is not depending on manufacturer or language, in fact all code pages include the ASCII code. For this reason, another advantage is that the ASCII code does not depend on the operating system.

As character encoding has been evolving, there has been a demand for a general standard (one table only) that includes all characters of all languages and, of course, all symbols and punctuation signs. When we type ALT+ DECIMAL NUMBER in Word, where DECIMAL NUMBER even can be a number greater that 256 and still we can obtain a character. Then, not only a code page is present but also the Unicode standards. The most used is UTF-8. Gathering all this we can confuse.
In figure 1 there is an example of a distribution map of characters for MS DOS operating system taking into account code page 850 (PC850: Multilingual code page, including all characters from most of European languages, North and South American) and the UTF-8 standard. I hope this figure clarifies the things.



Figure 1. Distribution of Characters Codes for MS DOS.

We should take into account that the code pages vary according to the language, the font and even the operating system. What this means is that the ALT codes can change from one computer to another. What this means is that the ALT codes can change from a computer to another except for ASCII codes.

If your operating system is WINDOWS 2000, XP or Vista you can follow these steps to see the default code page:

1. Go to prompt using WINDOWS key + R.
2. Write CMD in the textbox.
3. In the new window write CHCP and,
4. Intro.

Using the ASCII character in other operating systems:
1. In Linux and Ubuntu: On the text processor type: Ctrl +Shift + U + ASCII HEXADECIMAL NUMBER. The caps indicator must be turn off. Linux and Ubuntu have the UTF-8 character table.
2. In Mac operating systems: to introduce a special character out of keyboard layout follow these steps .

Using the online Tool

1. Click on the button ASCII characters.
2. On the window that appears, which is called The ASCII Characters, select a character from the list. You can use the scroll bar to find a specific character.
3. Several representations for the specific character will appear on the same window.
4. The ALT + Decimal Number field is useful for Microsoft Office users.

Author's personal page here.

More tutorials, projects and news please visit:
Electrónica Plug and Play

Friday, November 13, 2009

CIRCUITS FOR PARALLEL PORTS

I've created this blog to write electronics projects and electronics articles which can be used by any person interested in the electronic design. Your questions, doubts, comments and suggestions are welcome providing that they are written in a courteous and respectful way.

--Español-----English



CIRCUITS FOR PARALLEL PORTS
Previously on Projects category, I wrote the “Controlling Parallel Port Using IO.dll” article, but the circuits are still pending to use with this project which is dealt in this post.

Goal: Describing various circuits to use the parallel ports with the previous article “Controlling Parallel Port Using IO.dll” on "Projects" Category, giving external circuitry for interfacing with it.

Utility: Developing hardware to connect the parallel port appropriately to implement useful applications.

Circuits

Look at the following circuits:



The first circuit in figure 1, the Simple test circuit, is useful only to test the software. When a bit is set ‘1’ (you have clicked its button) you can see the respective LED turn on. You do not use external power supply for this circuit because the parallel port provides enough energy to turn on the led, TTL states, generally. In this way you can test every data pin on the parallel port of your machine.

The second circuit in figure 2 uses the ULN2803 which is an 8-bit 50V 500mA TTL-input NPN Darlington driver. The inputs on the left side of the IC (1-8 pins) are suitable to be connected directly to the PC parallel port output lines. The outputs are open collector outputs, so they are well suited for controlling various loads powered through external power supply. The load device can be as simple as a LED, a small motor, small light bulbs or a relay. In figure 2 you see the simple LEDs control using ULN2803 IC.
This Integrated Circuit also has diodes to protect it against reverse currents when loads such as motors and relays switch on and off. The line (pin 10) can, for example, be connected to the power supply line that supplies power to the relays. For example, You can also use 9V Zener diode connected to this line as a protection component which limits relay power supply to maximum less than 9V as in the figure 2. Or you can connect a 12V Zener diode from pin 10 to the relay power supply plus to limit spikes to power supply voltage plus 12V as in the figure 3. Do not use a power supply higher than 30V. In this circuit I control one relay but you can control up to 8 relays.
In any case you need an external power supply and coupling to the GND line of the PC with GND of the external power supply. These circuits can be useful to control dc loads up to 50 Vdc. The main idea in these circuits is to insulate external hardware control from internal circuitry in the parallel port and then to protect the parallel port.

If you want to control more power or mains voltage you can use the circuit in the figure 4.

Warning: When you are controlling mains voltage, you need to be very careful and must know what you do to do it safely. Mains voltage can injure you if you touch it, and a badly constructed circuit can overheat and cause a fire.

In figure 4 we can see that an opto-isolation is provided by the MOC3041 which is very safe for the PC. In addition, in figure 4 there is a TRIAC for switching the high dc voltage or mains voltage. In the example a 12A-600V Triac (Ref. BT138) is used but you must analyze the appropriate Triac according to your application.

Finally, all previous circuits can be also used with microcontrollers or microprocessors.

Author's personal page here.

More tutorials, projects and news please visit:
Electrónica Plug and Play

Thursday, May 7, 2009

Programmers for PICs

I've created this blog to write electronics projects and electronics articles which can be used by any person interested in the electronic design. Your questions, doubts, comments and suggestions are welcome providing that they are written in a courteous and respectful way.

--Español-----English



PROGRAMMERS FOR PICs

In a previous post on Firmware Category named "PIC Microcontrollers Languages", I described and compared the programming languages for PICs. However, a pending topic is the interface between the computer and the PIC micro. This article describes types of programmers but first I shall explain different development tools to contextualize the reader about the final goal: programmer.

Goals:

  • Clarifying concepts of terminology for development tools for PIC microcontrollers.
  • Understanding the basic concepts about programmer interface.
  • Describing the programmers of Microchip and giving other options for programming PIC microcontrollers.
  • A glance at Microchip’s Emulators and Debuggers tools.
Background
It is very important to explain some concepts for development tools of PIC microcontrollers. Sometimes, there is confusion among the words Compile, Debug, Simulate and Emulate. In electronic design these terms have different meanings.
Compile: It is the process of translating a source code to the language of the machine. Source Code in Assembly language or C language to OPCODES in Hexadecimal or Binary format.

Debug: It is the process to check the source code or program to eliminate possible mistakes from it and at the same time to optimize the program and increasing its velocity of execution. Debug processes are used in both design or development stages.

Simulate: In PIC microcontrollers, simulate is the way to carry out a real experiment into a virtual environment running the source code step by step or by loops to analyze the performance and affected registers in the device. You can even simulate logic states on the pins and check behaviors in your source code. You can do all of this if you have the appropriate software tools.

Emulate: When you have an appropriate interface you can pretend that you have a program memory PIC and run the source code (firmware) from a PC and look at program memory and file registers and at the same time look at the behavior of the source code when real external signals are applied.
We emulate to debug the source code. This emulation can be done in real time and to full speed (speed of PIC). All this not only requires an appropriate hardware interface but also the appropriate software to emulate from the PC.
Microchip classifies its development tools into four groups as follows:
  • Compilers: To compile source codes. In all cases these are software tools.
  • Emulators: To debug and emulate source codes, even to program devices.
  • Debuggers: To debug and develop, some of which also can provide services for programming.
  • Programmers: To program devices exclusively.

Figure 1. Microchip's Development tools classification.

Many development tools interact with the MPLAB Integrated Development Environment but not all need MPLAB IDE or a PC to work because some of them can work standalone mode for programming without a PC.

A programmer is an electronic device that communicates a computer and a PIC micro to transmit data, especially a compiled source code.

The interface block diagram is shown in figure 2.


Figure 2. Programmer interface diagram block.

Some debuggers and emulators can include a programmer interface or internal programmer device to program PIC microcontrollers.

A glance at Microchip's Emulators and Debuggers

In slide 1, I only describe general aspects about Microchip’s Development Tools, Emulators and Debuggers, but if you want to go into the subject in depth you can visit: START NOW WITH MICROCHIP DEVELOPMENT TOOLS page.


Slide 1. Microchip's Emulators and Debuggers.

Microchip's Programmers

The most popular Microchip programmers are detailed below:

1. MPLAB PM3

Definition: The MPLAB PM3 is a Universal Device Programmer which is easy to use and operates with a PC or as a stand-alone unit.



Uses:
  • Programming Microchip's entire line of PIC devices as well as the latest dsPIC DSC devices.
  • Program devices using ICSP. (In-Circuit Serial Programming.) on the target board.
  • Verify that code in the target microcontroller matches your firmware and verify that microcontrollers are blank.
  • Read code from an unprotected microcontroller into MPLAB IDE’s program memory window for debugging and programming into other devices.
  • With an optional MPLAB PM3 Card inserted, which is an SD-MMC memory card, you can store and transport device settings for programming.
  • Using MPLAB IDE as the interface, MPLAB PM3 becomes another tool in MPLAB IDE, allowing you to quickly compile, test and debug your firmware, then download it into MPLAB PM3 to be programmed into your device.
  • Without a PC connection to MPLAB PM3, the unit operates as a stand-alone device programmer. In this mode the main programmer features of MPLAB PM3 are available, including Read, Program and Verify.
Notes:
- Each version of MPLAB IDE has upgrades to support new devices in MPLAB PM3.
- A PC connection is required for operating system updates.
- MPLAB PM3 hardware requires the following software support if you are using a PC running Windows: MPLAB IDE software and USB communications driver.

Communications: MPLAB PM3 has two communication ports, Serial (COM 1-4) or USB (standard). Serial communications are 57.6K (default) or 9.6K baud, 8 data bits, 1 stop bit, no parity.

Components:
• MPLAB PM3 device programmer
• Serial Cable for RS-232 PC connection
• USB cable for USB PC connection
• ICSP cable
• Power supply and power cables
• MPLAB Integrated Development Environment CD
• User’s manual and technical documentation on CD
• Sockets to insert devices to program them.

Additional parts:
Main Sockets:
• Part Number: AC164301 - 18L/28L/40L DIP Socket Module for MPLAB PM3: This socket module supports 8P, 14P, 18P, 28P, and 40P DIP PICmicro or dsPIC devices on MPLAB PM3 Programmer.
• Part Number: AC164303 - 16L (.150), 18L, 28L (.300) SOIC Socket Module for MPLAB PM3: This socket module supports 64L TQFP PICmicro or dsPIC devices on MPLAB PM3 Programmer.
• Part Number: AC164305 - 44L TQFP Socket Module for MPLAB PM3: This socket module supports 44L TQFP PICmicro or dsPIC devices on MPLAB PM3 Programmer.
• Part Number: AC164306 - 20L TSSOP Socket Module for MPLAB PM3: This socket module supports 20L TSSOP PICmicro or dsPIC devices on MPLAB PM3 Programmer.
• Part Number: AC164307 - 28L SSOP Socket Module for MPLAB PM3: This socket module supports 28L SSOP PICmicro or dsPIC devices on MPLAB PM3 Programmer.
• Part Number: AC164308 - 68L PLCC Socket Module for MPLAB PM3: This socket module supports 68L PLCC PICmicro or dsPIC devices on MPLAB PM3 Programmer.
• Part Number: AC164309 - 44L PLCC Socket Module for MPLAB PM3: This socket module supports 44L PLCC PICmicro or dsPIC devices on MPLAB PM3 Programmer.

Cost: USD 895 Including all components except the sockets. The sockets have additional cost for sockets.

2. PICSTART PLUS

Definition: The PICSTART Plus is a Microchip microcontroller development programmer that enables you to program user software into PICmicro microcontroller devices.




Uses:
  • Using MPLAB IDE as the interface, PICSTART PLUS Programs PICmicro microcontrollers, including program memory, configuration bits and ID locations.
  • You can verify that PICmicro MCUs are blank, verify that code in the target microcontroller matches your firmware and you can read code from an unprotected PICmicro MCU into the MPLAB IDE program memory window for debugging and programming into other PICmicro MCU devices.

Notes:
- Devices in non-DIP packages that are supported by the PICSTART Plus require the use of an adapter. Those currently available are listed on the Microchip web site.
- In the future it is possible a firmware upgrade to include new devices. The firmware is upgradeable using MPLAB IDE

Communications: PICSTART Plus provides communications with the host PC via an RS-232 9-pin, D type connector. PICSTART Plus is Data Communication Equipment (DCE), and hardware handshaking is via Clear-To-Send (CTS) and Request-To-Send (RTS). The unit defaults to a 19.2K baud rate, 8 data bits, 1 stop bit, no parity, Hardware flow control, FIFO Buffers should be disabled.

Components:
• PICSTART Plus development programmer
• RS-232 Interface cable to connect to any standard PC serial port
• 9V power supply
• MPLAB IDE
• Blank chip for programming

Cost: USD 200, This kit contains the programmer, RS-232 serial cable, power supply, user guide, and a copy of MPLAB IDE on CD.

3. PRO MATE II
Definition: The full-featured, modular PRO MATE II device programmer lets you quickly and easily program your software into Microchip’s entire line of PIC MCUs, KEELOQ security products and Serial EEPROMs. PRO MATE II runs under MPLAB IDE and operates as a stand-alone unit or in conjunction with a PC-compatible host system.


Note: This product is no longer in production. It is still supported and accessories can be purchased for the immediate future.
OTHER SOLUTIONS
In addition to Microchip’s programmers there are several programmers that are offered by different manufacturers. Some of these programmers can support several devices and microcontrollers from other manufacturers and also Microchip devices including PIC microcontrollers. To name a few:

  • Conitec Data Systems has two device programming machines: GALEP-5 and GALEP-5D. Each one has its device list supported but Conitec has the free Device on Demand Service for fast implementation of a new chip into the programmer device list.
  • Xeltek has eight SuperPro Universal Programmers: 5000, 5004GP, 501S, 500P, 300U, 9000U, 280U, 580U. Some of them are stand-alone units. Also, whether you have a need for development or volume production purposes some of them allow you program more than one PIC micro simultaneously. Xeltek offers you free software updates available for download at its PIC Programmer software Download Center.
In addition to previously description about programmers, I can tell you that most of PIC Microcontrollers have an In-Circuit Serial Programming (ICSP) incorporated to them. This is important because in this way you can program a specific device. ICSP is an enhanced ISP (In System Programming) technique implemented in Microchip’s PICmicro One-Time-Programmable (OTP) and FLASH RISC microcontrollers (MCU) where a programmable device is programmed both before and after the device is placed in a circuit board. This technique use of only two I/O pins to serially input and output data makes ICSP easy to use and less intrusive on the normal operation of the MCU. Each Datasheet device provides its own specifications to implement ICSP. Remember, ICSP is only useful for a specific PIC micro therefore that ICSP circuitry couldn’t work appropriately for another reference. Additionally you need special software to load the OP CODES into PIC micro.

Finally, If you like do it yourself, on Internet you can find many options to build your own PIC programmer. There, you can find from specific device programmers up to Semi-Professional programmers, each one with its advantages and disadvantages. Also, it is possible that you need additional software to MPLAB IDE to burn a PIC with your firmware. I do not recommend any specific programmer because it depends on your requirements and I would have to build it and test it to recommend it to you.

Author's personal page here.

More tutorials, projects and news please visit:
Electrónica Plug and Play


Monday, April 6, 2009

PIC MICROCONTROLLERS LANGUAGES

I've created this blog to write electronics projects and electronics articles which can be used by any person interested in the electronic design. Your questions, doubts, comments and suggestions are welcome providing that they are written in a courteous and respectful way.

--Español-----English



PIC MICROCONTROLLERS LANGUAGES

Recently I have met many students and colleagues that ask me about how to program PIC microcontrollers. For this reason I have decided to write this article. In the present article you can find hints and tips to help you begin to program PIC microcontrollers.

Goals:

  • Clarifying concepts in programming languages for PIC microcontrollers.
  • Comparing the current programming languages for PIC microcontrollers and establishing their advantages and disadvantages.
  • Doing simple examples of the most important programming languages.
  • Knowing several compiler provider companies.
  • Drawing conclusions and to define the best language for programming PIC microcontrollers in a professional way.

Background

Commonly for many people the first obstacle to programming PICs is the language.
Actually when we program a PIC we do not use a specific language. We do not see when program is loaded into a PIC but when the PIC is loaded with our program the instructions are converted in OPCODES. The OPCODES are in a hexadecimal base. The type of PIC (low range, mid range or upper range) that you are programming always loads OPCODES.

For instance, the 286C it is an OPCODE for PIC microcontroller and the mnemonic for this OPCODE is GOTO 0X6C, that means go to the 6C program memory position.
When a program is compiled in a suitable compiler, no matter which language is used, it always generates an OPCODES list that has a file extension .hex.
If we create a TURNONLED routine, when we compile it a TURNONLED.hex will be generated and it will be the file that we will sent to PIC microcontroller.
In order to carry out the TURNONLED.hex file loading task we need to have an interface tool between the computer and the PIC microcontroller. This interface tool is called a programmer. We could talk about this subject on another occasion.

PIC Microcontrollers Languages

Among the several languages to program routines and subroutines I would like to mention the following:

- BASIC language
- C language
- Assembly language

You must please not confuse neither BASIC language or C language for PICs with Visual Basic, Visual C++ or similar IDEs because you can never program PIC routines using Object-Oriented Programming (OOP). We always use the instructions and structures of these languages with special editors and compilers for PIC microcontrollers.

The advantages, disadvantages, versions and examples for each language is detailed below.

1. BASIC Language

Advantages:

  • It is a simple language with easy reading instructions.

Disadvantages:

  • You will never have the control of the program. That means, You will never know either the time of instructions nor the running time.
  • There are difficulties when you want to use interrupts.
  • When the *.hex file is generated, it is not optimized, therefore you do not know the size of program memory used.
  • Most compilers for this language use windows environment.

Versions:

There are several companies producing BASIC language compilers and editors, among them I would like to mention:

www.letbasic.com
www.melabs.com
www.basicmicro.com

The most popular and which I think is the best is PICBASIC PRO by MicroEngineering Labs Inc. It is not free.

Example: This routine makes blinking a LED on port B 0 every 200 milliseconds. I use BASIC language designed in PICBASIC PRO.

2. C Language

Advantages:

  • This language is closer to machine language. Therefore, you can merge it with assembly language.
  • You can build math routines easily.
  • You can create macros to simplify your program.
  • Is accepted by Microchip, even it has some compilers to C language.

Disadvantages:

  • When the programs are compiled they can become somewhat extensive, so You must consider the program memory capacity. I recommend using this language with upper range PICs.

Versions:

Among the several companies that produce compilers and editor for C language for PICs I would like to mention:

www.microchip.com. It has C18 compiler for upper range and C30 compiler for dsPIC. Both C18 and C30 compilers can include them with MPLAB IDE. They are not free.
www.ccsinfo.com It has PCW IDE, PCWH IDE and PCWHD IDE. Each one offers the possibility to select the range to work and to compile for both Windows and Linux environments. The PCWHD IDE has all ranges for PIC microcontrollers and dsPIC. Besides it has a debbuger and Wizard that can generates a lot of source codes to initialize the program. You have a lot of libraries and you can integrate it with MPLAB IDE as well. These editors/compilers are not free.
www.htsoft.com (HI-TECH) it has PICC and PICC18 software tools. They are not free.

Example: This routine makes blinking a LED on port B 0 every 200 milliseconds. I use C language designed in CCS PCW IDE.


3. Assembly Language

Advantages:

  • It is the natural language for PIC in all ranges.
  • You have a total control of the program. You can take into account the instruction times and control all registers bit to bit.
  • You can build macros to simplify the source code.
  • There are no problem to handle simultaneous interrupts.
  • When the compiler generates the *.hex file it is entirely optimized.

Disadvantages:

  • I consider that this language does not have disadvantages, except when someone does not have experience in programming, this language could delay his developments.

Versions:

PIC microcontrollers have the MPLAB IDE editor/compiler/simulator which is completely free on www.microchip.com. This compiler is usually updated with new versions, but it works on Windows environment.
For Linux there is an alternative version named PIKLAB.

Example: This routine makes blinking a LED on port B 0 every 200 milliseconds. I use Assembly language designed in MPLAB IDE.


-->
Conclusions
Above, we saw the several options for programming PICs. I consider that If you want to program PICS in a professional way you can take into account the following advice:

1. It is ideal completely to know the Assembly language because you can take complete control of the program and all resources of the device. You also can build macros easily with it.

2. If you are going to begin to program PICs, you should begin with Assembly language. My advice is that you are not going to begin with BASIC language.

3. The C language is very useful for upper range (18xxxx family) and dsPICs, but this language can result very useful for other ranges if you combine it with assembly language.

Author's personal page here.

More tutorials, projects and news please visit:
Electrónica Plug and Play

Wednesday, March 25, 2009

Controlling Parallel Port with IO.dll

I've created this blog to write electronics projects and electronics articles which can be used by any person interested in the electronic design. Your questions, doubts, comments and suggestions are welcome providing that they are written in a courteous and respectful way.

---Español-------English



CONTROLLING PARALLEL PORT USING IO.DLL AND VISUAL BASIC


Goal: To develop a simple source code in Visual Basic 6.0 to control the parallel port using IO.DLL library sending it bytes. This application will run on WIN9x, WIN2000 and WINXP.

Utility: To Send data (bytes) to pins of parallel port which could result very useful to control loads such as relays or triacs as well it could serve to communicate with microprocessors or microcontrollers. Obviously we must use appropriate external circuitry for interfacing to them.

Background

Many desktops and some laptops have parallel ports. It can see in their several connector types. Usually the connector for parallel port is a DB-25 female whose color is generally purple. The pin distribution for parallel port is shown in figure 1.








Figure 1. Parallel Port Pin Distribution

The parallel port standard has three bytes as follows: DATAPORT, STATUSPORT and CONTROLPORT.

On this project we going to use DATAPORT, it means D0 up to D7 (PIN2 up to PIN9), to send data control word and PIN25 (GND) as electric reference.

The DATAPORT has an assigned address which may change from machine to machine.
In order to establish appropriate address of this port, you must go to control panel, system, hardware, device manager and ports(COM&LPT). Then you do right click on LPT1 or LPT2 according to your case, and left click on properties. After that, you must search Resources in the new window and look at range for your parallel port. To my case I see:

I/O Range 378-37F

Since this range is in hexadecimal we can convert it to decimal, therefore the range is:
I/0 Range 888-895

I select 888 as default.

Microsoft has recently created protection modes for ports doing difficult access to them. For this reason we need a library to access these parallel ports. This library is IO.DLL which you could download doing left click on blue link and then run it following these steps:
  1. Unzip the file to a new folder.
  2. Duplicate or cut the io.dll file and paste in C:\WINDOWS\system32.
Warning : you must beware of handling Windows and system32 folders because you could provoke malfunction in your OS.

Software Development

1. You may create a New Standard.exe project on Visual Basic 6.0 (see figure 2).


















Figure 2. New Project Standard .exe

2. Add a Module using Add form tool (see figure 3).


















Figure 3. Adding General Module

3. Open New Module and paste this code:
Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean


---4. Finally, on form1 add eight Command Buttons, one per each bit of DATAPORT. Also you can add two additional Command Buttons, one to clear DATAPORT and another to set all DATAPORT on ‘1’. An example for this form is shown in figure 4.









Figure 4. An example of main form.

5. The code for each Command Button of the figure 4 is:

Private Sub Command1_Click() ' bit 0 on 1
PortOut 888, 1
End Sub

Private Sub Command2_Click()
' bit 1 on 1
PortOut 888, 2
End Sub

Private Sub Command3_Click()
' bit 2 on 1
PortOut 888, 4
End Sub

Private Sub Command4_Click()
' bit 3 on 1
PortOut 888, 8
End Sub

Private Sub Command5_Click()
' bit 4 on 1
PortOut 888, 16
End Sub

Private Sub Command6_Click()
' bit 5 on 1
PortOut 888, 32
End Sub

Private Sub Command7_Click()
' bit 6 on 1
PortOut 888, 64
End Sub

Private Sub Command8_Click()
' bit 7 on 1
PortOut 888, 128
End Sub

Private Sub Command9_Click()
' D0 up to D7 off (0)
PortOut 888, 0
End Sub

Private Sub
Command10_Click() 'D0 up to D7 on (1)
PortOut 888, 255
End Sub


Explanation

The PortOut Instruction has two parameters which are: port address and data word (byte). Both port address and data word must be in decimal format. In my case port address is 888. For this reason is very important that you identify port address number as previously it is explained. Once you have the new address port for DATAPORT you must change it into the code for each Command Button.

When you execute the previously software you could see that every time you click on each button one bit is set to ‘1’. To test this you may use a multimeter in voltage scale and its red test probe in the bit pin and its black test probe in pin 25. Also you may build a simple circuit using LEDs connected between the bit pin(anode) and GND(cathode).

NEW! You would see these circuits to complement this project or test this software.

Author's personal page here.

More tutorials, projects and news please visit:
Electrónica Plug and Play