I was looking forward to running a tiny1634 today. s_mack very kindly mailed me one. However it is QFN and not SOIC-20 so I can't do anything with it. (unless I get a new set of eyes and a QFN adapter !).
You told me you had an adapter! Otherwise I would have soldered it on one for you. Too bad for the misunderstanding :(
If you want to try again... I'd need $8. On the adapter, I can't get away with sending it regular post (it has to go as a parcel).
QFN were how the first ones came. Plus they are the smallest so that's what I wanted for my space-tight project.
Thanks for the QFN chip. Sorry about the misunderstanding. I have ordered some SOIC-20 chips and some QFN adapter pcbs. If the adapter boards arrive before the SOIC, I will have a go at soldering.
@snigelen,
snigelen wrote:
david.prentice wrote:
The answer to that is to read SPSR and SPDR when you 'connect'. i.e. clear any WCOL bit.
Hm, it seems to work if I access SPDR only if SPIF is set, but maybe it's always set when WCOL is set? But I guess you can du the SPSR, SPDR access regardless of the flags in SPSR?
Yes. If you read both registers, it puts the SPI in a guaranteed state.
You have a similar situation with the USART_MSPI mode. i.e. you should read UDR twice.
It still does not answer the 'uneven' SCK though !
I'll bet it generates exactly the same code ("dummy" would almost certainly be just R24 in GCC for example) but it's more obvious to the maintainer what's going on.
Ok, it's the same generated code in both versions, so it really doesn't matter. But both the compatibility and maintainer arguments are good so I'll go for the dummy version in the future.
I received my ATtiny1634R SOIC-20 chips from Mouser this morning !
1. AS6 -> Tools -> Device Programming: Tool: Dragon, Interface:ISP seems to work ok.
2. The Lockbits always seem to read as "Verify Disabled" after AS6 has failed to set DWEN
3. Using Chip Erase will clear the Lockbits.
4. Trying to set DWEN manually via AS6 gives a 'failure' message.
5. However if you toggle power to the Tiny, it will power up successfully in debugWIRE mode.
6. So you can use AS6 in the regular way for debugging or uploading via debugWIRE.
7. You don't get "Disable debugWIRE and Close" in the Debug menu.
8. You can "Disable" via avrdude.
I tried regular avrdude programming with "-c dragon_isp".
9. This seems to work just fine. e.g. read / write / verify.
I then tried "avrdude -c usbasp"
10. It worked just fine with fischl firmware (with SPI initialised properly)
11. It worked fine with betemcu.cn firmware
So there appear to be some "issues" with AS6. However they are not insurmountable.
I will examine AS6 with a Logic Analyser at a later date.
My "avrdude.conf" entry is as posted earlier and amended as advised by snigelen:
Edit. corrected the page_size and num_pages. Many thanks to Brutte for pointing this out.
David.
p.s. The SOIC-20 chips are easy to solder onto a DIL adapter pcb. However I can't see the point of SOIC-20. They are 50% of a DIP0-20 footprint. But they are massive compared with TQFP or QFN. Edit again. From the data sheet:
Quote:
Table 22-2. Lock Bit Protection Modes.
Lock Bits (1)
LB2 LB1 Mode of Protection
1 1 No memory lock features enabled
1 0
Further programming of Flash and EEPROM is disabled in parallel and serial
programming mode. Fuse bits are locked in both serial and parallel
programming mode (2)
0 1 Reserved
0 0
Further reading and programming of Flash and EEPROM is disabled in
parallel and serial programming mode. Fuse bits are locked in both serial and
parallel programming mode (2)
Watching AS6 via a Logic Analyser, it does the regular 'enter programming mode' and check Signatures.
Then it writes Lock = 0xFC
Followed by clearing the DWEN bit in hfuse.
And writes the existing lfuse.
Since the Lock has prevented any fuse changing, this seems a little pointless ! i.e. makes it always fail.
Incidentally, I watched AS6 'enable' a mega168. This sends Lock = 0xFF before setting hfuse.
You do not always get the 'Disable debugWIRE and Close' option. Thus sometimes you are forced to use avrdude.
For the avrdude.conf entry, I use that one that David posted with my changes above and I also changed the eeprom size and verified I that I could write a small array to eeprom. High voltage programing is not tested. Here it is with my changes:
#------------------------------------------------------------
# ATtiny1634.
#------------------------------------------------------------
part
id = "t1634";
desc = "ATtiny1634";
has_debugwire = yes;
flash_instr = 0xB6, 0x01, 0x11;
eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
0x99, 0xF9, 0xBB, 0xAF;
stk500_devcode = 0x86;
# avr910_devcode = 0x;
signature = 0x1e 0x94 0x12;
pagel = 0xd7;
bs2 = 0xc2;
chip_erase_delay = 9000;
pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
"x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
"x x x x x x x x x x x x x x x x";
timeout = 200;
stabdelay = 100;
cmdexedelay = 25;
synchloops = 32;
bytedelay = 0;
pollindex = 3;
pollvalue = 0x53;
predelay = 1;
postdelay = 1;
pollmethod = 1;
pp_controlstack =
0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
hventerstabdelay = 100;
progmodedelay = 0;
latchcycles = 5;
togglevtg = 1;
poweroffdelay = 15;
resetdelayms = 1;
resetdelayus = 0;
hvleavestabdelay = 15;
resetdelay = 15;
chiperasepulsewidth = 0;
chiperasepolltimeout = 10;
programfusepulsewidth = 0;
programfusepolltimeout = 5;
programlockpulsewidth = 0;
programlockpolltimeout = 5;
memory "eeprom"
paged = no;
page_size = 4;
size = 256;
min_write_delay = 3600;
max_write_delay = 3600;
readback_p1 = 0xff;
readback_p2 = 0xff;
read = " 1 0 1 0 0 0 0 0",
" 0 0 0 x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write = " 1 1 0 0 0 0 0 0",
" 0 0 0 x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
loadpage_lo = " 1 1 0 0 0 0 0 1",
" 0 0 0 0 0 0 0 0",
" 0 0 0 0 0 0 a1 a0",
" i i i i i i i i";
writepage = " 1 1 0 0 0 0 1 0",
" 0 0 x x x x x a8",
" a7 a6 a5 a4 a3 a2 0 0",
" x x x x x x x x";
mode = 0x41;
delay = 5;
blocksize = 4;
readsize = 256;
;
memory "flash"
paged = yes;
size = 16384;
page_size = 32;
num_pages = 512;
min_write_delay = 4500;
max_write_delay = 4500;
readback_p1 = 0xff;
readback_p2 = 0xff;
read_lo = " 0 0 1 0 0 0 0 0",
" 0 0 0 a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" 0 0 0 a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
loadpage_lo = " 0 1 0 0 0 0 0 0",
" 0 0 0 x x x x x",
" x x a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
loadpage_hi = " 0 1 0 0 1 0 0 0",
" 0 0 0 x x x x x",
" x x a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
writepage = " 0 1 0 0 1 1 0 0",
" 0 0 0 a12 a11 a10 a9 a8",
" a7 a6 x x x x x x",
" x x x x x x x x";
mode = 0x41;
delay = 6;
blocksize = 128;
readsize = 256;
;
memory "lfuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
"x x x x x x x x o o o o o o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
"x x x x x x x x i i i i i i i i";
;
memory "hfuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x o o o o o o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
"x x x x x x x x i i i i i i i i";
;
memory "efuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x x x x x x o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
"x x x x x x x x x x x x x i i i";
;
memory "lock"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
"x x x x x x x x x x o o o o o o";
write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
"x x x x x x x x 1 1 i i i i i i";
;
memory "calibration"
size = 1;
read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
"0 0 0 0 0 0 0 0 o o o o o o o o";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;
;
The 'Enable debugWIRE' works exactly the same. i.e. AS6 locks the chip preventing setting DWEN.
So you need to Erase the chip to clear the lockbits before setting DWEN manually.
Go debugging.
The Debug menu has the 'Disable debugWIRE and Close' option.
If you select it, it whinges that the command failed.
However try ISP. It should work ok providing you don't toggle power. Then you can erase the chip to clear the lock bits, and clear DWEN manually.
I am still using AS6.0.1863
No, it does not seem to work smoothly. But not impossible.
You need to edit your own avrdude.conf
snigelen has posted a 'working' version.
I guess you can use any ISP programmer supported by your programming software, if that also support the tiny1634.
This thread was about getting avrdude to work with tiny1634. I tried it with stk500, dragon and usbasp programmers, they all work so it's probably OK with any ISP programmer.
As you can see in this thread, the combination avrdude/usbasp/tiny1634 will trigger a firmware bug in the usbasp after the first ISP session after plugin. See earlier in this thread for details if you plan to use usbasp.
I have tested both USART's in UART mode and USART1 in master SPI mode without any problems.
Edit: Tested to program with ArduinoISP on a Duemillanove clone (Olimexino). It worked.
Posted by bilalgabula: Sun. Sep 23, 2012 - 05:20 AM
1
2
3
4
5
Total votes: 0
This thread has been a great resource for me. I was just wondering if anyone has tried the avrdude.conf file with usbasp. That is the only programmer that I have and I am looking forward to using the 1634 in a project in the next few weeks.
it works every time! Even with -B0.1 (1.5MHz, but it's not really faster that -B1).
I just want to say thanks for that. I finally got around to trying it and it worked. Now I can program the chip using hardware SPI and more than just once.
Posted by bilalgabula: Wed. Oct 10, 2012 - 09:26 PM
1
2
3
4
5
Total votes: 0
I was able to get it to work with -B3 187.5KHz. But if I try it with -B2 or lower I get 'the device does not' answer error. I changed the isp.c to get the speed up to 3.
Is there anything else I could try? Otherwise I'll just default to programming it at B3.
memory "efuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x o o o o o o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
"x x x x x x x x 1 1 1 i i i i i";
;
All you need in one place if you're using an Arduino Mega or Uno as a programmer.
I am using the avrdude configuration file provided, above, with a recent ArduinoISP.ino file on an Arduino Mega 2560 R3, with the ATTINY1634. I had to modify the ArduinoISP file slightly, by adding a delay before sending program enable bytes.
I put all into a zip file and a test program to load using Avrdude up as a project, here:
I have simply changed the id, desc, signature of a ATmega168 in the avrdude.v10 conf file.
This should cope with regular SPI programming.
It appears to use the same SPI commands from a brief comparison of data sheets.
Note that I have made no attempt to check the HVPP details.
David.
The addressing config for flash programming is off ( loadpage_lo / loadpage_hi / writepage).
According to the datasheet it is 512 32-word pages,
so it needs to be a3-0 for loadpage and a12-a4 for writepage.
Spent a few hours today until I found that bug...
Here's the corrected version:
#------------------------------------------------------------
# ATtiny1634
#------------------------------------------------------------
part
id = "t1634";
desc = "ATTINY1634";
has_debugwire = yes;
flash_instr = 0xB6, 0x01, 0x11;
eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
0x99, 0xF9, 0xBB, 0xAF;
stk500_devcode = 0x86;
# avr910_devcode = 0x;
signature = 0x1e 0x94 0x12;
pagel = 0xd7;
bs2 = 0xc2;
chip_erase_delay = 9000;
pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
"x x x x x x x x x x x x x x x x";
chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
"x x x x x x x x x x x x x x x x";
timeout = 200;
stabdelay = 100;
cmdexedelay = 25;
synchloops = 32;
bytedelay = 0;
pollindex = 3;
pollvalue = 0x53;
predelay = 1;
postdelay = 1;
pollmethod = 1;
pp_controlstack =
0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
hventerstabdelay = 100;
progmodedelay = 0;
latchcycles = 5;
togglevtg = 1;
poweroffdelay = 15;
resetdelayms = 1;
resetdelayus = 0;
hvleavestabdelay = 15;
resetdelay = 15;
chiperasepulsewidth = 0;
chiperasepolltimeout = 10;
programfusepulsewidth = 0;
programfusepolltimeout = 5;
programlockpulsewidth = 0;
programlockpolltimeout = 5;
memory "eeprom"
paged = no;
page_size = 4;
size = 512;
min_write_delay = 3600;
max_write_delay = 3600;
readback_p1 = 0xff;
readback_p2 = 0xff;
read = " 1 0 1 0 0 0 0 0",
" 0 0 0 x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
write = " 1 1 0 0 0 0 0 0",
" 0 0 0 x x x x a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
loadpage_lo = " 1 1 0 0 0 0 0 1",
" 0 0 0 0 0 0 0 0",
" 0 0 0 0 0 0 a1 a0",
" i i i i i i i i";
writepage = " 1 1 0 0 0 0 1 0",
" 0 0 x x x x x a8",
" a7 a6 a5 a4 a3 a2 0 0",
" x x x x x x x x";
mode = 0x41;
delay = 5;
blocksize = 4;
readsize = 256;
;
memory "flash"
paged = yes;
size = 16384;
page_size = 32;
num_pages = 512;
min_write_delay = 4500;
max_write_delay = 4500;
readback_p1 = 0xff;
readback_p2 = 0xff;
read_lo = " 0 0 1 0 0 0 0 0",
" 0 0 0 a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
read_hi = " 0 0 1 0 1 0 0 0",
" 0 0 0 a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";
loadpage_lo = " 0 1 0 0 0 0 0 0",
" 0 0 0 x x x x x",
" x x x x a3 a2 a1 a0",
" i i i i i i i i";
loadpage_hi = " 0 1 0 0 1 0 0 0",
" 0 0 0 x x x x x",
" x x x x a3 a2 a1 a0",
" i i i i i i i i";
writepage = " 0 1 0 0 1 1 0 0",
" 0 0 0 a12 a11 a10 a9 a8",
" a7 a6 a5 a4 x x x x",
" x x x x x x x x";
mode = 0x41;
delay = 6;
blocksize = 128;
readsize = 256;
;
memory "lfuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
"x x x x x x x x o o o o o o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
"x x x x x x x x i i i i i i i i";
;
memory "hfuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x o o o o o o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
"x x x x x x x x i i i i i i i i";
;
memory "efuse"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
"x x x x x x x x x x x x x o o o";
write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
"x x x x x x x x x x x x x i i i";
;
memory "lock"
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
"x x x x x x x x x x o o o o o o";
write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
"x x x x x x x x 1 1 i i i i i i";
;
memory "calibration"
size = 1;
read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
"0 0 0 0 0 0 0 0 o o o o o o o o";
;
memory "signature"
size = 3;
read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
"x x x x x x a1 a0 o o o o o o o o";
;
;
- Log in or register to post comments
Top@s_mack,
Thanks for the QFN chip. Sorry about the misunderstanding. I have ordered some SOIC-20 chips and some QFN adapter pcbs. If the adapter boards arrive before the SOIC, I will have a go at soldering.
@snigelen,
Yes. If you read both registers, it puts the SPI in a guaranteed state.
You have a similar situation with the USART_MSPI mode. i.e. you should read UDR twice.
It still does not answer the 'uneven' SCK though !
David.
- Log in or register to post comments
Topit may look a little strange but since the registers are volatile they have to be read.
- Log in or register to post comments
TopI'd suggest
I'll bet it generates exactly the same code ("dummy" would almost certainly be just R24 in GCC for example) but it's more obvious to the maintainer what's going on.
- Log in or register to post comments
TopThat is exactly what I put in my "isp.c" because I know it is compiled with avr-gcc.
Some compilers will not accept "SPSR;" and need a "dummy = SPSR;". I had that 'feature' bite me the other week.
David.
- Log in or register to post comments
TopOk, it's the same generated code in both versions, so it really doesn't matter. But both the compatibility and maintainer arguments are good so I'll go for the dummy version in the future.
- Log in or register to post comments
TopI received my ATtiny1634R SOIC-20 chips from Mouser this morning !
1. AS6 -> Tools -> Device Programming: Tool: Dragon, Interface:ISP seems to work ok.
2. The Lockbits always seem to read as "Verify Disabled" after AS6 has failed to set DWEN
3. Using Chip Erase will clear the Lockbits.
4. Trying to set DWEN manually via AS6 gives a 'failure' message.
5. However if you toggle power to the Tiny, it will power up successfully in debugWIRE mode.
6. So you can use AS6 in the regular way for debugging or uploading via debugWIRE.
7. You don't get "Disable debugWIRE and Close" in the Debug menu.
8. You can "Disable" via avrdude.
I tried regular avrdude programming with "-c dragon_isp".
9. This seems to work just fine. e.g. read / write / verify.
I then tried "avrdude -c usbasp"
10. It worked just fine with fischl firmware (with SPI initialised properly)
11. It worked fine with betemcu.cn firmware
So there appear to be some "issues" with AS6. However they are not insurmountable.
I will examine AS6 with a Logic Analyser at a later date.
My "avrdude.conf" entry is as posted earlier and amended as advised by snigelen:
Edit. corrected the page_size and num_pages. Many thanks to Brutte for pointing this out.
David.
p.s. The SOIC-20 chips are easy to solder onto a DIL adapter pcb. However I can't see the point of SOIC-20. They are 50% of a DIP0-20 footprint. But they are massive compared with TQFP or QFN.
Edit again. From the data sheet:
Watching AS6 via a Logic Analyser, it does the regular 'enter programming mode' and check Signatures.
Then it writes Lock = 0xFC
Followed by clearing the DWEN bit in hfuse.
And writes the existing lfuse.
Since the Lock has prevented any fuse changing, this seems a little pointless ! i.e. makes it always fail.
Incidentally, I watched AS6 'enable' a mega168. This sends Lock = 0xFF before setting hfuse.
You do not always get the 'Disable debugWIRE and Close' option. Thus sometimes you are forced to use avrdude.
- Log in or register to post comments
TopLooks like a bug in a datasheet, when your settings work as expected.
No RSTDISBL, no fun!
- Log in or register to post comments
TopMy setting is
which works.
- Log in or register to post comments
TopIs the problem in AS6 present for both JTAGICEmkII and AVR Dragon?
In my case I could enable DWEN flag, but after can't return to ISP mode.
What is the latest conf file for avrdude and attiny1634? Is it finalized or still some uncertainties?
- Log in or register to post comments
TopFor the avrdude.conf entry, I use that one that David posted with my changes above and I also changed the eeprom size and verified I that I could write a small array to eeprom. High voltage programing is not tested. Here it is with my changes:
- Log in or register to post comments
TopThe 'Enable debugWIRE' works exactly the same. i.e. AS6 locks the chip preventing setting DWEN.
So you need to Erase the chip to clear the lockbits before setting DWEN manually.
Go debugging.
The Debug menu has the 'Disable debugWIRE and Close' option.
If you select it, it whinges that the command failed.
However try ISP. It should work ok providing you don't toggle power. Then you can erase the chip to clear the lock bits, and clear DWEN manually.
I am still using AS6.0.1863
No, it does not seem to work smoothly. But not impossible.
You need to edit your own avrdude.conf
snigelen has posted a 'working' version.
David.
- Log in or register to post comments
Topunder eeprom. I updated the message above with that number.
- Log in or register to post comments
TopI was really excited to find someone else working with the ATtiny1634. It looks like you are a step or three ahead of me.
. what are you using to program the ATtiny1634 - Arduino as ISP?
. are you able to use both serial ports?
Any tips / pointers are greatly appreciated.
- Log in or register to post comments
TopI guess you can use any ISP programmer supported by your programming software, if that also support the tiny1634.
This thread was about getting avrdude to work with tiny1634. I tried it with stk500, dragon and usbasp programmers, they all work so it's probably OK with any ISP programmer.
As you can see in this thread, the combination avrdude/usbasp/tiny1634 will trigger a firmware bug in the usbasp after the first ISP session after plugin. See earlier in this thread for details if you plan to use usbasp.
I have tested both USART's in UART mode and USART1 in master SPI mode without any problems.
Edit: Tested to program with ArduinoISP on a Duemillanove clone (Olimexino). It worked.
- Log in or register to post comments
TopThis thread has been a great resource for me. I was just wondering if anyone has tried the avrdude.conf file with usbasp. That is the only programmer that I have and I am looking forward to using the 1634 in a project in the next few weeks.
- Log in or register to post comments
Topyes
- Log in or register to post comments
TopAwesome!
- Log in or register to post comments
TopI just want to say thanks for that. I finally got around to trying it and it worked. Now I can program the chip using hardware SPI and more than just once.
- Steven
- Log in or register to post comments
TopI was able to get it to work with -B3 187.5KHz. But if I try it with -B2 or lower I get 'the device does not' answer error. I changed the isp.c to get the speed up to 3.
Is there anything else I could try? Otherwise I'll just default to programming it at B3.
- Log in or register to post comments
TopThe USBASP hardware can do 1500kHz, 750kHz, 375kHz, 187.5kHz, ...
This corresponds to -B0.66666, -B1.3333, -B2.6666, -B5.3333, ...
The firmware will use the nearest SCK frequency, so there is no need to use the decimal arguments.
Just use -B0.5, -B1, -B2, -B5, ...
Since a 1MHz virgin needs < 250kHz, -B5 is the obvious argument.
No. I can't understand why it defaults to 375kHz.
187.5kHz would be more appropriate.
OTOH, you could always auto-detect the best SCK frequency. This is what Chinese firmwares do.
David.
- Log in or register to post comments
Tophere is a corrected efuse section
- Log in or register to post comments
TopAll you need in one place if you're using an Arduino Mega or Uno as a programmer.
I am using the avrdude configuration file provided, above, with a recent ArduinoISP.ino file on an Arduino Mega 2560 R3, with the ATTINY1634. I had to modify the ArduinoISP file slightly, by adding a delay before sending program enable bytes.
I put all into a zip file and a test program to load using Avrdude up as a project, here:
https://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=3688
The asm file is just a work in progress that blinks an LED but will become a starting point template. I used Atmel Studio 6 to write and simulate it.
- Log in or register to post comments
TopThe addressing config for flash programming is off ( loadpage_lo / loadpage_hi / writepage).
According to the datasheet it is 512 32-word pages,
so it needs to be a3-0 for loadpage and a12-a4 for writepage.
Spent a few hours today until I found that bug...
Here's the corrected version:
- Log in or register to post comments
Top