- Published: Sunday, 20 June 2010
- Written by Graham Mitchell
- Hits: 10780
Reading about the Amicus18 left me intrigued to trial it's seamless interfacing. A developer does not need a programmer or USB-UART converters -- it's all onboard. Once your finished writing your program, you hit compile+program and the Amicus IDE will promptly have the PIC flashed.
Also, there's no need to connect different headers or flick switches to "talk" with the device - it all works hassle free with the USB cable connected.
A benifit of the of the on-board USB-UART converter is that the device presents itself as a legacy RS232 COM Port. The Amicus IDE has an excellent Serial Terminal program which will connect to the Amicus18 via the selected port.
So, with all that in mind I wanted my first program touch base with the above features. I had a DS18B20 on the desk, and thought "that will do".
The Dallas DS18B20 is a temprature sensor which uses the Dallas 1-wire protocol. A quick review of its features:
- Each Device has a Unique 64-Bit Serial Code
- Requires No External Components
- Range is 3.0V to 5.5V
- Measures Temperatures from -55°C to +125°C (-67°F to +257°F)
- ±0.5°C Accuracy from -10°C to +85°C
- Thermometer Resolution is User Selectable from 9 to 12 Bits
- Converts Temperature to 12-Bit Digital Word in 750ms (Max)
So it does a fair bit. I like them because they require one-wire for communication, and several devices can be on the same bus.
Interfacing with the DS18B20
The DS18B20s require power, ground and a pullup resistor for the 1-wire bus. That's it.
A 4.7K resistor is the recommended value, you can fudge it by a few Kohm either side if need be.
I've used a Companion Shield for rapid prototyping, and connected the wires as shown on the right. Although the Amicus18 has a 3.3V PIC, there's a 5V output which is clearly marked on the Companion Shield.
As shown in the above picture, the Companion Shield is fitted to the Amicus18 board. The DS18B20 is in the shiny steel cylinder on the right. There's not much to it, and this is a good example of how the Companion Shield can easily be used to prototype with different widgets.
The Source Code
Programming the Amicus18
I did a quick screen capture while programming the Amicus18 board, and then opening the Serial Terminal to talk with the PIC microcontroller. It's allot easier than typing, so here it is:
As you can see, the whole process is very easy. The guys at Crownhill have done an awesome job thus far, here's hoping they keep the momentum behind Amicus products.