Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Welcome To Rant Central
You have to register before you can post on our site.



Microcontroller development system
I have been thinking for a while about getting my head back into programming.
I graduated from technical college with a diploma in industrial programming a whole lot of years ago, back in the 1970s.
Of cause, everything has changed since then.

There are now some custom circuits that I would like to build that I can't buy anywhere.
I would like to implement them using as few chips as possible and drawing as little power as possible.
So I decided to put together a development system for the Atmel AVR series of micro-controllers.
My choice was the Arduino development platform.
I decided the Arduino UNO development board was the best choice to go with.

But I wasn't willing to pay 20 Euro for it, when the Chinese clones of it sell for only US$9 with free shipping.
The Arduino hardware circuit designs are open source, so the Chinese made clone cards designed to interface with it are ridiculously cheap, just a few dollars each.
I made a few eBay purchases, primarily from vendor alice1101983 in Hong Kong.
I got myself an Arduino UNO clone card, some interface cards, three 2-line LCD displays and a bread boarding system with a selection of patch wires, all for less than $40.

The IDE (Integrated Development System) containing the custom C compiler is free, and can be downloaded from the Arduino web site.
There are a lot of open source software developed for the Atmel AVR CPUs, and there is a strong support comunity with several Internet forum sites supporting the technology.
And web sites such as AVRfreaks.

The AVR series of micro controllers have been used extensively by the auto industry.
They are being used to implement custom dashboard functions by manufacturers such as BMW, Chrysler and Daimler-Benz.

Here are some pictures.
The Arduino cards are quite small, about the size of a cigarette pack.

[Image: ArduinoUno_R3_Front_450px.jpg]

[Image: VUPN5706-1.jpg]

[Image: LCD-Pushbuttons-1-600.jpg]

[Image: overview.jpg?1351083498]

There are many YouTube videos dealing with the Arduino development system.
Here is one to get you started:

Never underestimate the power of human stupidity.
- Robert A. Heinlein

Are you planning to automate your home with these micro-controllers or did you have something more academic in mind?
If I was going to implement home automation, I would rather go with off the shelf purpose made devices.
Something newer and better than the old X-10 gear that I decommissioned.

I am building a self calibrating time base reference.
I have bought an OCXO, a 10 MHz double oven frequency reference oscillator, on eBay.
Double oven OCXOs have superb superb short term frequency stability, but suffer from long term drift.
They have a voltage input for a tuning voltage to compensate for this.
I have also bought a Motorola Oncore GPS receiver card with an active (built-in preamp) antenna.
A GPS timing receiver with a PPS (Pulse Per Second) output has poor short term stability,
but since it gets its information from the atomic clock controlled GPS system, it has superb long term accuracy that may be as good as 10E-14.

What's required to connect the two, is a microcontroller that will count the pulses from the oscillator over a precise time interval and calculate the required correction voltage for the OCXO.
If the 10 MHz oscillator output is first run through a divide by ten counter, such as a 74xx90 chip,
then the microcontroller can be used to count the resulting 1 MHz pulses during a fixed interval such as 16 seconds as defined by a count of 16 PPS pulses from the GPS.
The result should be 16,000,000. If it is higher or lower, the PWM (Pulse Width Modulator) output of the microcontroller will need to change its duty cycle accordingly.
The PWM output is then filtered by a capacitor to turn it into a DC level that can be fed to the voltage control input on the OCXO.
This forms a servo circuit that will lock in after a while.
It will then stay in calibration by just leaving it on 24x7.

The result is an oscillator that has an accuracy of better than 10E-11.
In comparison, a cheap consumer crystal (10 MHz crystals can be bought in packs of 20 for $4 on eBay) typically have an error tolerance of plus minus 20 to 80 PPM (Parts Per Million).
That represents an accuracy of only something like 10E-5.

What I want, is a self calibrating reference oscillator with atomic clock accuracy that can be build for less than $100.
It is quite doable.

For more information on this subject, Google GPS disciplined oscillator
Never underestimate the power of human stupidity.
- Robert A. Heinlein
Just a link I thought you may like.

Especially the last link on that page.
that those with no rights,
display the right to have no life, to have respect they must accept
a world commiting suicide
I am already familiar with that web page. I have studied all of the GPS disciplined oscillator designs that Google was able to find on the web.
I like his circuitry, but I am not going to send him $60 cash in an envelope, as he is asking for, for just the source code to his software.
If he sold a kit for that price, consisting at a bare minimum of the circuit board and a pre-programmed microcontroller chip, I might go for it.

I am also familiar with this web page:
He wrote an article in the Sept/Oct 2006 edition of QEX Magazine:

They both have the same idea.
But I am interested in creating my own version.
And I would prefer to write the code in C to run on an Atmel ATmega328P AVR chip
The most significant difference in the hardware layout that I would make, is adding a front end decade counter chip to divide by ten (74xx90)
or perhaps a dual decade counter chip to divide by 100 (74xx390), to avoid running the 10 MHz signal straight into the microcontroller chip.
Never underestimate the power of human stupidity.
- Robert A. Heinlein
(02-28-2014, 08:42 PM)velvetfog Wrote: But I am interested in creating my own version.
And I would prefer to write the code in C to run on an Atmel ATmega328P AVR chip

Okay now I am even more interested. I've been looking for a project that my dad and I could get into and this sounds like just the thing.

I was reading up on the software side of things. I found this: Atmel Studio 6 which seems to be a very nice development package, but is there any kind of emulator so that you can test code on the PC?
Why would you need an emulator running on a PC, when you can buy an Arduino UNO development board for less than $10?

But there are emulators and simulators available.
Look here:
Never underestimate the power of human stupidity.
- Robert A. Heinlein
(03-01-2014, 02:43 PM)velvetfog Wrote: Why would you need an emulator running on a PC, when you can buy an Arduino UNO development board for less than $10?

Because it would make development much more portable. For example, I (who don't even have the hardware) could write programs and contribute to the open source community without having to worry about the hardware at all (given that someone was testing for me, ofc).

But thanks for the link. I am a decent C/C++ programmer and I still remember a lot of assembler I learned when I was a teenager so it just sounds interesting to me.

Of course if I made anything useful, I'd have to get hardware to test it myself Big Grin
The Arduino form factor board you need to have a target device to do firmware AVR chip development is so ridiculously cheap (if you buy a Chinese clone) that you may as well just buy one.

Here is a quick hardware prototyping video.

Never underestimate the power of human stupidity.
- Robert A. Heinlein
The other question I had was about language choice.

When I looked at Amtel Studio it clearly states that C/C++ and assembler were the languages of choice, but Arduino says:

Quote:Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software running on a computer (e.g. Flash, Processing, MaxMSP).

What am I missing? In your post you specifically mentioned C as the language of choice.

Possibly Related Threads...
Thread Author Replies Views Last Post
  PC Game Cause System Shutdown (Help!) Bunny 18 3,669 12-18-2012, 10:16 PM
Last Post: AliShibaz
  Microsoft previews Windows 8 operating system 2010kaiser 2 1,296 06-17-2012, 01:03 AM
Last Post: RobertX
  Favourite Operating System RobertX 16 4,113 01-01-2012, 09:58 PM
Last Post: srijantje

Users browsing this thread: 1 Guest(s)