Thread: Re: [Flashforth-devel] Question about running FlashForth on Arduino Diecimila
Brought to you by:
oh2aun
From: Aymeric <ult...@bl...> - 2017-09-21 21:29:13
|
Aymeric said : > Mikael Nordman said : > > How did you set the fuses ? That is the first thing to check. > > The fuses must be set to BOOTSIZE=1024 words and the BOOTRESET should be > > active. > > > > [..] > > > > I think these fuses should work for the 168. > > > > avrdude -p m168 -c usbtiny -e -u -U flash:w:ff-atmega.hex:i -U > > efuse:w:0xf8:m -U hfuse:w:0xff:m -U lfuse:w:0xff:m > > I cannot set SPIEN to 0 on this board, so I used this: > > -U lfuse:w:0xFF:m -U hfuse:w:0xDF:m -U efuse:w:0xF8:m > > Unfortunately I still do not get anything when I try to connect with > screen. I gave it another try and this time I could set the hfuse to FF, I don't understand why it did not work last time (it was on another machine, with another version of avrdude though...). However I still end up with a blank screen. Is there anything else I could try? Or should I just get an Arduino that is already supported/tested? Thanks! Aymeric |
From: Peter C. H. <Pet...@un...> - 2017-09-22 07:40:14
|
Some of the upper bits of the fuse bytes are not actually used, so it does not really matter what is set for those. However, avrdude reads back all bits after setting them and compares them to what they were supposed to be set as. If it does not agree an error message is created. Apparently at one stage the way avrdude reads back the not used bits was changed. So, if I remember this correctly, for older versions the lock byte has to be written as FF, but for newer versions of avrdude it has to be 3F, to prevent the error message. The actual setting is the same. Cost me a lot of time…. Peter > On 21 Sep 2017, at 23:28, Aymeric <ult...@bl...> wrote: > > Aymeric said : >> Mikael Nordman said : >>> How did you set the fuses ? That is the first thing to check. >>> The fuses must be set to BOOTSIZE=1024 words and the BOOTRESET should be >>> active. >>> >>> [..] >>> >>> I think these fuses should work for the 168. >>> >>> avrdude -p m168 -c usbtiny -e -u -U flash:w:ff-atmega.hex:i -U >>> efuse:w:0xf8:m -U hfuse:w:0xff:m -U lfuse:w:0xff:m >> >> I cannot set SPIEN to 0 on this board, so I used this: >> >> -U lfuse:w:0xFF:m -U hfuse:w:0xDF:m -U efuse:w:0xF8:m >> >> Unfortunately I still do not get anything when I try to connect with >> screen. > > I gave it another try and this time I could set the hfuse to FF, I don't > understand why it did not work last time (it was on another machine, > with another version of avrdude though...). However I still end up with > a blank screen. > > Is there anything else I could try? Or should I just get an Arduino that > is already supported/tested? > > Thanks! > Aymeric > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel |
From: Mikael N. <mik...@fl...> - 2017-09-22 09:20:22
|
At least in AVRSIM2 the XH register in the code sequence below fails count over 0x08 on the 168p. So FF gets stuck in an infinite loop just at the startup. Even if XH is a 16 bit regsister. In atmega source file Try replacing this WARM_2: st x+, r_zero cpi xh, 0x10 ; up to 0xfff, 4 Kbytes brne WARM_2 With THIS: WARM_2: st x+, r_zero cpi xh, 0x04 ; up to 0x3ff, 1 Kbytes brne WARM_2 It may help also on the real hardware. BR Mikael On 2017-09-22 00:28, Aymeric wrote: > > Is there anything else I could try? Or should I just get an Arduino > that > is already supported/tested? > > Thanks! > Aymeric |
From: Aymeric <ult...@bl...> - 2017-09-23 21:02:56
|
Mikael Nordman said : > It may help also on the real hardware. It did! It's working now :) Thanks! So to sum up: diff --git a/avr/src/config.inc b/avr/src/config.inc index 21f6bff..fc5a359 100644 --- a/avr/src/config.inc +++ b/avr/src/config.inc @@ -4,9 +4,10 @@ ;.include "m2561def.inc" ; ;.include "m2560def.inc" ; Tested Fuses: E:0xff H:0xdc L:0xff ;.include "m128def.inc" ; Tested Fuses: E:0xff H:0xdc L:0xff +.include "m168def.inc" ; Tested Fuses: E:0xf8 H:0xdf L:0xff ;.include "m168pdef.inc" ;.include "m328pdef.inc" ; Tested Fuses: E:0xff H:0xda L:0xff -.include "m328def.inc" ; Tested Fuses: E:0xff H:0xda L:0xff +;.include "m328def.inc" ; Tested Fuses: E:0xff H:0xda L:0xff ;.include "m32adef.inc" ;.include "m644pdef.inc" diff --git a/avr/src/ff-atmega.asm b/avr/src/ff-atmega.asm index 555e5c2..61dd095 100644 --- a/avr/src/ff-atmega.asm +++ b/avr/src/ff-atmega.asm @@ -5340,7 +5340,7 @@ WARM_1: ldi xl, 0x1C ; clear ram from y register upwards WARM_2: st x+, r_zero - cpi xh, 0x10 ; up to 0xfff, 4 Kbytes + cpi xh, 0x04 ; up to 0x3ff, 1 Kbytes brne WARM_2 ; Init empty flash buffer I will play a bit with it now... Aymeric |