Programming an ATmega8

Teazle

New Member
I feel a bit embarassed about asking a question about the competition but...........

I was going to set about making a PICAXE based logic analyser with a self contained screen but then I came across this http://www.serasidis.gr/circuits/mini_logic_analyzer/miniLogicAnalyzer.htm , which seems to do exactly what I want. On the basis that there is little point in reinventing the wheel I may as well have a go at making it.

However, I have no idea about downloading onto ATmega chips. Whilst I think I can get a USB programmer on Ebay for just three or four pounds (I hope I'm looking at the right hardware) I'm not sure about what is really needed. Can anyone point me in the direction of a simple idiots guide that can steer me through the process.....everything I've found has been very longwinded.

TBH, all I want to do is programme this one chip and then forget about it. I have no intention of "moving on" from the PICAXE but this particular project really does look to be tailor made for what I want.
 

Dippy

Moderator
I have no experience with Atmega but micros are all roughly the same.
Compile/Configure/Load.
And, the software that comes with more expensive hardware programmers tends to be easier to use.
Mikroelektronika (M.E.) make some nice hardware programmers with easy GUI software.
I'm sure there are many others.

The usual process is write (or steal) the code adding any config, compile it, open the hex in the Hardware Programmer app, connect your device and push the tit.
Some may be command line which may be a pain in the arm if you need to do a lot of tinkering.

A couple of quid might get you something that can pop code in.
Will you get support if you get stuck or will you be back here? ;)

The nice thing about 'proper' GUI software is that you can load your compiled code, play with fuses where needed etc. etc. and bang the whole lot down in one.
They usually provide the schematic for programming too.

I'm just doing a PIC (in that ghastly MPLABX IDE) and using a ME programmer.
Sequence: Open the .hex, fiddle with some settings, connect the wire and push 'write'. 20 seconds.

I've given up buying the cheapest these days.
If you search on Hardware Programmers ATMEGA you may get some good information.

Sorry I can't help with nitty-gritty as I lean towards PICs, but I wouldn't base my purchase simply upon price.
Mind you; what you save in cost may purchase a hair transplant after you've torn it all out :)
 

MartinM57

Moderator
USBASP - £4 from the auction site
AVRDUDE - freeware download
...and a bit of googling, and you should be away.

A quick search of of http://www.avrfreaks.net/forums/megaavr-and-tinyavr will find loads of questions and answers

EDIT:I'd be a bit wary of investing in a project where only the .hex file is available and it looks like it died out about 2 years ago...if it doesn't work for a software reason, or the software needs a tweak, you are likely to be completely
stuck
 

Teazle

New Member
Thanks for the suggestions; you've given me plenty to follow up.

In answer to Circuit. I've got that oscilloscope and I can't recomend it highly enough. For just a few pounds it is astonishingly good value for money and it's helped me with several projects already. However, there are times when I just want to pick something up to quickly read a few samples. There are also more times when getting our laptop out of Mrs Teazle's clutches is more dangerous than trying to take a juicy bone from the jaws of a hungry bulldog.

If I get the logic analyser working I'll report back.
 

Teazle

New Member
have a look at this, may save you some time ?
I bought one and find it brilliant for the money
Thanks for that, Neil. For that money I may as well just buy one. However, it still needs to be used with a PC so it won't fulfill my (self imposed!) need for something that is standalone. But at that price I'm sure that it would be worth getting....bootlegged or not?!

Thanks for the recomendation.
 

Flenser

Senior Member
There is always the Gabotronics XMega oscilloscope / logic analyser / signal generator
These look great but make sure you check the specs. The cheaper bare bones versions are 3.3V and are NOT 5v tolerant. The versions that come in a case are 5v tolerant.
 

tony_g

Senior Member
just be cautious of the saleae clones from china, the newer software apparently is set to not work with clones in the newer versions, this was made clear in a company statement that they released a little while back.

i recently added a logic analyzer to my tools and decided not to go the ebay route for this, instead i have purchased an ikalogic scanalogic 2.

it cost me about $90 CAD but as its made in france it should work out cheaper for anyone buying over that side of the water, its a nice unit and the winning function that led me to get that instead of a saleae was the fact it can be set for edge based triggers which the saleae analyzers cannot at the moment.

http://www.ikalogic.com/ikalogic-products/scanalogic-2/


tony
 

Armp

Senior Member
just be cautious of the saleae clones from china, the newer software apparently is set to not work with clones in the newer versions
The newer versions from AliExpress are sold simply as 'USB 24Mhz Logic Analyzers', and all versions work with the current 1.1.15 download.

Whether they are 'clones' or 'counterfeit' is another issue - to be discussed elsewhere.
 

hippy

Technical Support
Staff member
the winning function that led me to get that instead of a saleae was the fact it can be set for edge based triggers which the saleae analyzers cannot at the moment.
According to Saleae they do support edge triggering -

http://support.saleae.com/hc/en-us/articles/202739865-Using-the-Trigger

I use an earlier version of the display software (1.0.21) and that allows a sequence of trigger levels for each input so can select 0 then 1 and that will trigger on the rising edge, 1 then 0 for falling edge.
 

tony_g

Senior Member
ah they have finally changed that then, when i asked them if that feature was available prior to deciding between the two they told me that it did not have that feature available yet, that was maybe 3 months ago
 

tony_g

Senior Member
The newer versions from AliExpress are sold simply as 'USB 24Mhz Logic Analyzers', and all versions work with the current 1.1.15 download.

Whether they are 'clones' or 'counterfeit' is another issue - to be discussed elsewhere.
my point to this announcement they made was just to be cautious with buying the cheaper clones, sometimes its easy to forget when the software prompts you that a newer version is available and you hit ok to download and then the newer version stops working with the clone as saleae have said they are going to start doing
 

julianE

Senior Member
I've been dabbling wit GC Basic and it's very impressive, I like it better than the competition.
It's nowhere as well documented as picaxe but not awful either.
I use picaxe equivalent chips, mostly the 08M2 and the 20X2. I have not tried it with atmel chips
since BASCOM is plenty good.
 

Goeytex

Senior Member
I have used it quite a bit in the last year on various PIC micros and it works quite well. It produces assembly code as well as hex and supports several programmers including Pickit 2/3. The compiled code compares speed wise to any C compiler that I have used and seems to be significantly faster than the code produced by Arduino-Pickit-GCC. I cannot say how it does with Atmel but my guess is that it will compare favorably to Arduino-Atmel-GCC.
 

tmfkam

Senior Member
Just been using GCBasic for a project that needed more speed than the 14M2 could quite manage. It does compile well but I much prefer PicAxe basic and the PicAxe IDE. When compiling there is little error checking done and it is all to easy to refer to a constant that has not been declared. No idea how I know that...

The language seems inconsistent too. Compiler directive '#IfDef' statements do not require a 'Then' statement but normal 'If' statements do. Fair enough but should you write:

Code:
#IfDef MyDirective Then
'Do some lines of code here
#EndIf
It is interpreted as:

Code:
#IfDef MyDirectiveThen
'Do some lines of code here
#EndIf
Again, no idea how I know that...

Further, the normal 'If' statement is terminated with 'End If' yet '#IfDef' is terminated with '#EndIf'
 

Janne

Senior Member
About the AVR-programmers. I would advice to buy the official programmer from Atmel. AVRISP v2(around 25€, when I last checked) is a bit more expensive than the cheapest diy-boxes, but it saves a lot of trouble, especially if you want to program parts working with some other voltages besides 5.0V.

-Janne, who first bought / build a few cheap programmers and then bought the good ones :)
 
Top