Been awhile - programming C on Tiny chips with STK500?

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's been awhile and it looks like Atmel's offerings have changed. I've always used Mega88 chips, but am looking for a smaller solution that I can load my 1KB C program onto, with PWM. I only need one PWM channel to switch for a LED light controller and one other pin to use for an input button.

My question is two fold. What is the smallest (pin-wise) chip I can load C programs onto? And what do I need to program these chips on an STK500 (or do I need something else)?

I was looking at tiny9 and tiny13. They say 1KB but I'm still not sure if there are any other issues with loading C on them. One comes in a DIP package, the other an SOT23.

Also, I am using AVRStudio/WinAVR. Still on Version 4 but I see there are updates now.

Thank you in advance for any help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
What is the smallest (pin-wise) chip I can load C programs onto?
You CANNOT load any C programs in any chip, only the resultant hex code. :-)

Edit Nonsense removed, had the wrong chip in mind.

The STK00 can program the PDIP T13, I don't think it can program the 6 pin devices as they use a different programming method.

Quote:
Still on Version 4
Very wise
Quote:
I see there are updates now
maybe NOT so wise. :)

If your version of winAvr supports ANY of the small 6 pin devices (don't know, never used them) then you can program them in C otherwise you can have a pleasant time doing it in assembler. The T13 is programmable in C.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

loading C onto chips.. One can install into flash memory a certain amount of C code text! Indeed, it's uncommon to say I'm downloading my C code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
maybe NOT so wise. :)

"Paranoia strikes deep, into your heart it will creep" :lol:

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Paranoia strikes deep
Maybe true but I can invoice stuff at the end of the month with the "trustworthy", co-operative AS4. :)

Anyway I was more referring to the point that from AS5 onward RS232 tools were NOT going to be supported, then there was a change of mind and the STK500 was supported, maybe reluctantly, so it is possible that the AS6 support for the STK500 is a half or quarter baked affair, who knows.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC, the main reason that some "small" AVRs didn't support C (which is to say, mostly gcc) was that they didn't have any RAM for gcc to put a stack into. Atmel seems to have caught on and started putting at least some RAM into all of their newer chips (the tiny4 has 32 bytes of RAM, even though it was cut to 16 registers.)

Some commercial C compilers (other than gcc) have always supported the RAM-less AVRs. Though I'm not sure exactly how, or with what limitations.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

so it is possible that the AS6 support for the STK500 is a half or quarter baked affair, who knows.

Sounds like FUD to me, John. I can not recall even one report here that the STK500 programming functionality was broken.

ShocKWavE: ATM there are a lot of people in both camps (AS4 and AS6), so you can get help whatever Studio you choose to use. Eventually, the bulk of the users will be on AS6, but if you don't have any pressing reasons to move to AS6 then you can very well stay on AS4 for the time being.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

What is the smallest (pin-wise) chip I can load C programs onto?

Are you talking about DIP or some other packaging. A QFP mega88 for example could easily be smaller than a DIP packaged tiny.

If you can handle SOT-23 then the tiny4/5/9/10 are 6 pin chips. That is about 2.8mm by 2.9mm. If you want to be really adventurous use UDFN packaging which is 2mm by 2mm!

The 4/5 have 512 bytes and the 9/10 1024 bytes of flash.

You didn't mention ADC so the 4 and 9 may be the cheaper choice for you.

Each has 32 bytes of RAM which is enough to program in C (carefully!).

The one possible "gotcha" with these chips is that they use a new programming mechanism called TPI rather than ISP so you need to make sure you have the ability to program them. (the STK500 has not received updated firmware to allow it to do TPI as far as I know).

Note also that ONLY the final release version of AS6 has full working support for these chips so do not think of using any version of AS4, AS5 or early versions of AS6.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some people think that the smaller and cheaper the AVR, the simpler it is to program.

In practice, using the Tiny's USI is far more complex than a mega's USART, SPI, TWI.

Using the Tiny4,5,9,10 is more complex than the Tiny13,25,24 etc.

OTOH, working with the limited SRAM and limited ASM instructions is an interesting challenge.

Debugging with very few pins is also more complex.

It is often simpler to develop your application on a big mega AVR. Then calculate how small an AVR could be used for production. This final 'port' is often very easy. e.g. recompile and run your original test suite.

And yes, the Tiny4's TPI protocol is only supported by a few programmers.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP seemed to be suggesting that physical size was his main driving factor and in the limit I don't think anything beats that 2mm x 2mm package.

But I totally agree - I'd stick with the mega48/88 but just use the smallest SMD available. Only "trade down" if this still isn't small enough.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The OP asked what the "smallest (pin-wise) chip" is.

Sid

Life... is a state of mind

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I can not recall even one report here that the STK500 programming functionality was broken.
But you may recall there NOT being ANY STK500 functionality AT ALL when AS5 was first released as it was not providing support for RS232 tools ie STK500, AVR ISP Mk1, JTAG Ice Mk1 and others.

So are these RS232 tools now fully supported in AS6? I don't know, you may want to illuminate us. :)
I still use the AVR ISP Mk1, the JTAG Ice Mk1 occasionally and 3 keyfob programmers that appear as STK500 when being loaded with code.

edit

Quote:
And as the STK500 does not seem to be supported either I hereby declare my firm conviction that Atmel has shot themselves, but in out feet. Personally I find them being an excellent, sturdy platform well worth it's price. I currently own three of them.

For educational event I have pondered to place STK-500s at the hands of course participants, nothing I would never dare do with e.g a Dragon.

I suppowse this non-support in AS5 means that they are nearing EOL.

I am Disappointed by all this, to say the least.

Oh, well! Nothing lasts forever...

Last edited by JohanEkdahl on Mar 02, 2011 - 02:42 AM; edited 1 time in total

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I still use the AVR ISP Mk1, the JTAG Ice Mk1 occasionally and 3 keyfob programmers that appear as STK500 when being loaded with code.

AS5 and AS6 support genuine STK500 boards. If the keyfobs are good at cloning a STK500, they should work fine.

AVRISP-1 and JTAGICE-1 will never be supported. OTOH, I believe you already own alternative devices.

I would guess that Rowley and IAR will continue to support the JTAGICE-1 even if Atmel does not.

From a programming point of view, all your devices are supported by avrdude.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

But you may recall there NOT being ANY STK500 functionality AT ALL when AS5 was first released as it was not providing support for RS232 tools ie STK500, AVR ISP Mk1, JTAG Ice Mk1 and others.

So are these RS232 tools now fully supported in AS6?


Only the STK-500 as far as I know.

It is now a year or more since AS5/6 got support for the STK-500. During that time I can not recall one single report that the STK-500 support was broken until this thread emerged. I would expect there to be enough users of the STK-500 for us to get those reports by now.

What is your reasoning, John? Since there was no support to begin with, it must now be broken?

(Aside: Interesting quote :wink: . I actually dared use the Dragon in education. No failures - all four survived the course. :D)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
all your devices are supported by avrdude.
Bad language will not be tollerated. :)

Seriously there is absolutley no reason for me in the foreseable future to use anything else but AS4, so it may just be AS4 forever.

Maybe by now ShocKWavE is no longer interested in AVRs or micros anyway. :lol:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ChaunceyGardiner wrote:
The OP asked what the "smallest (pin-wise) chip" is.
Are you saying you know of an AVR with less than the 6 pins of the tiny 4/5/9/10 I already suggested then? :?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for all of the replies. Regarding size, it's the pin count in looking at right now. Ultimately in a production version I'd love those super tiny chips, but I am hand soldering at this point and would also like to stick with my current programmer if it still does the job. I'd like to learn how to deal with those smaller form factors at some point.

So, i'm thinking from what I am reading is that the Tiny13 in a DIP package could be a good one to try.

By the way, I did in fact complete the design on a Mega88. It's just far more than I need for this application, so I'm trying to slim it down.

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A Tiny25/45/85 is a better choice than a Tiny13.

Edit. corrected Tiny88 to Tiny861. If you want practice with USI, develop with a Tiny861 instead of a mega88.

The Tiny4/5/9/10 are quite a bit different to the Tiny13/24/25/261...
Likewise the Tiny20/40. But they do look fun.

There really is little point in using the smallest SMD until you have the project almost completed. And QFN competes with SOIC easily. My soldering skills stop at SOIC or TQFP.

David.

Last Edited: Sat. May 19, 2012 - 07:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
If you want practice with USI, develop with a Tiny88 instead of a mega88.

Well almost any tiny, but the tiny48/88 have SPI and TWI, no USI (says the data sheet, haven't used them myself).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
ChaunceyGardiner wrote:
The OP asked what the "smallest (pin-wise) chip" is.
Are you saying you know of an AVR with less than the 6 pins of the tiny 4/5/9/10 I already suggested then? :?

No, I was pointing out that your interpretation seemed wrong:
clawson wrote:
OP seemed to be suggesting that physical size was his main driving factor and in the limit I don't think anything beats that 2mm x 2mm package.

But I totally agree - I'd stick with the mega48/88 but just use the smallest SMD available. Only "trade down" if this still isn't small enough.

Sid

Life... is a state of mind

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That Tiny25/45/85 line is pretty nice. So many options, I missed those.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks again for the advice. I ended up trying an SOIC Tiny85 (I'll probably end up using the 25 for this). It's a great chip and was an easy port from my Mega88 program. Perfect.