background preloader

PIC

Facebook Twitter

Tips and Tricks. Code optimization tricks for AVR microcontrollers Using high-level language compilers such as C greatly improves the development efficiency of microcontroller-based products.

Tips and Tricks

But when programs are written in C and compiled by a C compiler, the code efficiency is generally lower compared to an Assembly language program. However, good knowledge of microcontroller architecture and C coding helps the developers to optimize the code for reduced size and enhanced performance. For example, if we use a “do { } while ( )” loop, an increment or a decrement loop index generates different code size. Usually we write our loops counting from zero to the maximum value (increment), but it is more efficient to count the loop from the maximum value to zero (decrement).

Code Optimization in AVR microcontrollers Three-Phase Electronic Watt-Hour Meter Using the MSP430F677x 3-phase watt meter Understanding ADC parameters for accurate analog-to-digital conversions Understanding ADC parameters. PIC PAL Video Library. Draw a character DRAW a CONSTANT STRING Click on the picture to enlarge The core of the circuit is a PIC18F4620 : C1, C3 and C4 are decoupling capacitors The PIC is clocked with a 8 Mhz crystal D1 is used as temperature sensor connected to PIC ADC Video signal is mixed through R8 and R9 Switches with pull-downs are used for settings You can connect the video out signal directly to the composite video input of your TV.

PIC PAL Video Library

This program example shows you most of the features of the PIC PAL Library. On a PIC18F4620, it uses 25% of the ROM and 55% of the RAM only ! The first screen of the program example is a 128x128 picture with a blinking border The program waits for the key RB7 to be pressed and then goes to the second screen The second screen is a calendar clock with temperature.The time is displayed both as digital and graphic clock.

Here is the mikroC source code of the program example. This program shows how to use the new mikroC time library too, very usefull to build rapidly clocks & calendars ! PIC16F877 APRS Weather Station. 18f2550 BootLoader - Sonsivri. SexyMF DIY controller - so far - Мозилин фајерфокс (Mozilla Firefox) As some of you know I decided to attempt to make a controller for a single system.The goal was to make it open source, easy to build and cheap.I decided on these specs:0.2C steps -55 to +50C Hardware settable condensor overtemperature set-point (activates an output) 0 -> 50 Hardware settable computer on set-point (activates an output) 0 -> -55 Hardware settable condensor temperature optimal point (for the fan control) 0 -> 50 Automatic fan throttling based on condensor temperatureThermistor sensors LCD displayThis is the first time I have used thermistors and so it was a learning curve.

SexyMF DIY controller - so far - Мозилин фајерфокс (Mozilla Firefox)

A thermocouple implementation would have been a lot easier but price of thermocouples and the required CJC (cold junction compensation) ICs is to high - compared to the thermistor.The system is simple. It works using 3 potentiometers to alter the set-points. You hold down the only button while turning it on and it goes to a visual calibration mode. Voltmeter Ammeter - Мозилин фајерфокс (Mozilla Firefox)

18F4550 USB Proto Board - Мозилин фајерфокс (Mozilla Firefox) PIC16F84 Based Morse Code Reader - Мозилин фајерфокс (Mozilla Firefox) PIC16F84 Based Morse Code Reader by Lawrence Foltzer, KE6UDL, photonsu@sonic.net So you want to become a HAM, or you've got one of those no-code licences, but like me feel somewhat lacking,... not having obtaining that age old badge of proficiency that differientiated the HAM from other radio operators.

PIC16F84 Based Morse Code Reader - Мозилин фајерфокс (Mozilla Firefox)

However, like thousands and thousands of others, you have trouble learning the code. The problem for most people is the non-real time nature of the process, i.e., writing down the last character while listening to, and decoding the signature of the next character. Furthermore, when you make a mistake, the entire process collapses as your mind tries to perform error correction, trying to fill in the missing blanks, causing you to miss even more characters. One way out of this delimma is to remove the burden of writing down the characters altogether during the process of building up your code speed.

The Hardware The schematic of the decoder is shown in figures 1a and 1b. Figure 1 b. Listing 1. PIC Microcontrollers.