Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
patrickj
PostPosted: Mar 16, 2010 - 05:00 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


Best,

I'm new with the AVR. I already have some projects done with the 8051. After reading a lot of tutorials, I can't fix this problem;

I'm using a attiny13a, program it directly with a jtag-usb cable. Programming the device isn't a problem; i can program and verify succesfully.

The program I want to start with;

;My Very First AVR Project
.include "tn13Adef.inc" ;Includes the 8515 definitions file
.def Temp = R16 ;Gives "Defines" Register R16 the name Temp
.org 0x0000 ;Places the following code from address 0x0000
rjmp RESET ;Take a Relative Jump to the RESET Label
RESET: ;Reset Label
ldi Temp, 0xFF ;Store 255 in R16 (Since we have defined R16 = Temp)
out PORTB, Temp ;Write all highs (255 decimal) to PORTB
rjmp reset ;Take a relative jump to the Loop label

(this is coppied from one of the tutorials)

After programming this file in the tiny. nothing happens with portb.

Reset is high (by r/c circuit)

Do I make a stuppid mistake?

Hopefully somebody can help me with this problem!
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 16, 2010 - 05:03 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 33138
Location: (using avr-gcc in) Finchingfield, Essex, England

That code does not set DDRB so PORTB is an input (and after the write of 0xFF an input with pull-ups all turned on). Try adding code to also write 0xFF to DDRB too.

As this has NOTHING to do with GCC I'll move this to AVR Forum

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 16, 2010 - 05:17 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


I rewrite the code after your advice;

;My Very First AVR Project

.include "tn13Adef.inc" ;Includes the 8515 definitions file
.def Temp = R16 ;Gives "Defines" Register R16 the name Temp
.org 0x0000 ;Places the following code from address 0x0000
rjmp RESET ;Take a Relative Jump to the RESET Label
RESET: ;Reset Label
ldi Temp, 0xFF ;Store 255 in R16 (Since we have defined R16 = Temp)
out DDRB, Temp ;Store this value in The PORTB Data direction Register
out PORTB, Temp ;Write all highs (255 decimal) to PORTB
rjmp RESET ;Take a relative jump to the RESET label

Despite this is giving any change..
Does somebody have any idea what goes wrong?
 
 View user's profile Send private message  
Reply with quote Back to top
Torby
PostPosted: Mar 16, 2010 - 06:00 PM
Resident


Joined: Nov 11, 2003
Posts: 909
Location: Chicago Illinois USA

Your program doesn't work when you first burn it into the chip? You're in good company.

Let's see, what are you expecting it to do? Looks like it sets all the port B pins high. Maybe you want to:

Code:

.include "tn13Adef.inc" ;Includes the 8515 definitions file
.def Temp = R16 ;Gives "Defines" Register R16 the name Temp
.org 0x0000 ;Places the following code from address 0x0000
rjmp RESET ;Take a Relative Jump to the RESET Label
RESET: ;Reset Label
ldi Temp, 0xFF ;Store 255 in R16 (Since we have defined R16 = Temp)
out DDRB, Temp ;Store this value in The PORTB Data direction Register
ldi Temp, 0xA5
out PORTB, Temp ;Write all highs (255 decimal) to PORTB
rjmp RESET ;Take a relative jump to the RESET label



This will set some pins high and some low.

_________________
Thank you, you useless reptile!
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
patrickj
PostPosted: Mar 16, 2010 - 06:12 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


I program the code you suggest above.
Again, build oke, progam en verify oke.
And again every output is low... (except Vcc and reset ofcourse.)

Do I need to place pullup resistor at the output? I measure the output with a probe on a scope.

Is it possible that you send me the hex file? Mayby mij avr studio isn't working propperly.

Thanks for now!
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 16, 2010 - 09:42 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Don't be afraif of using spaces so that you code doesn't look like a forest and the trees cannot be seen.

Format your code and use the CODE button before and after pasting the code to keep that format.

Not a very good idea to loop back to reset.
Code:
;My Very First AVR Project

.include "tn13Adef.inc"   ;Includes the Tiny13A definitions file

.def Temp = R16       ;Gives "Defines" Register R16 the name Temp

.org 0x0000          ;Places the following code from address 0x0000

   rjmp   RESET       ;Take a Relative Jump to the RESET Label

RESET:                ;Reset Label
   ldi Temp, 0xFF       ;Store 255 in R16 (Since we have defined R16 = Temp)
   out DDRB, Temp       ;Store this value in The PORTB Data direction Register
   out PORTB, Temp    ;Write all highs (255 decimal) to PORTB

;   rjmp reset          ;Take a relative jump to the Loop label

loop:
   rjmp loop          ;Take a relative jump to the Loop
This works in the simulator so it must work on the chip if you are doing everything correctly.

Assemble the above and try it out, maybe you reprogrammed the bad hex file into the chip??

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
KillerSpud
PostPosted: Mar 17, 2010 - 03:21 AM
Hangaround


Joined: Sep 20, 2008
Posts: 132


maybe something is wrong with the fuses? Try reading them and check the data sheet for what they should be.

_________________
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-- Douglas Adams
 
 View user's profile Send private message  
Reply with quote Back to top
lurcher
PostPosted: Mar 17, 2010 - 08:25 AM
Rookie


Joined: Nov 06, 2009
Posts: 21


have you got a clock source set in the fuses?
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 17, 2010 - 01:56 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


I tried the code "js" suggest. Program oke, verify oke. and again nothing happens with the pins.

I made a screenshot how the fuses are configurated; http://foto-uploaden.nl/zie/7ubqev5 (this looks allright to me)

I programm the uC directly with a Digilent jtag cable (http://www.digilentinc.com/Data/Products/AVR-SOFTWARE/AVR%20Programmer%20Reference%20Manual.pdf)

Could somebody send me a hex file of the code "js" suggest. Mayby my assembler doesn't work properly...?

EAGLE; http://foto-uploaden.nl/zie/ftxhelg


Last edited by patrickj on Mar 17, 2010 - 02:01 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
Simonetta
PostPosted: Mar 17, 2010 - 01:57 PM
Resident


Joined: Mar 12, 2003
Posts: 620
Location: Portland, Oregon USA

I'm not sure how this program could be tested. The result of the program is identical to the state of the processor (at power-up) without having run the program.

The ports read all at VCC at power-up in the factory state. The program sets the DDR to all outputs and sets the outputs high, which is also VCC. The only way to test between an input port and an output port that is set high is to test how much current can be drawn from the port pin. An input port has both CMOS transistors turned off so a 1K resistor to ground from the port pin should read 0 volts at the pin if it is an input. If the pin is an output, then a 1K resistor to ground should read nearly VCC at the port pin. (if I'm not mistaken, I've never done this).
Try outputting all zeros on the output pins.
Is there a crystal connected? The Tiny13 can't be run with a crystal.
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 17, 2010 - 02:25 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


I measure with the resistor; 0 Volts. I doesn't change when I programm the port high/low. I don't use an external xtal.
 
 View user's profile Send private message  
Reply with quote Back to top
Torby
PostPosted: Mar 17, 2010 - 03:36 PM
Resident


Joined: Nov 11, 2003
Posts: 909
Location: Chicago Illinois USA

Make sure your programmer is putting the hex file you think it is into the chip. Scratched my head all afternoon over that once, wasn't running the code I was editing.

_________________
Thank you, you useless reptile!
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
patrickj
PostPosted: Mar 17, 2010 - 03:58 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


Trust me, I checked a few times if I got the right .hex file. so that isn't the problem.

Could somebody be so nice to make the hex file "js" suggest, so I can see if the problem isn't the avr guide assembler.
 
 View user's profile Send private message  
Reply with quote Back to top
Simonetta
PostPosted: Mar 17, 2010 - 09:05 PM
Resident


Joined: Mar 12, 2003
Posts: 620
Location: Portland, Oregon USA

You might try this variation of your code:

Code:

;My Very First AVR Project

.include "tn13Adef.inc"   ;Includes the Tiny13A definitions file

.def Temp = R16       ;Gives "Defines" Register R16 the name Temp

.org 0x0000         
RESET:             
   ldi Temp, 0xFF       ;Store 255 in R16 (Since we have defined R16 = Temp)
   out DDRB, Temp       ;Store this value in The PORTB Data direction Register

loop:
    out portb, 0x00
    nop
    nop
    out portb, 0xff
    rjmp loop         


This toggles the portB pins very fast (six system clocks per toggle). With an oscilloscope, the pins will toggle at about 150Khz (if the clock divide_by_8 fuse is at factory default) and display a 75KHz square wave. With a regular volt/ohm meter, the pins will read 1/2 VCC or +2.5 volts.
This will give an indication that the program is working.
By the way, since there are no interrupts running, the RJMP RESET instruction isn't needed. The program can be loaded into flash address 0000.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 17, 2010 - 09:11 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Quote:
Could somebody be so nice to make the hex file "js" suggest,
How about you post the hex file you have and we check it? Have you run the code in the simulator?

edit Simonetta how can you do "out portb, 0x00" or "out portb, 0xff"?

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
patrickj
PostPosted: Mar 17, 2010 - 09:25 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


The code "js" suggest wich I have build, simulated succesfull.

hex file;
http://www.megaupload.com/?d=LPA4OTIF
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 17, 2010 - 09:37 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

You can simply post it here like you did above. The other site is full of rubbish.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
thygate
PostPosted: Mar 18, 2010 - 12:15 AM
Hangaround


Joined: Sep 19, 2005
Posts: 149
Location: Belgium

The OP's hex file
Code:
[test3.hex]
:020000020000FC
:0A00000000C00FEF07BB08BBFFCFE5
:00000001FF

[disassembled]
00000000:   C000        RJMP      PC+0x0001      Relative jump
+00000001:   EF0F        SER       R16            Set Register
+00000002:   BB07        OUT       0x17,R16       Out to I/O location
+00000003:   BB08        OUT       0x18,R16       Out to I/O location
+00000004:   CFFF        RJMP      PC-0x0000      Relative jump

[tn13Adef.inc]
.equ   PORTB   = 0x18
.equ   DDRB   = 0x17

should and does set DDRB and PORTB to 0xff in the simulator.

The problem is elsewhere.

Checking the fuses..
CKSEL1:0 = 10 - 9.6 MHz RC
CKDIV8 = 0 - Divide clock enabled
SPIEN = 0 - SPI Programming enabled
BODLEVEL1:0 = 11 - BOD disabled
DWEN = 1 - DebugWire disabled
RSTDISBL = 1 - Reset enabled

Also not the problem.

Since you can program and verify, try putting the chip on a breadboard, and connect ONLY the following : Vcc and PB5(/RESET) directly to +5V and GND to GND.
Try measuring again to see if the IO Lines are high.

Or if you have a scope, try Simonetta's suggestion, so you can determine with certainty that what you programmed is what you measure.

so this code :
Code:
.include "tn13Adef.inc"

.org 0x0000

reset:           
   ser R16
   out DDRB, r16

loop:
    out PORTB, R17
    nop
    nop
    out PORTB, R16
    nop
    rjmp loop

Simonetta: Shouldn't there be an extra nop (see above) to get a 50% duty cycle, or does the rjmp take more than one clock cycle ?
I thought this would give a ~200kHz square wave for a 9.6Mhz clock and CKDIV8 enabled (9.6/8/(3*2))?
It's probably too late and i'm missing something


Last edited by thygate on Mar 18, 2010 - 02:45 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
Koshchi
PostPosted: Mar 18, 2010 - 02:31 AM
Raving lunatic


Joined: Nov 17, 2004
Posts: 9102
Location: Vancouver, BC

Quote:
or does the rjmp take more than one clock cycle ?

RJMP takes 2 clocks. I agree with the 200kHz.

_________________
Regards,
Steve A.

The Board helps those that help themselves.
wylfwt?
 
 View user's profile Send private message  
Reply with quote Back to top
thygate
PostPosted: Mar 18, 2010 - 02:48 AM
Hangaround


Joined: Sep 19, 2005
Posts: 149
Location: Belgium

Quote:
RJMP takes 2 clocks. I agree with the 200kHz.


I didn't know that. Thanks for the heads up.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 18, 2010 - 07:01 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

So I guess the next suspect thing could be the multimeter. Confused Does it read 5V between pin 4 and 8?ie is it not set in the AC range?

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Simonetta
PostPosted: Mar 18, 2010 - 04:15 PM
Resident


Joined: Mar 12, 2003
Posts: 620
Location: Portland, Oregon USA

" edit Simonetta how can you do "out portb, 0x00" or "out portb, 0xff"? "

Good point. I've done assembly language in at least six different processors/controllers and they all seem to be the same at this point. I really should convert to C but I don't like having the extra layer of separation or disconnection between the algorithm and the silicon. Programming in C can be like threading a needle with dark sunglasses on. Especially when trying to do a complex debug with the optimizer on.

The code should be to load a register with a fixed value and then transfer the register's contents to the port.

I only get to steal a few minutes at a time from my desk job to comment on AVRfreaks topics. My comments and suggestions aren't a moon shot calculation or a doctoral thesis defense.

I think that there should be a section here of canned super-simple beginning programs that newbies can stuff into new 'factory-sealed' AVRs to get a feel of how both the program works and how to compile/assemble/load/run process. Start with an alternating off/on pin pattern on a port. Continue with a blinking LED and advance all the way to a 'Hello World' transmitted to a PC serial port. There would be series of different programs and hex files for the various popular device types. Also a detailed description of everything possible that could be and is going wrong. The learning situation now is a lot better than it used to be in the pre-internet days. I remember going years without being able to get answers to relatively simple problems and situations. Sometimes I would just switch processor types and start over from scratch. But now we can put a description of the problem on a focused website and get a dozen suggestions quickly. They may not be all exactly correct (like mine), but they do 'kick-start' the debug process and keep the project alive.
I've often wondered at how this microcontroller industry could have grown when every person doing anything with MCUs feels like they are the only person in the world doing it. The manufacturers just throw the chips and the datasheets out in the market and hope that someone finds something to do with them and buys 100000 at a time. At community college in the 1980s, a 2-year electronics tech program might have had an introduction to Z80 or the 8088 CPU. An overview of the instruction set and a few lab assignments to blink an LED or create a triangle waveform with a DAC if they had an in-circuit emulator available. Exposure to 8088 assembly language and its surrealistic family of peripheral chips is enough to make any reasonable person go become a plumber. But chip freaks are rarely 'reasonable persons', which is really good for the electronics industry. Yeah, things are better now and will continue to keep on getting better. At least we don't have to put EPROM chips out in the bright sunshine for several days to erase their internal programs any more!
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 18, 2010 - 04:40 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 33138
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

doing anything with MCUs feels like they are the only person in the world doing it.

Do you think the 132,000+ members of this message board think they are alone?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 18, 2010 - 06:35 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


I found the problem; the flash memory of the tiny13a is too smal. The tiny has 1024 and the file "js" suggest already needs 1066.

I tried with a atmega644 from a friend of mine, and it works perfectly. The ports get high!!! Smile

It's weard that a small file like "js" suggest generates such big hex file. That should mean the program I want to run on the tiny needs to be very very very small.

Is there a way to shrink my hex file or something so I can program bigger files into the tiny?

Thanks for all the help!!!!
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 18, 2010 - 07:26 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 33138
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

I found the problem; the flash memory of the tiny13a is too smal. The tiny has 1024 and the file "js" suggest already needs 1066.

Unbelievable - post the .hex fies that is 1066 bytes long so we can dis-assemble it and find out what you did wrong.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 18, 2010 - 08:05 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


The hex file clawson request.
http://www.2shared.com/file/12211912/3a ... test3.html

ponyprog said its 1088 bytes.

I can't find any other reason why the tiny doesn't work and the atmega works fine...
 
 View user's profile Send private message  
Reply with quote Back to top
Koshchi
PostPosted: Mar 18, 2010 - 08:06 PM
Raving lunatic


Joined: Nov 17, 2004
Posts: 9102
Location: Vancouver, BC

When I assemble js's code, I get a hex file of 63 bytes (which is the same size as the one you posted a link to), with flash usage only 10 bytes.

And please stop posting these files on bullshit sites that are designed to sell you crap you don't need. Just post it here.

_________________
Regards,
Steve A.

The Board helps those that help themselves.
wylfwt?
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 18, 2010 - 09:28 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Quote:
The ports get high!!!
It seems like you do at times too. Smile

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
thygate
PostPosted: Mar 18, 2010 - 11:17 PM
Hangaround


Joined: Sep 19, 2005
Posts: 149
Location: Belgium

The hex file again :
And indeed OP, please just open the hex file in any text editor and copy paste the contents here in the forum.

Code:
:020000020000FC
:0A00000000C00FEF07BB08BBFFCFE5
:00000001FF

[disassembled]
0000000:   C000        RJMP      PC+0x0001      Relative jump
+00000001:   EF0F        SER       R16            Set Register
+00000002:   BB07        OUT       0x17,R16       Out to I/O location
+00000003:   BB08        OUT       0x18,R16       Out to I/O location
+00000004:   CFFF        RJMP      PC-0x0000      Relative jump


I count just 10 bytes of code.
The ASCII coded hex file is 63 bytes, but it is not the code size!

Come on, use some common sense, people here have fitted hordes of elephants in this chip, and you can't even fit in a program that sets one output ?

Please, Post the command line parameters you use with ponyprog to program the chip.
 
 View user's profile Send private message  
Reply with quote Back to top
thygate
PostPosted: Mar 20, 2010 - 11:40 PM
Hangaround


Joined: Sep 19, 2005
Posts: 149
Location: Belgium

Ok, maybe i came over a bit strong,.. since you're only just beginning to experiment with this.

The program is just 10 out of 1024 bytes of available flash on that chip. It has to fit and work.

It's now obvious that your problem lies somewhere in the programming of the chip. Post the details on how you do this. Including the ponyprog commandline.

Did you test it as i suggested, eg. with the programmer disconnected.. ?
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 23, 2010 - 08:59 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


I make the hex file directly in avr studio 4.0. This goes automatic when I build/simulate the code.

When I'm loading the hex file (made in avr studio) in ponyprog, I see on the bottom of the screen; 1066 bytes.

But if you guys say there's nothing wrong with the hex file. Than the limitation/problem is in the programmer.

For programming I use a Digilent jtag usb cable with software from Digilent. (pictures of this I post in this post like you suggest! Smile)

In the software from Digilent I can select; attiny13a. So I should think it must work with the cable/program.

And remind; I can program an atmega with the same cable and software.

Does anybody have a suggestion?

Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 23, 2010 - 09:43 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

For a starter remove the 10uF in the reset line!! That's likely to kill your programmer.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
patrickj
PostPosted: Mar 23, 2010 - 09:52 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


Thanks for the suggestion js. I tried it before without any difference.

Even without the usb-cable connected, I get the same error in the digilent software.

Do an AVR doesn't need an power-up reset? Or should I remove it for in circuit programming?
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 24, 2010 - 03:04 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 12827
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

I use a 100nF and a 4K7 pullup. 10uF is far too much and, as I said before, is likely to kill the programer as it has to discharge it via the reset input pin.

Apart from the likely damage it may just take to long for the chip to enter into programming mode and the programmer is likely to give up.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
thygate
PostPosted: Mar 24, 2010 - 04:29 PM
Hangaround


Joined: Sep 19, 2005
Posts: 149
Location: Belgium

If the problem is not in the reset line, then you will have to take the issue to digilent support i'm afraid.

And since you can read the signature bytes, the problem is not going to be the reset line.

Just buy a Dragon.. Promise you won't regret it.
You'll have ISP and JTAG for all AVR devices and the programming software is integrated in AVRStudio.

I blew 200 bucks on a jtagice mkii, but my colleague does everything with a dragon. (but hey, i have a shiny blue enclosure around my programmer Cool)

EUR70 http://www.antratek.nl/Atmel.html
EUR40 at farnell
EUR35 at MSC Nederland BV

Last two are B2B only.
Drop me a note if you can't order there, I'll order it and send it over.. You're in NL right ?


Last edited by thygate on Mar 24, 2010 - 05:11 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
patrickj
PostPosted: Mar 24, 2010 - 05:10 PM
Newbie


Joined: Mar 14, 2010
Posts: 12


Thanks for the idea thygate!

I use the AVR just for hobby and studie at schoolprojects. I can use a tiny or mega, both are possible, so now I just use a mega.
I just wanne now why I can't program an attiny.

I sent a mail to diligent, mayby they recognise the software problem.

When I realy need to program a tiny, I will have a look at the dragon you suggest.

Thanks for thinking with me!
 
 View user's profile Send private message  
Reply with quote Back to top
KillerSpud
PostPosted: Mar 25, 2010 - 02:38 AM
Hangaround


Joined: Sep 20, 2008
Posts: 132


I know this sound dumb, but lots of people make this mistake. Did you make sure to select your NEW hex file before programming? Even when switching between projects the programming window will try to use the last hex file programmed.

_________________
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-- Douglas Adams
 
 View user's profile Send private message  
Reply with quote Back to top
santacruzbob
PostPosted: Mar 26, 2010 - 02:17 AM
Hangaround


Joined: May 05, 2008
Posts: 123


tiny13 doesn't support jtag
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2010 - 10:33 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 33138
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

tiny13 doesn't support jtag

No but the JTAGICEmkII can re-use the signals in its header as ISP rather than JTAG if told to program using ISP rather than JTAG So I guess the naming given in that eagle.jpg above simply reflects the JTAG signal names?

According to the JTAGICEmkII manual it maps the signals:

Pin 1 - TCK - SCK
Pin 2 - GND - GND
Pin 3 - TDO - MISO
Pin 4 - Vref - Vref
Pin 6 - nSRST - RESET
Pin 9 - TDI - MOSI

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
thygate
PostPosted: Mar 27, 2010 - 12:42 AM
Hangaround


Joined: Sep 19, 2005
Posts: 149
Location: Belgium

OP is using a programmer and software from Digilent. As far as I can tell, looking at the manual he posted, is that it seems to support ISP only, but uses the JTAG naming convention .. I find no mention of actual support for JTAG .. go figure..

http://www.digilentinc.com/Data/Product ... Manual.pdf
Quote:
The AVR Programmer supports the in-system programming of Atmel AVR devices using a programming cable connected to a 6-pin programming connector on the target board.
...
Digilent programming cables conform to the JTAG standard and therefore bear the JTAG signal names instead of the SPI signal names. Observe the following label conventions when connecting the cable to a board:
TMS = SS or RST
TDI = MOSI
TDO = MISO
TCK = SCK
Ok, this is from the software manual, maybe the hardware does support JTAG ?


The error message in the screenshots.
Quote:
"Invalid device property setting for flash memory"
According to the manual, the digilent software should use the partdescription files that come with AVRStudio. The settings in your screenshot are consistent with both the "ATTiny13A.xml" part-description-file and the datasheet.

Try programming as follows :
On the first tab, select "Manual Settings" for device instead of "ATtiny13A", and use those same settings on the second tab :
Code:
Click Read to get the signature. (Should be 0x1E 0x90 0x07)
Program Flash Size (bytes) : 1024
Flash Page Size (words) :      16
EEPROM Size :                  64
Number of fuse bytes :          2
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits