PROBLEMS WITH AVRISP USING ATTINY 2313

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

hi ,
people i ve built a simple low cost in system programmer that uses attiny 2313 to program the target avr which is atmega8.I am using studio4 for the same.I ve also programmed the attiny2313 using a universal programmer, to be used as isp.But some how iam not able to program the atmega 8. the studio 4 shows connection failed. wat could be the problem?

please help me !!!!!

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

I assume that you use an Atmel AVR 910 derivate. To be able to use this you have to chose "Tools - AVR Prog" from the menu, don't use the built in program function.

Another problem might be your fuses. The "SPI Enable" Fuse has to be set to do ISP.

There could also be a hardware problem. Are you sure that the schematics are correct and you followed them 100%?

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

lostchild wrote:
I assume that you use an Atmel AVR 910 derivate. To be able to use this you have to chose "Tools - AVR Prog" from the menu, donyes i have checked the schematics they are correct.
i tried that but the same problem a message pops saying no board found.
i also checked the the tx ,rx signals on the rs232 connector they are fine.

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

Plug in your AVRISP to the COM port.
Run a Terminal program. You should be able to connect to your AVRISP at 115200 baud if you are using the "latest" software. Type commands by hand. Does it respond to 'S' or 'i' ?

If you have earlier versions, you may need to connect at 19200 or 38400 baud.

David.

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

please tell me how to change the settings .

coz when i try to change the isp frequency it says you cannot enter commands in disconnected mode.

also, i ve cheched communication lines i.e tx rx of the attiny 2313. they are showing some signals when i press the connect button in avr studio4.

but i am not able to get any sck on the tiny 2313 which goes to the isp connector.

and also i am not getting any clock signal for atmega8 ive connected a 8mhz crystal.

please help me out on these issues.

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

Your programmer is not similar to the AVRISP-2 on the Studio4 Connect Programmer icon.

Use the Studio4 Tools menu:

Studio4 -> Tools -> AVRProg

This should program many AVRs and set fuses and lockbits.

You cannot change ISP frequency or any of the AVRISP-2 features.

If you have trouble with AVRProg, please just try with a Terminal program.

David.

p.s. any activity you saw on the RS232 lines, is the standard procedure when Studio is looking for a AVRISP-2 or a STK500. It tries each unused COM port in turn, until it finds the device it is looking for.
I specify COM4 for my STK500, so it only looks on COM4.

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

yes i tried that but it says no supported board found.
i dont have terminal program where to get it from ,
and which commands to be send through bit?

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

You probably have Hyperterminal already.

CodeVision or ImageCraft supply a Terminal with their evaluation compilers.

Brays and TeraTerm are often quoted.

Quote:
yes i tried that but it says no supported board found.

If AVRProg does not find your board, then you have a problem. Which is why I suggest using a Terminal.

You could also post the version number of and a link to the software in your Tiny2313.

David.

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

hi, i am using avrisp given in the link followed and it says the firmware is written for at90s2313 but can be used for attiny2313 also as it is compatible.

please follow the link and help me out.

[/url]http://www.scienceprog.com/atmel...

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

There is a later version that uses a 7.328MHz xtal and connects at 115200 baud.

Are you using the 4MHz xtal ?
Are you using a pre-programmed Tiny2313 ?

If you can program the Tiny2313 yourself, then I can send you a HEX file suitable for your xtal. Or you can assemble the source code yourself.

After a brief look at the ASM code in your link, I do not think this will program an ATMega8. You should be able to connect with it at 19200 baud.

David.

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

hi david,
no iam using a 8mhz crystal , but i think it is running with its internal oscillator 1mhz.Also my atmega8 is surface mount ,could there be a problem?

about tiny 2313 i modified the asm code given in the link compiled in studio4 and programmed it using a universal programmer of my friend.

do you think the schematic is correct?
also how can i change the baud rate for programming?

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

The schematic is fine. Have you made a mistake wiring it ?

If your "AVRISP-1" is running on the 1MHz RC osc, then you will connect at 2400 baud via Hyperterminal.

AVRProg will not even try 2400 baud. So you would have to control your new "AVRISP-1" via avrdude.

When you can borrow your friend's programmer, I will send you a HEX file for the later version at 38400 baud. Make sure you set the fuses properly for your 8MHz xtal. Or buy a 7.328MHz xtal.

David.

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

No the wiring is fine.

for attiny 2313 i have 4mhz xtal and for atmega 8 i hav 8mhhz.

i ll get my friends programmer tomorrow u please send me that hex file.

but if that also does not work then what?

i am thinking to shift to parallel port programmer.

please give ur suggestions should i stick to serial isp till it works.

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

Why not try the Terminal program at 2400 baud as I suggested three days ago ?

Report back, and I will send you the HEX file.

I would prefer using the Serial to a parallel port programmer. You can always buy a USB->RS232 cable. USB->parallel are expensive and do not work.

David.

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

are but how can you send data on serial port using hyper terminal?

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

You plug in a RS232 cable from your "board" to your PC. (using COM1 or COM4 or whatever)

On your Windows-XP PC:

Start -> All Programs -> Accessories -> Communications -> Hyperterminal

For 1MHz osc: Connect at 2400 baud 8 bits, No Parity, No Handshaking.

Type 'S' or 'p' or 'i'.

Connect at 19200 baud for 8MHz osc.

David.

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

Did you set the correct fuses for the Tiny2313 using a 7.3728 MHz crystal? They should be:

LFUSE: 0xED
HFUSE: 0xDF (same as manufacturing default)
EFUSE: 0xFF (same as manufacturing default)

I also have an update to the standard AVRISP code that adds a low frequency clock output that can be used to drive a device if there is a clocking problem. It saves me getting out my STK500.

I also stock pre-programmed ATTiny2313 chips if people want to purchase one.

--Mike

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

Mike,

He has an 8MHz xtal. He may have an incorrect fuse.

I do not think that he is in the U.S.

David.

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

I tried with the terminal program, sending 's' and 'i'
to the com port but the programmer did not respond.

for the tiny 2313 i had set only external oscillator and disabled prescaler fuse ,may be the hex file i have programmed may be not supporting tiny 2313 as it was build for at90s2313 but as said they are compatible i went for it, if you have the tiny 2313 hex file for 8 mhz target oscillator please send it to me.

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

Using different software version will NOT solve your problem.

You obviously have a hardware problem.

If you have set external oscillator, you have killed your T2313. Your friend will have to supply an external clock to even read your T2313. If he has a STK500 it is easy to fix the T2313.

1. With your friend's programmer, read the current fuses. If it says external osc or CKDIV_8 fuse is set, then you must change to external xtal and NO DIV_8 fuse.
Your T2313 will be ok with NO fuses set at all ( e.g. an erased T2313 )

2. Then try your existing program. It should work at 19200 baud.

3. Then email me for a better HEX file.

4. Your 90S2313 program will run on the Tiny2313 just fine. But it needs the DIV8 fuse to be unused.

David.

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

HI DAVID ,
im back after lot of days.after all that you told last time i worked on it and found that my serial port had some problems.So i shifted to another pc and tried sending 'S' on serial port guess what the programmer responded with 'AVR ISP' .

when i send 'i' or any other character it gives ??

so i now that i know ki attiny is working properly. i tried using avrprog.exe but it still says no board found.

now vat to do?
please reply sooon............

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

Now that you know your board work.

What baud rate was successful ?
What COM port was successful ?

AFIK AvrProg only tries 19200, 38400, 115200 baud.

avrdude will do anything. So if your board can do it, avrdude can control it.

David.

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

yes it worked on com1 with 9600 baud rate.

and where will i get avr dude and how to use it?
please guide me through this?

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

This is avr910_2313.hex built for 8MHz crystal and 38400 baud.

:020000020000FC
:10000000DBC00CE009B908E10AB908955F9BFECF97
:100010004CB108955D9BFECF4CB90895C895002062
:1000200021F0402DF7DF3196F9CF0895C8950020D3
:1000300021F0402DEFDF3296F9CF0895C8950020CA
:1000400021F0501519F03296F9CF08940895C8950B
:10005000002041F0501511F03296F9CF3196C89535
:10006000C02C8C2C0895C895002039F0501511F043
:100070003296F9CF3196C895D02C089518E222E433
:100080002A95F1F71A95D9F70A95C1F7089519D06D
:100090003D2F17D03C2F15D00895312D12D0322D81
:1000A00010D0332D0ED0342F0CD00895312D09D01F
:1000B000322D07D0332D05D003D0432FABDF089569
:1000C000332708E070E0331F10F4C59A01C0C598CB
:1000D000770FB6997160C79A1BE01A95F1F7C79828
:1000E00016E01A95F1F70A9571F7372F0895552301
:1000F00022F030E2E6DF3D2F03C03D2F41D03160DA
:10010000E0DF3C2FDEDFDCDF432F84DF55234AF0C6
:1001100038E2D7DF3D2FD5DF3C2FD3DFD1DF432FB0
:1001200079DF21960895552322F030EACADF3D2F6A
:1001300005C0573859F03D2F23D03560C2DF3C2F22
:10014000C0DFBEDF432F66DF219608950F910F9128
:10015000B3C2552322F030ECB4DF3D2F05C0573831
:1001600061F03D2F0DD03660ACDF3C2FAADF342F7D
:10017000A8DF0AE083DF219608950F910F919CC2BA
:10018000330F330F330F18F4573809F434600895E0
:10019000C098C39A08EC72DF08EC70DF38ECC09AA4
:1001A000C39802E06BDFC098C39A01E067DF3A951D
:1001B000B1F7C09AC39808950FED0DBF00E1C02EAE
:1001C0008C2C50E2AA2499241FEF12BB1FEF18BBFE
:1001D00012E011BB19E017BB14DFDADF17DF4B3178
:1001E000E9F3443559F412DF542FE4EEF6E02FDF43
:1001F0000FEFD02EE4ECF6E036DF61C2433521F498
:10020000ECE4F7E00BDFEACF463521F4E4E4F7E075
:1002100005DFE4CF463721F4E8E4F7E0FFDEDECF88
:10022000443749F4E4ECF6E001DFE4EEF6E0FEDE0C
:1002300040E0F0DED3CF403719F443E5EBDECECF1C
:10024000413619F449E5E6DEC9CF493631F4E4E533
:10025000F7E0E4DE4AE0DEDE32C2423639F449E558
:10026000D9DE40E0D7DE40E4D5DEB8CF483721F410
:10027000CDDEC09AC39823C2493721F4C7DEC098A7
:10028000C39A1DC2E4ECF6E0D9DE28F4E4EEF6E011
:10029000D5DE08F411C2403509F03BC0C098C39ABE
:1002A00012E011BB19EB17BBC798552312F0C49A83
:1002B00001C0C49802E3E2DE552312F0C49801C0E5
:1002C000C49A02E3DBDE3CEAFCDE33E5FADE5032C0
:1002D000B8F05523AAF020E2F3DE333599F030E090
:1002E000F0DEC79A1BE01A95F1F7C79816E01A9549
:1002F000F1F73CEAE6DE33E5E4DE2A9569F702C071
:1003000030E0DFDE552312F030E0DBDE04E0B6DE65
:10031000D6C14336B9F47ADE30E4832F55231AF080
:10032000D0DE3D2F03C03D2F2BDF3260CADE3C2FD5
:10033000C8DE342FC6DE942F4C2E5D2E55230AF4D2
:10034000219663C1433491F461DE552372F038E4A1
:10035000832FB7DE3D2FB5DE3C2FB3DE342FB1DE69
:10036000942F4C2E5D2E219650C1A6C1423409F027
:1003700073C04CDE442311F041E09EC147DE41349E
:1003800010F042E099C1642E742E40DEB42EBB27DB
:10039000A0E63CDE4D936A94E1F7BB27A0E621E09E
:1003A000A22E4B2D463449F0453411F043E084C170
:1003B0004D91CFDE7A94E1F782C1E4EEF6E03EDEC5
:1003C00008F423C030E463DE3D917BDE38E4832F04
:1003D0005EDE3D91932F4C2E5D2E73DE21967A9436
:1003E00031F07A9421F0AA2069F38A9459F7AA206F
:1003F00009F465C18A943CE464DE352D62DE342D57
:1004000060DE30E05EDE8C2C29C15523DAF09D9150
:100410009F3F41F030E4832F3ADE392F52DE4C2EDD
:100420005D2EF8D07A949D919F3F41F038E4832F60
:100430002EDE392F46DE4C2E5D2EECD021967A949E
:1004400021F73DC13D2F9CDE32603BDE3C2F39DE83
:100450003D91932F36DEEFCF4235E1F4552322F064
:1004600038E22FDE3D2F03C03D2F8ADE316029DECA
:100470003C2F27DE25DE432FCDDD55234AF030E229
:1004800020DE3D2F1EDE3C2F1CDE1ADE432FC2DD98
:100490002196A4CE4736B9F4B9DDB42FB7DDA42F29
:1004A000B5DD463439F0453409F006C13CDE11971C
:1004B000E9F794CE1CDE55231AF01297D9F78ECEA9
:1004C0001197C1F78BCE413429F4A0DDD42F9EDDE6
:1004D000C42FF5C0443419F499DD3BDEF0C0443636
:1004E00011F421DE7BCE4C3461F4552312F0C49A12
:1004F00001C0C49812E011BB19E017BBC09AC398A1
:10050000DEC0453409F4F1CF453669F43CEAD9DD63
:10051000552312F030E8D5DD34E0D3DD30E0D1DD15
:1005200008E2ACDDCCC04C3649F470DD3CEAC9DDF4
:10053000552382F0342F306EC4DD07C0463699F45F
:1005400065DD3CEABEDD30EABCDD3327BADD342FA1
:10055000B8DD06C0342F307E3760B3DD30E0B1DD6A
:100560000AE08CDDACC0433771F455235AF020E328
:10057000122E222422E0322E99DD3A9497DD332484
:1005800095DD2CCE99C04D3649F43CE49ADD352DED
:1005900098DD342D96DD30E094DD60C04A3351F4AF
:1005A00035DD142E33DD242E31DD342E7FDD02E3E4
:1005B00065DD85C04E3269F429DD142E27DD242E39
:1005C00025DD342E23DD69DD472F24DD02E356DDF2
:1005D00076C0423711F438E503C0463421F430E5E3
:1005E00070DD33270AC04E3419F438E56ADD04C0E3
:1005F000413551F430E565DD38E063DD332761DDF9
:100600005FDD432F07DDEACD57C0E4EEF6E016DDEF
:1006100018F055C021E0922EDD20D1F09D15C1F0DB
:100620008F7080622227552322F0382F4ADD352D26
:1006300003C0352DA5DD316044DD342D42DD40DDC4
:10064000552312F430789078391721F02A9559F70C
:100650000AE014DD992099F199240895513499F014
:100660005332D1F09F3F79F08F7080622227382F6C
:1006700028DD352D26DD342D24DD22DD391729F046
:100680002A9509F0F4CF02E3F9DCAA2019F07720CB
:1006900009F098CEAA2413C080EF2227522E382FBB
:1006A00010DD352D0EDD342D0CDD0ADD317069F3E2
:1006B0002A9549F3F4CFAEDC4FE3ACDC8FCD4DE0AF
:1006C000A9DC8CCD1300207F287F30FF34FF387FDA
:1006D00048FF4CFF51FF55FF56FF68FF6CFF86FF38
:1006E00087FF0000014004400540064007400840E5
:1006F00009400E101A100F201B2014201C201D4032
:100700002310312033203540374039403D403E40B2
:1007100057103A203B20414043404440454046402A
:100720005E10604061406240634064406640692002
:100730006A2072407340744075407620772078407C
:100740007940000033380000313200004156522019
:10075000495350005665722E332E38622028415678
:1007600052313039204D6F64652C20372E333732AB
:10077000384D687A2C203131352E3230302062618C
:1007800075642920666F7220414E3931302C20412A
:1007900054393053323331337777772E6D696B723A
:1007A0006F636F6E74726F6C6C65722D70726F6AAE
:1007B000656B74652E64652032362E4665622E3276
:0407C000303036009F
:00000001FF
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi, plz give me the asm file so that i can complie it and then the hex file i will burn the 2313.

how can i create a hex file directly with the code you have given and without compiling?

how to create a .hex file directly from the above code?

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

also, if i do some changes in the 2313 asm code like:
changing

equ N=25 to N=31 or N=55 or N=61 ; UART INITIALISATION

for different baud rates and then compile and try running it.

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

I gave you the HEX file precisely because you are unsure of using the tools. You just copy and paste the file to avr910_2313.hex and burn your Tiny2313 from that.

David.

Attachment(s): 

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

Hi David,
THANKYOU LOTS !! :)
the programmer finally worked at 19200 baud rateand also tested th atmega8 with simple codes and it works fine.I will be in touch with you for any assistance required. thanks again. :D

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

Hi David,
i have a problem again. Yesterday first i tried programming my atmega 8 with a simple led program but it gave an error like address expected..........
so i swapped my miso - mosi lines and then programmed and it worked with the leds blinking.

today i was checking the advanced settings of the avr prog and changed the clock settings to ext clock 8mhz
and programmed it with same program but it was not working.

so i tried to change the settings to default 1mhz but again it started giving the address error.......
and now i am not able to program it again?
please reply...

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

Quote:
changed the clock settings to ext clock 8mhz
So do you HAVE an external clock generator? Or do you have a crystal and REALLY want external crystal oscillator?

Of course it is now too late and will need to feed a clock on XTAL1.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

so what frequency do i need to feed in and what next after connecting it to xtal1?

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

Connect a 1MHz clock to XTAL1, and this time change the fuse setting to INTERNAL Clock or XTAL Clock.

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

Hey Guys,
i tried connecting 1mhz clock to the XTAL1 pin and the program worked but in haste i selected the spei fuse bit and then programmed the avr and now again its not working so now what???

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

The SPIEN fuse bit can NOT be altered by ISP.

Just do your 1MHz clock and this time THINK.

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

hi david ,
sorry man, the board is working fine...
i saw in the datasheet that spien fuse cannot be set with serial pprogramming..