Wednesday, October 18, 2017

Programming an ATtiny85/45 with an Arduino UNO (Getting started)


In the following tutorial you will find out how to Burn your ATiny85 chip-set to work at 8Mhz .
and run a simple LED Blinking example .



ATtiny85 Arduino

Here is some information about how to use ATtiny85 with Arduino IDE. ATtiny85 is a small (only 8-pin MCU from Atmel) and is available in both DIP8 (Hole Mount) or SOIC8 (Surface Mount) . These are available in a lot of finished products such as Adafruit Gemma , Adafruit Trinket and LilyPad . There are many other cards on the market, but let's start from the beginning.
ATtiny85 has 8Kbytes Flash (program memory), 512bytes EEPROM, 512bytes RAM and only 8 sticks, the entire data sheet can be loaded here . 2 pins are needed for feeding, only 6 I / O left (PB0-PB5), but you often want one of the I / O pins as external RESET (PB5) to remain 5 I / O green 0-4 in the picture below). Why do you want to use such a small rack?


In some cases, this may be enough if you have an easy task to perform, space shortage, energy-saving or cost-critical application. You drive with an internal oscillator (although you can drive outside on PB3 and PB4, but then 2 additional I / O pins will disappear). The internal oscillator is 8Mhz, but ATtiny85 can be run up to 10MHz or up to 20MHz if the power supply voltage is above 4.5V. So with Arduino you can use 5 I / O, these 5 I / O also have alternative functions in addition to digital, there are 3 analogue to digital converter (ADC) as blue-marked A1-A3, 2st can be used as PWM. This small rack also has a real I2C (SCL / SDA) as well as an SPI (MOSI, MISO and SCK) and it's also those used with RESET if you program through the ISP interface. However, a serial UART (RX / TX) is missing.
If you want to get started quickly, it's easiest to buy one of the ready-made cards from Adafruit called Trinket or Gemma , but here you also need to charge an additional support for these and drivers.
If you want to start completely from scratch and test yourself, there is support in Arduino IDE for ATtiny85 if you install an extension and driver to download the code via USB. First, however, you must program a bootloader through the ISP in each ATtiny85, this can be done with different tools, we will show some here. Once this is done, Arduino IDE can develop code and download via USB.
Because ATtiny85 does not have a dedicated bootloader area that can be protected (such as in ATmega328P, ATmega32U4 and ATmega2560 etc.), then all of the flash memory must be deleted when new code is downloaded and the bootloader along with application is programmed. Should something happen during this process (voltage goes out or you unplug USB before it's done, etc.), it's easy to flash memory and you have to re-program the bootloader via ISP so you must be aware of these pitfalls. Likewise, ATtiny85 does not have any built-in USB, so USB is emulated in the software / bootloader and is only active during the actual boot (RESET) and a few seconds. During this process, 2 I / O are used as D + and D- on USB as shown in the picture below (this schema is not complete but shows only how USB is connected, a pulse of 1.5Kohm on D to VCC and 10uF / 16V also requires and 100nF over VCC and GND, it is also appropriate to use 2 USB-VCC diodes to reduce the voltage to about 3.6V). Full schedule is available shortly down the page.You should consider what connects to I / O 3 and 4 to avoid interfering with the download of code.
The actual bootloader in ATtiny85 is called Micronucleus and is open source under GPLv2 license and is available for download here at GitHub . The support for Arduino IDE (version 1.6.5 or later) is from Digistump / Digispark and there are very good instructions on how to install this and more about the project itself.
Here is a simplified installation guide in Swedish, for complete information, see the links above. We assume that Arduino IDE version 1.6.5 (or later) is already installed. Choose "File-> Preferences" from the main menu (shortcut: CTRL + Comma) and enter: http://digistump.com/package_digistump_index.json in "Additional Board Manager URLs" and click OK.

Then start Arduino IDE (sometimes this may be required for Contributed to appear), then go to Tools-> Boards-> Boards Manager ... and select Contributed in the Type list as shown below. Touch the top option as shown, and click Install. The support for ATtiny85 is loaded and installed, when it's done, press Close. Before plugging into its ATtiny85 with Micronucleus bootloader, the USB driver must be installed. According to Digistump, it will start itself when installing the Digispark support in the Arduino IDE, but it does not always make it possible to run the USB drivers themselves. They can be loaded here (in the tools directory there are USB drivers, choose the one that suits your OS, unpack and run the executable file, in Windows it is the ZIP file and then run install.exe). However, it is best to read carefully on Digistum's website if you are having trouble, we can not support this.

Now that this is done and USB drivers are installed, an ATtiny85 needs to be prepared with the Micronucleus bootloader.
The first time you prepare a blank / empty ATtiny85, this must be done via ISP (or if the flash memory becomes corrupt), you can do it with cheap / simple programmers such as the Tiny AVR Programmer (or compatible) or more advanced such as Atmel ICE Basic or Atmel ICE Full via Atmel Studio.
If you run with the Tiny AVR Programmer from SparkFun (or compatible) you will need to install the USB drivers (not required on MacOS or Linux) and if you have installed the USB driver for Digistump, it's the same. Then download the Micronucleus home and unpack the files and locate the hex file t85_default.hex, it's the bootloader itself. You need to redirect (and the conf file) and these come with Arduino. We usually have these files in their own catalog so it's easy to program them together with a bat file. See the picture below as needed.

To program a new new ATtiny85, we have created a bat file to make it easy for us and in this there is a command line:
avrdude -c usbtiny -p t85 -U flash: w: t85_default.hex -U lfuse: w: 0xe1: m -U hfuse: w: 0xdd: m -U efuse: w: 0xfe: m
The ATtiny85an will now be erased, programmed, verified and set the different fuse bits correctly. To facilitate, here is a zip file for windows with the essential files (note in zip file there are only AVRdude, HEX file for ATtiny85 and the 2 BAT files). Below is the end of all commands if everything is done correctly. Of course, do this in MacOS and Linux with.
Then everything was done and ATtiny85an can now be programmed via USB via Arduino IDE. A simple schedule will come soon and we will also show you how to program it with the help of Atmel Studio and Atmel ICE.

Wednesday, August 2, 2017

CLEARink Blots

New screen technologies rarely enter the market. The two biggest reasons, among all of these concerns, are cost and appearance. If a display costs more to manufacture than competitors, it needs to look great. If it doesn’t look amazing, then consumers won’t buy it.



What makes CLEARink a contender in many different markets: it’s both cheaper to produce and looks better than its e-paper competitors. The technology brims with so much promise that it won Best of Show at Display Week 2017.

Sri Peruvemba, Head of Marketing at CLEARink Displays, answered several questions regarding CLEARink Display’s electrophoretic technology. Here are just a few reasons why CLEARink seems destined to become a mover and shaker in the e-reader space.

CLEARink Looks Better Than E Ink

The CLEARink technology looks like E Ink, but with some big differences. While both share an underlying technology (electrophoresis), the secret behind CLEARink lies in a new type of ink, co-developed with Merck, and a reflective panel. Here’s how it compares to LCD, OLED, and e-paper:


The new ink and reflective panel make images that are sharper and clearer compared to E Ink displays. According to CLEARink Displays CEO Frank Christiaens, CLEARink’s whites offer twice the “reflectance” (or whiteness) of E Ink, which almost equals ink on paper. Part of its competitive edge lies in its simplicity. Instead of using two kinds of inks (or pigments), CLEARink employs just one. According to Peruvemba:

“E Ink uses a two particle system to generate black and white. To generate white, E Ink uses a white particle to reflect light. Whereas CLEARink only uses one particle — black — to generate black state. To generate white, CLEARink uses a TIR (Total Internal Reflection) film on the front surface.”

The end result: higher contrast, lower power consumption, and even color video, when combined with an LCD layer.

While CLEARink’s video variant consumes more energy than E Ink, its power consumption relative to LCD comes in around 80 to 90 percent less. In addition, it can display motion video with a refresh rate of around 33 Hz — a little choppy, but good enough.

But there’s more. A lot more.

Wednesday, July 19, 2017

Security Robot Takes Its Own Life in DC Fountain Tragedy

I think this is the answer for , can a Robot replace a human security guards !