Some sort of blog, I think. I wonder if this blog cost me web space - I mean, if it diminishes the total free space of my site... must check.
Regarding the software, I started with Arduino/Wiring language and continued with avr-gcc C compiler. But thanks to Dietmar, a member of TheBackShed forums, I discovered a fantastic language which come with a great library. Since then, LunaAVR became my main language. I will occasionally use Arduino language.
As for AVRs, there are a host of very good boards at rather good prices.But, because this site is about DIY, I will have also my own version of Arduino PRO board with through hole components. Just to say that I also did one - in fact, I'm using it already.
PIC microcontrollersMeanwhile, I have a PIC18F46K22 board in development. For this, I will start using Firewing language, as it has support also for PIC24 and PIC32 microcontrollers. It comes with a good library support.
All old and unsupported designs are no longer available. For USB boards, I will focus on using HID Bootloader and for them, I will continue to use JALv2 language, as it has a good USB support. I will extend this also on PMP v.2 language when it will be available and maybe, it will replace the JALv2 language entirely for the majority of 8bit microcontrollers.
I'm pretty sure that this section is consuming my limited (100Mb) hosting space. If this section can be somehow improved at the wordpress level, Google Sites can be much better than Blogger.comUntil then, I will use a separate blog for the News section, hosted here.
1. About the device
The PIC12F675 is a little 8pin microcontroller device which has some interesting features. Is cheap, ideal for beginners and can be freely supported by many commercial languages on the market.
The device can be used in a reasonable variety of projects as Windmill/Solar controllers/loggers, Water pump controllers, Stepper motor drivers, Alarms and Automotive applications, etc.
2. About our mission
For such a device, the only thing desired from actual languages/compilers on the market (commercial or freeware) is to obtain the smallest code possible, without much effort form the user. But this objective is harder and harder to attain with the modern compilators which must come with support for the most recent devices from Microchip and with the best featured library possible - I always said that these days, with the powerful microcontrollers available at competitive prices, a feature rich library is more important that the ability to produce the smallest code. A language/compiler which come with easy support for USB, SD Card, Network and USB & Network bootloaders can be the winner. Because this can also assure a large online community of users.
But what is happening with the support for our older and smaller devices? It is a common practice to make common libraries to support a large family of microcontrollers but the price is high for small devices - more and more space memory occupied from a version to another of actual compilers. Older projects can't compile on newest version of libraries/compilers.
So, let's see what is the situation for 12F675 device and Pascal like languages/compilers today. Initially, we will use a small project consisting of a small Windmill/Solar controller and later, a more complex logger application.
3, The compilers and tools used
Here are just three compilers - don't know for others.
The tools I used to program and test the microcontroller:
4. Testing using standard libraries
The examples will use the standard ADC libraries provided by the toolchain. Again, the standard libraries are designed to provide functionality for the all supported microcontrollers.4.1 Simple Windmill/Solar controller:
The sources are included inside "standard.zip" archive - see the attachments.
5. Testing using custom libraries/functions
The examples will use custom ADC functions, designed specially for the microcontroller in case. The advantage is obvious - no bloated code and a better optimization. As you can see in the table bellow, is the only solution when you work with such devices. The downside is that this is not for beginners...
5.1 Simple Windmill/Solar controller:
The sources are included inside "custom.zip" archive - see the attachments.
5.2 Windmill/Solar controller and logger:
The reference design can be found there, here will be only the firmware as a test (not sure yet, maybe first I will post there the modified project). This will not work with standard libraries so it is posted on this section only - I will try to keep the 32bit integer math for calculating required voltages. Otherwise, an adjustable voltage power supply is mandatory - no big deal but it will take some time, my variable power source is down.
--- to be completed ---
Some time ago, I bought an RC1602A-GHW-ESX LCD but I had no time for it. I intended to use it as a serial display for my laboratory so, I tried to test it in 4bit mode, to see how it works. I used first a 18F2525 but no luck. I thought is a PIC problem, so I tried with 18F2550 - didn't worked. The LCD was brand new so I didn't thought it was defective.
After a quick search on Internet, I found that it use a ST7066U processor which come in three flavors, A, B and C (AFAIK), each having a different set of characters (mine is B variant). I used it with HD44780 libraries and that was the reason of trouble. The ST7066U processor use a different initialization procedure but this is the only (almost, second is a bigger delay after the "clear screen" command) difference between the two processors.
The testing bed (that paper with printed circuit have nothing to do with the test):
Jal libraries are attached bellow:
1-4 of 4