ATtiny10 and STK600 Issues

Go To Last Post
92 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all.

This newbie to Atmel is attempting to program an ATtiny10 using the STK600. Unfortunately, the STK600 documentation is scarce, but JohanEkdahl
pointed out a much newer version on the http://support.atmel.no site.

The help file in AVR Studio4 is a very abbreviated version of that on-line help for the STK600.

Background: Since I'm a newbie to Atmel let me explain what I'm trying to do. I plan to use the PWM offered by the TIny10 to vary the brightness of an LED using button pushes. I originally did this on the PIC10F222 platform and found it simple to use and debug using the PICKit 2 and header. Total investment was $75. It was easy to use, program and debug in both the Low-Pin-Count-Demo-Board and my target breadboard. I want to use the Tiny10 because it has PWM hardware on-board.

I plan to post different problems/issue/successes on this trhead and anyone who has mercy or pity for me is welcome to push/poke/prod me in the right direction.

Thanks for your support.

Bob

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

My AVR Studio4 4.16.628 software is up to date. The Tools->STK600 help file contains 5 pages - that's it. - No help at all.

The STK600 on-line help does not mention TPI programming (I can't search the on-line help so I may have missed it).

I needed to use the ISP interface for TPI - I had to guess that since there is no documentation for it Conclusion: The STK600 is not a newbie platform!

I couldn't read the Tiny10 signature when I tried and an unlabeled green LED went red on the STK-600. Apparently there was a problem - but what?

Trial and error led me to set the clk switch to external. But that's not in the documentation under SBI Programming. The ATTiny10 is not listed in the on-line help file, but was in the AVR Studio version of STK600 help. And I missed the setting of the target voltage - the green LED was not on!

All the above being fixed, I downloaded my first program to the 6-pin ATTiny10!

But wait - LED1 is always on. Hmmm....

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

The Tiny10 has 6 pins - the STK600 has some 200 header pins - most nicely labeled. My LED that seems to be stuck on is actually clocking at 1 MHz. I had to scope it to see it. I removed the SPI header, but no help. I figured this was a bug in my program, so I removed the TIny10. - Hmmm... still on.

I lost a few more hours and finally decided to use AVR Studio4's STK600 connect H/W settings and saw the clock generator interface set at 1 MHz - so I set it to zero and voila! Clock gone - LED out.

My program still had bugs though.

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

Where in the documentation does it tell me that the LEDs are on if the pin is on or off? I mean c'mon guys - I have to measure the pins on the header and jumper one to ground to find that clearing the pin bit turns the led on!

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

I've said it before, I'm a newbie and as you can see I'm running into many issues using the STK600 platform for the ATtiny10 programming.

The more experienced members out there may have been here before and think this thread is untrue/naieve/unwarranted but others may find it helpful. Maybe the tech writers will take pity on me and update the AVR Studio help files with ATtiny10-specific programming instructions. Maybe the ATtiny "preliminary" data sheet tech writers could include Tiny10 specific code examples for the ADC or the PWM. The data sheet was written by folks who know much more than the readers like me. ("The curse of knowledge" problem.)

My experience with the PIC seems to have spoiled me to thinking it is, was, or should be simple to program and run a small 6-pin device. The fact that a $300 STK600 hardware platform investment won't allow on-chip debug seems ridiculous to me.

If you want to hear more on this subject, please let me know. If you think this is not the forum for this, also let me know.

(I don't know where the original version of this went after I added a poll, so here it is again.)

Bob

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

It doesn't look any harder to use the ADC on the Tiny10 than it is on the PIC10. The PWM looks quite straightforward as well. It seems better in some ways than the PWM on some of the bigger devices.

Leon

Leon Heller G1HSM

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

Quote:
My experience with the PIC seems to have spoiled me to thinking it is, was, or should be simple to program and run a small 6-pin device.

But is is simple to do this with the tiny10. It is the STK600 that is complex. It is capable of programming everything from the smallest 8 bit AVR up to the 144 pin 32 bit AVRs. If you had chosen the $35 AVRISP MkII then you would see the simplicity.

Regards,
Steve A.

The Board helps those that help themselves.

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

It doesn't support the Tiny10 (TPI programming), IIRC!

Leon

Leon Heller G1HSM

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

bb56 wrote:
Where in the documentation does it tell me that the LEDs are on if the pin is on or off? I mean c'mon guys - I have to measure the pins on the header and jumper one to ground to find that clearing the pin bit turns the led on!

How about reading the section named LEDs and Switches? http://support.atmel.no/knowledg...
Quote:
LEDs

The LEDs are labeled LED0 to LED7. The corresponding pins on the LEDS header have the same labels.

The LED hardware is shown in the figure below. The transistor circuit ensures the LED brightness is independent of target voltage.

To light one of the LEDs, the corresponding pin found on the LEDs header must be pulled to GND.

To control the LEDs from the AVR, connect a cable between the LEDS header and one of the PORT headers. Use a 10-wire cable to connect to all eight LEDs or a two-wire cable to control one or two LEDs.

Just like the PORT headers, the LEDS header has GND and VTG on pin 9 and 10. When using a 10-wire cable, make sure the pin one indication on the cable (red wire, triangular arraow pointing on pin one) aligns to pin 1 on both the LEDs header and PORT pin header.

The I/O port connected to LEDn will not source any significant current when LEDn is driven high, but it will sink a current of approximately 18mA when LEDn is pulled to GND.

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

leon_heller wrote:
It doesn't support the Tiny10 (TPI programming), IIRC!

Leon

Leon - I believe you are correct. The only platform that supports the ATtiny10 is the STK600.

Maybe there is new information about ATtiny10 support out that I don't know about...? Does anyone else know?

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

bb56 wrote:
My AVR Studio4 4.16.628 software is up to date. The Tools->STK600 help file contains 5 pages - that's it. - No help at all
You know that the little [+] signs in the help tree browser mean that you can click on them to see more information?

Stealing Proteus doesn't make you an engineer.

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

leon_heller wrote:
It doesn't look any harder to use the ADC on the Tiny10 than it is on the PIC10. The PWM looks quite straightforward as well. It seems better in some ways than the PWM on some of the bigger devices.

Leon

Leon - I was under the same impression. I think the PWM code I wrote is working - I think. The timer counts but the LED on PB0 does not vary with the Vref0 signal used as input to ADC2. I must be doing something wrong. Here's a snippet of my code:

StartPWM:	

    ldi   R16,0b10000001
    out   TCCR0A,R16   ; Fast PWM Mode, Clear on OCR0A
    ldi   R16,0b00001100
    out   TCCR0B,R16   ; Used 256 prescaller (256us?)

WaitAD:  
	sbic  ADCSRA,ADSC      ; 
	rjmp  WaitAD	    ; wait until done
	in    ADValue,ADCL  ; Read the result 
	ldi   R16,0         ; zero high byte
        out   OCR0AH,R16    ; Set new PWM Threshhold
        out   OCR0AL,ADValue ; OCR0A = R16

This shows how I set it up and later on use the ADC to change the PWM ratio. If you have example of starting the PWM for output on PB0 - let me know.
Thanks.

Bob

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

Quote:
= AndersAnd - How about reading the section named LEDs and Switches? http://support.atmel.no/knowledg...

Thanks AndersAnd.
Once you pointed me to the complete documentation, I found the LED section. The hard part was having to rely on the forum to find the completed documentation. One interesting note is that the section on device support lacks the ATtiny10 entry that is in AVR Studio help version.

When I do a search on Atmel.com - the results are incomplete, showing the same 5 pages as the AVR Studio4 help page. Of course, my frustration probably blinded me from looking further.

Thanks much for the support.

Bob

Last Edited: Mon. May 25, 2009 - 07:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArnoldB wrote:
bb56 wrote:
My AVR Studio4 4.16.628 software is up to date. The Tools->STK600 help file contains 5 pages - that's it. - No help at all
You know that the little [+] signs in the help tree browser mean that you can click on them to see more information?

Yes ArnoldB - thanks. The AVRStudio help menu contains 2 line items - Tools User and Studio User guides. Neither one has [+] signs. Only the support.atmel.no site has the complete version with the [+] tabs - which work well. I just didn't know about the complete version on the support site. When I searched Google for "STK600 user guide manual" the closest I got was: Http://support.atmel.no/knowledgebase/avr32studiohelp/com.atmel.avr32.tool.stk600/html/stk600.html - which contain the same 5 pages. AndersAnd really helped me out by pointing to the real one.

Only issue is that I can't search it. It would be nice to have a pdf version of the complete STK600 user manual. The AVR Technical Library CD that came with the STK600 Starter Kit [July 2008] had no STK600 documentation on it - it didn't even mention the 600 on the AVR menu. No other documentation came with it, no other CDs. [P/N# ASTK600]

Bob

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

bb56 wrote:
I needed to use the ISP interface for TPI - I had to guess that since there is no documentation for it

So how shuld the ATtiny10 TPI programming interface be hooked up to the STK600 ISP interface?
Like shown below?

STK600 ISP to ATtiny10 TPI
/RESET -> /RESET
SCK -> TPICLK
MOSI <-> TPIDATA

Please note the ATtiny10 can only be programed at 5V according to the datasheet: http://www.atmel.com/dyn/resourc...

Quote:
14.2 Overview
...
Programming is done via the physical interface. This is a 3-pin interface, which uses the /RESET pin as enable, the TPICLK pin as the clock input, and the TPIDATA pin as data input and output.

NVM can be programmed at 5V, only.

Last Edited: Mon. May 25, 2009 - 08:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

My AVR Studio4 4.16.628 software is up to date.

Err no, 4.16.638 is the latest - you haven't applied SP1 yet. In this the STK600 help is:

24/04/2009  10:02         1,423,930 STK600.chm

There's a few more than 5 pages in that 1.4MB file. Section 5.6 covers TPI programming using the STK600

SP1 is on this page:

http://www.atmel.no/beta_ware/

(the Tiny10 + TPI are very, very new and hence the reason why this was only available in the last few weeks - to be honest I think you picked the wrong AVR to start with - but I guess you weren't to know)

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

clawson wrote:
SP1 is on this page:

http://www.atmel.no/beta_ware/


Yu don't have to go to the beta site to download AVR Studio 4.16 SP1 (build 638), it's now avaiable as a non beta here: http://www.atmel.com/dyn/product...

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

Thanks Clawson.
Each time I open up Studio, I ask it to check for updates - it says I'm up to date at 4.16.628. So I didn't know about .638 at all.

Indeed, the full help file is on my computer! When I installed the STK600 I only found the AVR studio version - I did not look in the help folder for a separate file. As a matter of fact, I don't know any other way to find it except go directly to the help file you pointed out - Thanks!

As to your other point, I probably did start with the wrong part (too early in its life), but the price point and features sold me. The sticker shock of the development platform and the user experience has sort of taken away the shine.

I really hope this thread will help others who start with the ATtiny10.

Well...off I go to see about SP1 and what it offers. It's in the beta_ware folder? ...and the cheshire cat just disappeared again...

Update: I see AndersAnd posted the non-Beta - I'll go there instead.

Bob

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

Quote:

The sticker shock of the development platform

Although certainly not painless, the respondent in the "other" thread had virtually no outlay to work with the Tiny10 having used a small AVR to implement the TPI. (Admittedly that is for programming; I guess if you absolutely needed a debugger there aren't a lot of choices. As full disclosure, I don't rely on debuggers as an integral/crucial part of my development process.)

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Maybe using the new atmel stk600 and the new tiny10 to learn avrs is not the cleanest learning curve. Maybe using an stk500 and a mega32 would be easier. I have used several flavors of mega avrs last couple of years programming them with jtags, isps, parallel port programmers, and dragons, BUT I've never used a tinyavr for anything, and I dont know anything about debugwire or source level debuggers, so even tho I consider myself an 'expert' avr user, you seem to have lucked onto three subjects that just arent in my repetoire. Sorry I couldnt be more help.

Imagecraft compiler user

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

I'd be inclined to write some code to program it via a PC parallel port if I was using them, having used SP12 for some time in the past with 2313 and 8515 chips.

Leon

Leon Heller G1HSM

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

theusch wrote:
Quote:

The sticker shock of the development platform

I guess if you absolutely needed a debugger there aren't a lot of choices.
Lee

Thanks Lee.

I didn't think I needed a debugger either, but I'm new to the assembler code and unsure if I'm setting things up correctly. So I figure the more tools (i.e. debugger) the better.
You're right though, the only development platform (STK600) has no debug capability, so I'm working with the sim. Unfortunately, I have yet to put in stimuli that pushes a button and changes the Vref0. That's another learning curve. So I chose to run it on the Tiny and watch the LEDs.

I modify my delays in the code so the sim runs a little better, but still no luck in identifying what the PWM output is doing on PB0. It doesn't do anything on the STK600 LED but I should be able to find out what's going on using the sim.

Wish me luck!
Bob

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

AndersAnd wrote:
bb56 wrote:
I needed to use the ISP interface for TPI - I had to guess that since there is no documentation for it

So how shuld the ATtiny10 TPI programming interface be hooked up to the STK600 ISP interface?
Like shown below?

STK600 ISP to ATtiny10 TPI
/RESET -> /RESET
SCK -> TPICLK
MOSI <-> TPIDATA

Please note the ATtiny10 can only be programed at 5V according to the datasheet

The STK600 has a specific ATtiny10 adapter that simply bolts on to the STK600 motherboard. I used the two 6-pin ISP/PDI jumper to carry the clock/data/reset signals shown in the STK600 User help section 5.6 TPI Programming. There is a note that TPI is only supported on-board - no external board connection through the TPI interface.

I learned about the 5.0 Volt requirement after a few tries and help from the local AFE.

Hope this answers the question AndersAnd.

Bob

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

bb56 wrote:
The STK600 has a specific ATtiny10 adapter that simply bolts on to the STK600 motherboard.

Thanks, where di you get the STK600-ATTINY10 socket board? Did it come directly from Atmel with the ATtiny10 samples or did you buy it from a distibutor?

bb56 wrote:
There is a note that TPI is only supported on-board - no external board connection through the TPI interface.

It should be possible to make an adpater to make is possible to prgram ATtiny10 externally.
What are the PCB traces on the STK600-ATTINY10 socket card? Is there any extra components besides the ATtiny10?
Atmel has an application note named AVR600: STK600 Expansion, routing and socket boards http://www.atmel.com/dyn/resourc...
This application note has information so it should be possible to make your own expansion, routing and socket boards.

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

Quote:

You're right though, the only development platform (STK600) has no debug capability, so I'm working with the sim.

As I said previously even if you had Atmel's most fully featured debugging system (the AVR One!) it would not help in the slightest with Tiny10 development as the Tiny10 does NOT have an On Chip Debug interface (neither debugWire nor JTAG). It would take an act of God for you to be able to debug a Tiny10 in silicon rather than just the simulator (so let's hope they've got this one's simulation a bit more accurate than some of the devices or you are heading off up wotsit creek without a paddle)

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

The best way to provide debugging for a chip like the Tiny10 is to emulate it with a larger micro. MicroChip did this with the 10F222 and it worked great.

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

One can, of course, do that oneself - as the AVRs are all very similar - do your development work on one that is debuggable (48/88/168 PA all have most of the modern goodies) then just port the code to the non-debug model when you are happy with it. Not quite the same as the uChip thing but it'll get you close.

That's when the STK600 comes into it's own as it's very easy to switch around between various AVRs. Here's a link I just posted elsewhere that shows me doing it:

http://www.youtube.com/watch?v=Y...

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

AndersAnd wrote:

Atmel has an application note named AVR600: STK600 Expansion, routing and socket boards http://www.atmel.com/dyn/resourc...
This application note has information so it should be possible to make your own expansion, routing and socket boards.

Yes I saw the App note. The Tiny10 adapter has very few traces (expected) and there are two SOT-23-6 chips that appear to be Voltage regulators with Markings Z57D and Z58D.

I'm still stuck on getting the PWM output out of PB0 so I haven't spend time looking over the traces on the card. The Sim seems to work intermittently showing the PWM should be working but the chip doesn't exhibit PWM output at all. Still working on it though.

Bob

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

bb56 wrote:
AndersAnd wrote:

Atmel has an application note named AVR600: STK600 Expansion, routing and socket boards http://www.atmel.com/dyn/resourc...
This application note has information so it should be possible to make your own expansion, routing and socket boards.

Yes I saw the App note. The Tiny10 adapter has very few traces (expected) and there are two SOT-23-6 chips that appear to be Voltage regulators with Markings Z57D and Z58D.

I could also be logic gates for the ID System explained in section 5 of AVR600. But then again 2-input logic gates would pobably oly be in 5-pin SOT23-5 packages.
What connector pins do they connect to?
I tried to google Z57D and Z58D and it ooks like it's Fairchild components.

Where did you get the STK600-ATTINY10 board?

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

Can you give a spec for the program? So far I assume you have one or two input buttons and a pwm out... press and hold to count pwm level up or down on the inputs one count per 500ms? What freq pwm do you need? Just enough for an led? So you can just have a timer compare interrupt and a counter and turn the output off at counter=0 and turn it on when counter=pwm level? Imagecraft has a c compiler for the tiny avrs... I assume it uses the regs as 32 dedicated vars... but I figured I'd try to use that if I needed to program a tiny instead of learning Yet Another Assembly Language.

Imagecraft compiler user

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

bobgardner wrote:
Imagecraft has a c compiler for the tiny avrs... I assume it uses the regs as 32 dedicated vars... but I figured I'd try to use that if I needed to program a tiny instead of learning Yet Another Assembly Language.

The Imagecraft AVR C compiler does not support ATtiny10 (maybe some future relase will or maybe not?): http://www.imagecraft.com

The newest versions of CodeVisionAVR does however support ATtiny10: http://www.hpinfotech.ro

Quote:
CodeVisionAVR V2.04.1

Now with enhanced IDE, Vista 64bit, ATxmega and reduced core (ATtiny10) support

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

Looks like the tiny10 is 'reduced core'... it only has regs 16-31. So you could take the imagecraft tiny compiler and write a program that doesnt use more than 16 regs and Bob's Yer Uncle.

Imagecraft compiler user

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

Why would I do that, when Pavel is >>already<< my "Uncle"? :twisted:

Lee

[I don't have the little beasties in hand, but I exercised CV on a few test programs for the Tiny10 and it seemed to work out OK. Given the code generation model the CV loses the obvious due to no "low" registers: "bit" variables and "global register" variables.]

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

bobgardner wrote:
Can you give a spec for the program? So far I assume you have one or two input buttons and a pwm out... press and hold to count pwm level up or down on the inputs one count per 500ms? What freq pwm do you need? Just enough for an led?

Thanks BobGardner.
Your assumptions are correct - press and hold to increment or decrement using a single button. The new value is used to feed the OCR0A (Output Compare register)so that the pin reflects the PWM duty cycle. I use 1MHz fclk with prescale=8. This gets me about 488 Hz period in fastPWM mode. I can see the correct period, but the pulse width is 8 uS which is essentially a count of 1 - no matter what I put in OCRA0L - I'm stuck at the moment trying to understand the data sheet page 65.

Bob

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

AndersAnd wrote:

I tried to google Z57D and Z58D and it ooks like it's Fairchild components.

Where did you get the STK600-ATTINY10 board?

I also saw a google result that appeared to be a 2.5 volt regulator, but didn't follow up - no time at the moment.

The Tiny10 Adapter card also came from my local distributor when I got the STK600.

Bob

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

clawson wrote:
One can, of course, do that oneself - as the AVRs are all very similar - do your development work on one that is debuggable (48/88/168 PA all have most of the modern goodies) then just port the code to the non-debug model when you are happy with it. Not quite the same as the uChip thing but it'll get you close.

That's when the STK600 comes into it's own as it's very easy to switch around between various AVRs. Here's a link I just posted elsewhere that shows me doing it:

http://www.youtube.com/watch?v=Y...

Thanks Clawson - I saw the STK600 adapter card video, but I've used example code from other AVRs as a guide, and the registers and bit names appear to be quite different. Not straightforward to port, so I prefer to go native with the ATtiny10.

The biggest pain with the STK600 is that I have to remove all my IO pin jumpers each time I program it. With 4 pins available - 3 need TPI connections to program and I need to remove the loads. I also have to turn the clock off because PB0 is always clocking if I leave it on - so it takes several manual steps to program the chip - this slows me down and is error prone. Overall, it is big and clunky for programming a 6-pin chip (IMO)- especially so when it doesn;t offer debug.

Bob

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

Hi All,
Making progress finally (you all knew it had to be me - right?)

PWM is running - I had it set up correctly, but my code that loaded the new OCR0AL value never executed.

My code worked in the Simulator, but using the Sim, I had to set the pushbutton manually by setting a pin low. To make a long story short, my pushbutton is on PB3 - the ~RESET pin. When I set it low in the Sim, there is no reset during the simulation, so my code executed correctly.

On the STK600, the chip went into reset. I had to set the RSTDISBL bit in the 'Fuses" tab of the STK600 connect dialog box to inhibit the reset.

It took a long time to figure out why it worked in the sim and not on the STK600.

So chalk it up to "Newbie error" - it's working and so is the ADC code. Now on to the original mission...

Anyone know where to find the Programmer's Reference Manual with has details on instruction execution - like which flags set under what conditions? The ATtiny10 Data Sheet has only Instruction Set Summary

Cheers,

Bob

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

Quote:

Anyone know where to find the Programmer's Reference Manual

Help in AVRStudio is handy if you have it open.

Otherwise, "AVR Instruction Set" doc0856 off of this page:
http://www.atmel.com/dyn/product...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Just to note that it's also the third PDF link from the bottom of the Tiny10 page:

http://www.atmel.com/dyn/product...

;-)

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

theusch wrote:
Quote:

The sticker shock of the development platform

Although certainly not painless, the respondent in the "other" thread had virtually no outlay to work with the Tiny10 having used a small AVR to implement the TPI. (Admittedly that is for programming; I guess if you absolutely needed a debugger there aren't a lot of choices. As full disclosure, I don't rely on debuggers as an integral/crucial part of my development process.)

Lee

Theusch I've tried searching for this thread but haven't been successful. Do you happen to have a link handy? I was planning on modifying a usbtinyisp to program the tiny10 but didn't get around to it, so if someone else has already done the work... =)

-Bob

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

Could be this one
https://www.avrfreaks.net/index.p...

I just used search in the top , and entered : tiny10 tpi
Then i ticked "search for all terms" , and on the search button ... voila.

/Bingo

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

Bob since you are a privileged person with a Tiny10 you may want to test Yet Another Flashing Led program. The attached program is in my usual format for other chips but had to add another macro to decrement Y as there is no SBIW instruction for the T10.

Seems to be all working in the simulator. (8MHZ clock)

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

John,

I put the code onto the Tiny10 in the STK600. It works!

One interesting observation - the code looks like it should be blinking at 1Hz, but the LED is on for ~4 seconds, off for ~3.5 seconds. I have long blink times with my code as well.

I like the modularity of your code - I learned something about breaking it up into modules - thanks.

Bob

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

Quote:

One interesting observation - the code looks like it should be blinking at 1Hz, but the LED is on for ~4 seconds, off for ~3.5 seconds. I have long blink times with my code as well.

Does the chip have a CLKDIV8 fuse by any chance?

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

The STK600 'Fuses" tab only lists CKOUT, WDTON, RSTDISABL fuses - none of which are checked as on after reading them.
The preliminary dat sheet does not mention CLKDIV8 (I searched the pdf). The system clock defaults to fosc/8 (see pg 22) on reset. So it would need to be changed in the code by setting CLKMSR to 0 (internal 8MHz clock) and CLKPS[3:0] to zero to get 8Mhz.

Interestingly, AVR Sym2 shows fosc as 8.0000Mhz, and the 500ms wait loop takes 500190.75us to execute.

Bob

Last Edited: Fri. May 29, 2009 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Johns program doesn't change the CLKPSR register (page 21, section 6.5.2 of the datasheet), so the clock prescaler is set to divide by 8.

Felipe Maimon

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

Update:

I changed the internal clock to use 8.0MHz using the following code:

	ldi		temp,0xD8
	out		CCP,temp
	ldi		temp,0x00
	out		CLKPSR,temp		;set clock to 8MHz

Now the LED blinks at ~1Hz. Since this appears to affect my code, I obviously read the clock description wrong. I thought a 1Mhz clock would deliver a 1uS single instruction time. The Simulator shows my 1 MS delay routine taking 999 uS using 1053 clock cycles and a system clock of 1 Mhz.

Working on it...

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

Hi Bob

The basic AVR does do 1 cycle per instruction.
But, most jumps execute 2 instructions if branch taken.

Also, compared to PIC processor specs, AVR doe not have tight tolerance on the processor speed (+10% factory AVr, I tihnk it might be 1% factory on PIC but I haven't actually used one).

So--even if you count your cycles correctly, it still wont match reality.
Clock input will solve the problem, but you lose 25% of your IO to do it!

As the "other respondant" on Tiny10, I am pleased that someone could get hold of tools for using Tiny10 properly. Here the UK, town of Southampton, my usual distributor doesn't have STK600 Tiny10 adaptor.

Suggestion for programing: If all your outputs and inputs get put through a resistor, you shouldn't need to disconnect programmer from your "real" circuit. But LEDs will flash during programming etc...

Brett

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

It's 1% on PICs with precision internal oscillators (most of the newer ones, including the PIC10). They are factory-trimmed.

Leon

Leon Heller G1HSM

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

Quote:

It's 1% on PICs with precision internal oscillators

It's 1% on Xmegas.

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

Obviously there is scope for improvement on Atmel's side (ie the FT232R needs no crystal input yet meets USB tolerance)... but the OSCCAL register can be used to get about 1% accurate.

Conclusion:
Simulator doesn't always match reality (but it is quite close).

Hence the reason for getting the real parts and trying them out on a test board :-)

Pages