Thank you for all the help, folks.
I soldered my second 4809 that I was trying in that clamshell onto a 48p breakout, and . . . it shows the same behavior as when it was in the clamshell. js will be happy that with the breakout my decoupling caps are a little closer at about 5mm and 9mm than they were before (as I said, I doubt that's the problem; only way to get them closer than with this dip breakout is buy a board or make one with kicad and a fab).
Also sadly, my review of that 5th photo schematic 4809 ultra-explorer thing doesn't reveal any problems with my setup.
Regarding "using Arduino as the programmer" (rather than STK600), it appears you are referring me to El Tangas' page about that. Maybe I could pursue that, though that's a bit unattractive. The only arduino I have lying around is a mega2560 one (though as was said, I could put the code into a breadboarded 328p or similar). It sounds to me like I need to recompile El Tangas' stuff if I want to pursue that on something other than 328p. Actually, I don't have the arduino 2560, must have loaned it to someone. It's either pursue El Tangas' way on big/fast enough AVR to host the code or wait for (or compile myself) avrdude improvements, though that would still be using the STK600 and might still fail mysteriously. Maybe somebody will figure out how to get STK600 to work. I would expect Atmel/MC would be interested in making it work, as they are selling the chip, and I doubt they want it to be this difficult/constrained as to how to program it and produce a running program. That or bag the 4809; there are plenty of AVRs that work great with STK600, though I was hoping to use the attractive patch bay on my clamshell board.
Thank you for your time and reply, clawson. I was aware of the documentation for SYSCFG0 and what bits are documented there well before js posted it (though I appreciate greatly his help too). I programmed F5 in a desperate attempt to make my SYSCFG0 look like his. If you read my post #41 you will see why I think there are undocumented bits in this register (around RSTPINCFG, at least). Similarly, I programmed bit 3 of SYSCFG0 in a desperate attempt to get myself a dedicated RESET pin, because I thought it possible that the chip was somehow getting stuck (after programming with STK600) in a way RESETting the chip might cure (and it did not cure it, placing a pullup on the now-RESET pin and bringing RESET low momentarily).
In any case, as I have mentioned, I can see (and visually verify) my machine code in the 4809 flash using AS7 to read it back, so the primary problem appears to me, my code is present on chip but does not run (even with STK600 then disconnected), and regarding rendering the programming for the chip inoperable (though you didn't mention the "12v" interface and such apparently surrounding this intrigue), I can still program the chip via UPDI (can see changes made over UPDI), so I don't think that is related to my problem. I am interested to note that others (think it was pgillard, above) apparently experience a similar problem to mine (using the STK600).
- Log in or register to post comments
Top- Log in or register to post comments
TopI agree with that sentiment. js mused that the bits coming back that are not documented might just be random, but I am not sure. I noted in #41 that the reset value is 0xc4, which has at least bit 2 set (100b), which is not documented, unless RSTPINC is actually two bits as potentially documented in the Atmel-ICE guide (https://www.microchip.com/webdoc...). Maybe bit 2 is UPDI as documented there, and bit 3 maybe is GPIO vs RESET. His value of 5 for the right nibble might thus be UPDI? In any case, my main problem, as I said, appears to be that my code is in the flash, but I can't get output from the chip, for a test program that works when js programs it via whatever the xplained board has (as opp to STK600 programming). Heartening is that I can get some output from the chip, though not apparently the right output, when I flash js's hex file. But I get 20 seconds of potential serial output from his program, where it should be very brief as it is just one or two lines of serial. I have not been able to see that the output is quite valid asynch serial with my TTL serial to USB cable or with my scope.
- Log in or register to post comments
TopI'm going to have to fire up my 4809 if only to see what default fuses I have!
- Log in or register to post comments
TopThat'd be great! What is your physical interface like? STK600 with QFP socket on board? STK600 with your own clamshell or other? xplained pro board? other?
- Log in or register to post comments
TopIt's the Xplained board.
- Log in or register to post comments
TopThank you for the reply. My experience so far with this thread is that folks who have the xplained board can run code on it, and even my initially posted psg.hex file will work on their boards, but not in other boards or housings for the 4809 (e.g. see post #8).
- Log in or register to post comments
TopWhat I'd love to see is for someone who is not using the xplained pro board to have success running code. I am not sure we have seen that yet in this thread. pgillard said he loaded code (as I did) with STK600, but rereading that post #8 I don't get the sense he was able to run code on a non-xplained-housed 4809.
Unfortunately the schematic for the xplained pro board doesn't shed much light on anything of note I have different with the 4809 I am trying to run on my non-xplained setup. It appears that all one needs to hook up is the pwr supply pins and the UPDI pin. Sadly there do not exist (that I have found) other published schematics (like, for the hackaday-publicized board in post #35) for 4809. At this point I do not know if it is my hardware environment for the 4809 or the fact I used STK600 to program it. (It doesn't appear to be my code because at least the CLKOUT portion of it appears to work for js when he downloads my code to his board - not sure about my portb toggle as he said portb was "high" but not sure what happens if he looks at my code running on his xplained board with a scope to see my intended high frequency toggle on portb). Though as I think about it, if I put js's "2 strings" hex file on my 4809, I do see varying output on CLKOUT and on his USART, though not the signals I expect on either pin (weirdly). So I have some evidence the chip can be made through software to do something, if not the intended thing.
- Log in or register to post comments
Top....fitted with bypass/ decoupling caps...did I mention this before?
(see how close to the chip they are in the Xplained board?)
If you fit a switch and a LED as described in the Xplained board plus a RS232 or TTL/USB adapter on USART1 I can post the latest code running at 20MHz, with the LED flashing (freezes when the switch is on) and sending strings out every time the switch is pushed or released.
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopI do have the ATMega4809 running successfully, with the chip programmed using the arrangement as described by El Tangas, as I mentioned in #8. His github site provides an avrdude.conf file which allows the device to be recognized. The programmer works fine in both W10 and linux. In fact, you don't actually need an Arduino, you could put an ATMega328 on a breadboard, with a 16 MHz ceramic oscillator, and load the programmer code into that. A 168 would also work, but you would have to recompile his source code.
I am presently using a small Arduino equivalent board, connected to and powered from a cheap CH340 USB to serial converter. As a programmer, it is much smaller and more convenient than the SDK 600.
- Log in or register to post comments
TopYes, with decoupling capacitors. I now have those as close as I can get them to the pins, that is, on the black pieces which allow access to each pin in my clamshell. I suppose it is still possible that an inch is too far away, but I am doubting this is my problem. I could try soldering my other chip to a breakout, there to put such caps rather than an inch away, a few mm away. Short of devising my own board or defeating the purpose of my clamshell, there's no way to get them closer. I doubt it is much of a matter if there is nothing between the caps and the pins electronically (or, in my case, anything remotely near these pins electronically) and the lines are shorter than an inch or two.
So far, with your code (thank you) on my board, I see output, but as I mentioned, 20 seconds worth of output from the USART (maybe not quite look right there on my scope, or the TTL/USB adapter I have), as well as non-regular output on CLKOUT. Hmm.
- Log in or register to post comments
Topjs, you said with my code the portb output was "high". Do you have a scope? Are the pins on your board for portb actually toggling at high speed with my code on your board? I like that we see CLKOUT, but would feel even better if we knew that my code was working fully as intended on your board at least.
- Log in or register to post comments
TopPossibly, I was just looking at the user LED on PB5. The scope is on another bench, I'll reprogram the board and bring it over the other side of the workshop.
By the way how sure are you of your clam shell arrangement? The pins are so close together that it would not take much to misalign them and have a short circuit or an open circuit on some pins
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
Toppgillard, can you elaborate on this? Other than trying out avrdude with his avrdude.conf file that has jtag2updi in it, I don't know what specific steps to try (don't know "the arrangement as described by El Tangas"). Does his stuff require the jtag mkii programmer? Have you had any success using STK600? What I want to be able to use (and have hardware for, is STK600, either with programming via AS7 or linux/avrdude). But when I tried his conf file with my avrdude, the avrdude program could not access the STK600, presumably because his conf file is not written to use STK600 with UPDI. Are you able to program your clamshell or breakout using STK600?
I am a little confused as to your hardware setup and what tools you are using to program it. Part of my confusion is I use STK600 and my own clamshell or breakout rather than xplained or arduino/arduino-lookalike.
- Log in or register to post comments
TopGood question; I am using a Yamaichi clamshell as in https://www.mouser.com/ProductDe.... It looks pretty solid in there . . . this clamshell has worked for various ARM chips . . . hmm. I attach the best pic I could easily get of it.
I guess to take the clamshell out of the picture I could solder the 4809 into a breakout. Maybe should wait a bit to see if pgillard posts again -- as I understand it he tried 4809 with clamshell and maybe breakout, but unclear whether his setup is one I can easily duplicate or even that I understand how to duplicate.
Attachment(s):
- Log in or register to post comments
TopThis:
https://github.com/ElTangas/jtag...
- Log in or register to post comments
TopSo stop worrying about the firmware, it all works as expected. I get the clock out on PA7 and PORTB is toggling at ~2.4ys.
This is with the hex file you posted above, not my build.
edit you picture shows the pins at left and right no making contact with the chip.
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
Topvia
via https://www.avrfreaks.net/forum/megaavr-0-series?page=1#comment-2475486
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Tophttps://github.com/ElTangas/jtag2updi/commit/237016cac1bb93b8de7462899b3d992b3e8d190e
due to https://www.avrfreaks.net/forum/megaavr-0-series?page=1#comment-2475636
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
TopThat code will not work as expected because there is no code to disable the divider so the chip will run @3.333MHz not 20MHz.
Can the divider be disabled by fuse? Don't know.
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
- Log in or register to post comments
TopThanks js. Re the clamshell, the contacts are a bit springy; when the lids is closed it presses the pins into the contacts. Still, could use up one of my two 4809s soldering it to a 48-p breakout to double check that (as I say, this clamshell has worked with ARM chips). hmm; also, with your 2 strings fw I do see 3v3-looking output on PA7, and that pin is on the left (pin3) . . .
pgillard, that is what I was trying to get avrdude to work (just the conf file). AFAIK that conf file is not set up to use stk600 with avrdude and linux; it cannot find or connect to the skt600 as-is.
gchapman: yeah, but does he post a schematic for the 4809? That's what I want, as . . . well, as noted in conv with js, my firmware (my program) is working fine in his setup, suggesting the problem is with using the sk600 to program it (but the flash readback from AS7 shows my program is there) or with my 4809 hw environment.
Darn.
- Log in or register to post comments
TopThe current release of avrdude (6.3) doesn't support UPDI yet, I think. You would have to compile the unreleased trunk version.
That's why I needed to edit the avrdude.conf file to tell avrdude to use the pdi interface instead. Basically, it's an hack that makes avrdude think the UPDI chips are xmegas, and only works with my programmer, which is expecting it.
Naturally, STK600 fails if you use old versions of avrdude and my modified avrdude.conf file. This avrdude just doesn't know what UPDI is.
To sum it up, STK600 might work if you compile the most recent avrdude development version, and use the respective avrdude.conf (which I edited to make my avrdude.conf). These can be found here: http://svn.savannah.gnu.org/view...
- Log in or register to post comments
Topvia https://hackaday.io/project/134831-atmega4809-developing-board-project/log/146590-blinky-test-on-ultra-4809-explorer
though with defect(s) at U1 (LDO); BOM may be in that project's log thread.
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
TopI don't use the STK600. It doesn't work in the configuration you and I have tried. The Arduino is the programmer, replacing the STK600. Load it with the code at github, connect it as shown in the readme, (a single wire to UPDI, and power and ground), get avrdude to talk to it, and you are good to go. There is an example command line for avrdude in the readme, as well.
- Log in or register to post comments
Top