Blowing Bootloaders into Atmel Chips

A couple of Atmel Chips – the 1284p and the Attiny85 came my way recently – well I say a couple, a few of each – and for the first time I found myself having to program bootloaders for them.

To explain – hobbyists buying the likes of Arduino microcontroller boards generally just have to program “sketches” or programs onto them – and that’s often done with a little serial converter plugged into the USB of their computers. But if you get free samples or come across raw chips not intented for Arduino, they are utterly blank. That is, they don’t have a bootloader – or the minimal code necessary to let you use the serial interface etc.

There are a couple of links here which I’ve used and which work.

http://www.kobakant.at/DIY/?p=3742

The above link lets you program an aTTINY or similar device using an Arduino board (or clone) as a programmer. The Arduino IDE comes complete with a sketch for this – basically blow the sketch onto your Arduino, put a capacitor between reset and ground on the Arduino (to stop it resetting) and then use that Arduino to blow the bootloader onto the Attiny… it’s all in the link – just don’t forget the cap and check your wiring carefully – blowing the bootloader takes seconds. You can then (again without removing the cap) blow sketches onto the little chip – for a test I used the BLINK sketch but changed the output pin to “3” which actually makes physical pin 2 on the chip flash.

The 1284p on the other hand is a different monster – this 40 pin chip has the most RAM of any of the chips while retaining DIP packaging which is ideal for messing around with.  Here’s the link:

http://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/

Similar setup though I don’t recall anything about a capacitor in this case.  One thing you might have issues with the 1284p – is blowing sketches with your serial interface…. if that’s not reliable, I read somewhere that some of the chips have a design issue and that the RX in should have a 10k series resistor – with a 0.1u cap from the RX pin to ground – well, I DID have issues, programming sketches would often stop after a few seconds and that DID fix it for me – I’m happily blowing large sketches into these chips now.

Advertisements

Home Control Update

1284p main board with LCD panel up front

Just a quick update on the home control… the slaves are about as good as they can get – I’ve added memory for the state of the 3 PWM outputs and ALLOFF and ALLON commands so that one can set the brilliance of, say a 3-colour LED strip – and then turn the lights on and off accordingly. At some point I’ll put a global fader on all 3 colours….

I’ve switched my attention now to the master board. I was using a MEGA, having long since given up on the 328 due to constantly running out of memory. I had a few 1284p chips lying around – in case you don’t know these are the largest Arduino-type chips you can get in DIP format – 40 pins – and they have one great feature – 16K of RAM which means you can forget about penny-pinching RAM.  Accordingly – I’ve added SD logging – and just now for the sake of it, an LCD display. I’m using the new LCD library that lets you use an LCD module with a 74HC595 shift register on the back (on veroboard) to reduce the pins needed to talk to the processor down to 2 (clock and data). 

As you can see above, the LCD is echoing the Ethernet commands as they come in (and quickly too) and over on the left is the micro-SD card plugged into the Ethernet card…. which is also supplying the 3v3 to the radio board. All in all very few components – took me an hour or so to put this lot together and twice as long to remember how to use the various libraries.

All working well, not sure if there’s a REAL use for the LCD – I also have a 4-line version of that… overall current for the board is around 300ma – or 1.3 watts – that won’t break the bank running all the time and it should run off a standard USB plug-in-the-wall.

The next challenge is a box.  I have to say, it’s all working very well – once again for pinouts etc I keep referring back to ManicBug’s various articles.

The Apple iPhone 5s and 5c–thoughts

Yesterday saw the launch of the new iPhone 5s and iPhone 5c phones – an event so powerful – I’d have missed it had a couple of enthusiasts I knew not sent me last minute emails.

When the original iPhone and iPad came out there was invariably a buzz in the air – in particular the iPad 2 which both my wife and I just HAD to have, having watched the launch video. After standing in a queue at the Gateshead Metro Centre for several hours, the time we actually got into the store we were so very excited. Apple were moving from a niche computer supplier to the dominant mobile operator and here they were selling us a dream – a practical, super-thin tablet straight out of Star Trek. I’d already owned the iPad 1, my wife having shipped one of the first models over from America so I could present it to my colleagues in the Federation of Small Businesses (FSB). For some time this machine had the market all to itself… but that was then… this is now.

Compare that early buzz to yesterday’s Apple launch and the resulting two phone models starting with the “cheap” iPhone 5c, which looks like something a back-street Chinese operator might produce with it’s bright colours at a “stunning” £469 for a 16g basic phone, then there is the new 5s which looks much like the previous iPhone except for the addition of 2 coloured LEDs for the flash, a faster processor and a price tag of £769 for the 64g model. Still no sign of NFC (near field communication). Ah, well.

Think about it, £769 – you could buy a half-decent laptop or computer for that! And what do Google do in response? They’ve just (strategically?) dropped the price of the very competitive Nexus 4 phone to a stunningly low £199 – so much so I’ve ordered a couple to test. Like the Apple it has an 8 Meg camera, whereas the resolution of the Apple is only 1136*640, the Nexus is 1280*768 and hence much better suited to movies even though this is by NO means a new model. The limit of memory on the Nexus is 16Gig like the Apple 5c but then you can easily plug in an SD adaptor to the bottom for carrying around large movies. Do the maths over two years… £199 for the phone, let’s say £12 a month to Giffgaff for the SIM and…. you have a pretty good bargain – I never thought I’d say it but pay as you go seems like a reasonable way to do things given the above.

I’ll grant Apple that the fingerprint sensor is a great addition – a long-overdue security enhancement (but then back in 2011, Motorola did the same thing and some folk had problems with it) but how well will it work in practice?

It would seem that Apple are now merely incrementally improving their products – the spark seems to have gone – where is the new amazing iPad or the new amazing iPhone – nothing – nothing really new or exciting, just some solid, incremental improvements – but is that enough?

Were these phones really cheap I could see it, but at the prices we’re seeing I wonder how many parents will be daft enough to buy these for the next generation, not too many I fear. Could we finally see Apple lose it’s market dominance? Was it always going to be just a blip? Or is it down to the loss of Steve Jobs – after all, Microsoft seemed to lose it’s sparkle around the time that Bill Gates went on to other interests.

I would not say that Google is perfect, not by any means – but from Android 4.2 onwards they’ve done an impressive job and the likes of Samsung are making phones to match. Meanwhile who knows what Microsoft are up to – and not many seem to care. Aside from rather pathetic battery life I can’t fault my Samsung S4, it’s a beautiful machine – and I’m looking forward to testing the slightly less powerful but stunningly inexpensive Nexus 4 which I am told lasts at least a clear day of use – more of that here no doubt in the next few days as I test the thing to death.