Page 1 of 2

SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Mon Sep 24, 2018 5:31 am
by kricon
I was following (e)uzebox project for few years and I finally managed to get all the required parts so now Im ready to start making my homebrew euzebox, and I have few questions (with more to come along building, for sure).

Just now soldering, and I have LC Technology SD card socket module with integrated 3.3V regulator, it has 10k ohm pull up resistors to 3.3V for MOSI, SCK and MISO lines (and the one for DATA1/DATA2 lines not used in this project). As they arent in schematics, do I need to remove them? Because it wont be possible to remove after soldering 8x2pin header connector to pcb, and if needed it can be easy added at later stage on main pcb. I saw few mentions of it (especially MISO pullup lately) in some discusion here on forum but without clear answer.
Picture and schematic of sd card module in question.


I dont have much experience with Atmel AVRs (was using PIC in past), except burning hex onto atmega8 long time ago with own-made simple LPT programmer and PonyProg. If needed, I'll made SI-Prog or STK200-compatible programmer. After some reading Im heading towards STK200, and planning to use 4Mhz crystal on programmer board, because im not sure that it will work for programming on 28.6363mhz crystal and i dont want to mess alot with bits and fuses to avoid possibile bricking avr644. Also im unsure, do I need to write bits before or after flashing Bootloader_0_4_5.hex? Im open for any other programmer/programming suggestions, but i dont need expensive programmers so try to avoid it.


I'm building enclosure for it (if wanted i'll post pictures when finished and hopefully working), using short (~5cm), thin (0.24mm) unshielded wires to connect SCART socket onto pcb (wires soldered at both ends). I hope that wont be a problem, and i wouldn't have signal issues because of that?

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Tue Sep 25, 2018 5:34 am
by Jubatian
kricon wrote: Mon Sep 24, 2018 5:31 amJust now soldering, and I have LC Technology SD card socket module with integrated 3.3V regulator, it has 10k ohm pull up resistors to 3.3V for MOSI, SCK and MISO lines (and the one for DATA1/DATA2 lines not used in this project). As they arent in schematics, do I need to remove them? Because it wont be possible to remove after soldering 8x2pin header connector to pcb, and if needed it can be easy added at later stage on main pcb. I saw few mentions of it (especially MISO pullup lately) in some discusion here on forum but without clear answer.
Picture and schematic of sd card module in question.
Hi! I am not an electronic expert, hope someone comes along who can provide some better answer. However I think those pull-ups shouldn't have any adverse effect, so you can keep them, but you should most likely get rid of the 3.3V regulator, as there is (should be) one already on the Uzebox PCB, and it may not be nice to have two of those trying to feed the same 3.3V line. So make sure 3.3V is there everywhere where it should be 3.3V, fed by one regulator.
kricon wrote: Mon Sep 24, 2018 5:31 amAlso im unsure, do I need to write bits before or after flashing Bootloader_0_4_5.hex? Im open for any other programmer/programming suggestions, but i dont need expensive programmers so try to avoid it.
The order doesn't matter I think, you can set the fuses either before or after. If you worry about whether you can still access the AVR after setting the fuses (thus switching it over to the 28.6MHz oscillator), maybe program the bootloader first, so at least you should get a working Uzebox even if you can't reach it later with your programmer. I suggest using the newer bootloader though (Version 5.0.10) as it lets you using SDHC cards as well along with several other improvements. My recommendation for programmer would be the Pocket AVR Pprogrammer, it isn't too expensive, and for me it works all right for Uzebox.
kricon wrote: Mon Sep 24, 2018 5:31 amI'm building enclosure for it (if wanted i'll post pictures when finished and hopefully working), using short (~5cm), thin (0.24mm) unshielded wires to connect SCART socket onto pcb (wires soldered at both ends). I hope that wont be a problem, and i wouldn't have signal issues because of that?
You will see. I mean, literally, you should see how well it works on your TV, I doubt there would be any problem with it or even anything visible compared to other Scart Uzeboxes.

Good luck with your Uzebox! ;)

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Tue Sep 25, 2018 3:24 pm
by uze6666
Hi!

All that is required is already provided in the use of schematic. I'm not totally sure those pull-ups will play well with the voltage dividers. Let me confirm this tonight. For the voltage regulator, at first sight it seems you can use it. Using the one on your breakout would avoid adding an external one.

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Tue Sep 25, 2018 4:24 pm
by kricon
Jubatian wrote: Tue Sep 25, 2018 5:34 am Hi! I am not an electronic expert, hope someone comes along who can provide some better answer. However I think those pull-ups shouldn't have any adverse effect, so you can keep them, but you should most likely get rid of the 3.3V regulator, as there is (should be) one already on the Uzebox PCB, and it may not be nice to have two of those trying to feed the same 3.3V line. So make sure 3.3V is there everywhere where it should be 3.3V, fed by one regulator.
For pull-up resistors, im worried because CS, SCK and MOSI are pulled down to ground with 3.3k ohm resistors, so adding a pullup resistors will make voltage dividor at that lines, just like uze6666 said.
I dont have e/uzebox pcb so I'm making my own and will be using that 3.3V regulator on sdcard module instead of putting one on PCB. Anyway, it's (now) used only for SD card, and if needed LM1117 3.3V regulator on sd card module have enough juice to supply another 3.3V loads (if needed in future). As my pcb/box are somewhat small dimensions why not save some space if module comes with regulator preinstalled.

Jubatian wrote: Tue Sep 25, 2018 5:34 am The order doesn't matter I think, you can set the fuses either before or after. If you worry about whether you can still access the AVR after setting the fuses (thus switching it over to the 28.6MHz oscillator), maybe program the bootloader first, so at least you should get a working Uzebox even if you can't reach it later with your programmer. I suggest using the newer bootloader though (Version 5.0.10) as it lets you using SDHC cards as well along with several other improvements. My recommendation for programmer would be the Pocket AVR Pprogrammer, it isn't too expensive, and for me it works all right for Uzebox.
So, reading bits/fuses, burning bootloader.hex, if succesfull, change bits/fuses and write it. That way, for a new AVR, I wont need to have any xtal on programmer (i suppose its using internal oscilator if i dont change bits/fuses, and prolonging burning time)? Ill look abit more about new bootloader version, although i dont need SDHC support (I plan to put games onto 256mb sd card and forget about it, so just choosing game and play it, im not into developing games).
I appreciate recommendation, but its little bit on expensive side for me, for just one-time burning chip (and my entire euzebox populated pcb is cheaper than that programmer alone, so I'll rather made another one for friend for that price). I was thinking about cheap ebay programmers (2-3$ or something like that), but in first place is to make my own (simple & cheap) LPT/RS232 programmer (im not sure which one supports atmega644).
Jubatian wrote: Tue Sep 25, 2018 5:34 am You will see. I mean, literally, you should see how well it works on your TV, I doubt there would be any problem with it or even anything visible compared to other Scart Uzeboxes.

Good luck with your Uzebox! ;)
Yeah, you're right, better not to glue scart connector before testing. I suppose it'll be hard to change that later, as I need to mount scart connector right above pcb onto backpanel and entire pcb assasembly will be tied to front and back panel making it difficult for later changes.
uze6666 wrote: Tue Sep 25, 2018 3:24 pm Hi!

All that is required is already provided in the use of schematic. I'm not totally sure those pull-ups will play well with the voltage dividers. Let me confirm this tonight. For the voltage regulator, at first sight it seems you can use it. Using the one on your breakout would avoid adding an external one.
That would be great if you can test and experiment with pullup resistors! I suppose that I'll need to remove them, just unsure about MISO pullup resistor.

Thanks for reply, ill keep this thread updated how the progress goes. Hopefully someone will come along and help with building programmer as its now main thing that concerns me (suggestion which one to make that should support atmega644, im thinking about STK200-compatible or simple LPT programmer with PonyProg, and not sure if using 4Mhz xtal for programming is needed or I can burn .hex, set bites/fues without xtal, just arent be able to verify it afterwards)?

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Tue Sep 25, 2018 6:52 pm
by uze6666
Thanks for reply, ill keep this thread updated how the progress goes. Hopefully someone will come along and help with building programmer as its now main thing that concerns me (suggestion which one to make that should support atmega644, im thinking about STK200-compatible or simple LPT programmer with PonyProg, and not sure if using 4Mhz xtal for programming is needed or I can burn .hex, set bites/fues without xtal, just arent be able to verify it afterwards)?
I can't comment much on DIY programmers since I don't recommend them in order to eliminate that as a source of problem. That said, the ISP programming protocol is not only done via SPI, hence synchronous, but can be clocked very slowly to kHz. So I would not think and external crystal is a nessesesity.

I was rethinking about those resistors and would play safe and remove them to be identical to the standard circuit and not conflict with the 644 own pull-ups etc.

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Wed Sep 26, 2018 7:30 am
by kricon
uze6666 wrote: Tue Sep 25, 2018 6:52 pm I was rethinking about those resistors and would play safe and remove them to be identical to the standard circuit and not conflict with the 644 own pull-ups etc.
Can I ask you, when you'll have some spare time, to do testing with 10k miso, mosi, sck and sd_ce pullup resistors (if possible, with uzebox sdcard dividor resistors too) and if it misbehaves maybe try another bootloader? As saw in this topic, he is also using same sd card module reader and from picture it seems pull-up resistors is in place on his module. Interestingly, he had problems associated to sd-card (only on new bootloader), but fixed it by adding (another one?!?) pull-up resistor to the MISO line. Not sure if he changed sd-card reader or removed existing pull up resistors. Test results will also be good for others, as it seems that sd card module with pull-up resistors is commonly used (I saw one on video here and also another one which is actually custom euzebox/muzebox (like I plan to do mine) and as saw in this thread, he is also having problems with sd card not being recognized sometimes, he's using same sd card module but from pictures its unclear if he removed resistors), so it may help others to avoid possible mistakes.

I must note that uzebox resistors difers from euzebox. Uzebox uses 301 ohms connected in serial with MOSI, SCK, SD_CE lines and 562ohm connecting it to ground, and euzebox uses 1.8k ohm for MOSI, SCK, SD_CE lines and 3.3k ohm connecting it to ground. Combining that with 10k pull ups by calculating resistance in parallel, uzebox schematic divides voltage to perfectly acceptable 3.29V and euzebox to 3.42V which seems little dangerous, isnt? Even uzebox minimal schematics uses different resistors, 150ohm and 300ohm respectively, so I think their value isnt necessary to be exact, just diving SD card levels do 3.3v? Can SPI-RAM chip unexpectly behave because of that (pull down to ground) resistors if value is not as in uzebox schematics (mine is based on euzebox)?
Euzebox/F0lken also changed audio-output resistor to single 470ohm connected in serial, from uzebox 3.16k ohm connected in serial and 806 ohm pulling it down to ground. Interestingly, originall Clay Cowgill schematics shows 47nF capacitor connecting audio line to ground, wondering why/when it gets deprecated with 806ohm resistor to ground?



From idea of a basic (e)uzebox, I'm now thinking about making it a full-featured one, including SPI-RAM into build, as there can be new games which relies on it. I suppose its just plug&play, so just solder 23LC1024 into place and no other work is needed (like new bootloader or something), old games works fine and new ones recognize there is SPI-RAM chip and start using it?

Also, I aswell want to add a PS/2 keyboard module, because why not. I saw about Atmega168 keyboard/mouse PS/2 ports, but unfortunately not working yet, any new info from development? Whatever, I'll use AtTiny25 instead. I want to pre-install it into the enclosure, and having ability to use port2 for gamepad or ps/2 keyboard (all three ports on enclosure, so no external adapter-cables). Can I achive that with parallel connecting port2 with AtTiny25 but placing a power switch for +5V (or GND?) then as AtTiny is not powered, Port2 should work for SNES controller, right? Or its better to put toggle switch between Data2 of Port2/AtTiny25?

And maybe I want to add a ESP8266 module, just curious if I can do it right now, as plug&play, without need to modify anything? Just to sit there powered and unused until multiplayer games became a thing, then I'll have hardware ready. Does ESP12 need to be prepared/updated with FDTI USB cable (I have one, but never used it), or it can be done from sdcard (I think I read somewhere about ESP12 firmware updating from Atmega644).


Is it possible to combine SCART and Composite thing? I do have SCART (RGB) output already mounted, and got idea of using composite/svideo embedded into scart connector, so with just cheap scart-composite adapter I can connect my console to almost any TV not just one that accepts RGB signal. Of course, I still need AD725, and I see no reason why that two standards wouldnt work together? RGB lines goes thru resistors to SCART socket, and afterwards goes thru capacitors into AD725, making (e)uzebox simultaneously outputs RGB SCART and Composite&Svideo output. When talking about video output, does e/uzebox supports component video output? I have SCART to Red-Green-Blue component cable with audio, but curious if component standard (frequency, etc) would support this console?

BTW, for programming, I have one custom made Arduino (I think its based on Adruino nano with FDTI integrated), but never used it, i think ill give shot to stk200-based programmer with ponyprog.

I apologize for somewhat long post with lot of questions. I was really amazed with Uzebox project since first time saw it many years ago, and now Im making one myself right into enclosure (relatively small at 120x75mm), and dont want to get things wrong. The AVR, their bootloader and self-programming thing is new to me as I was get used to PIC microcontrollers. Thanks for answers, really appreciate that!

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Thu Sep 27, 2018 1:33 am
by ry755
kricon wrote: Wed Sep 26, 2018 7:30 am As saw in this topic, he is also using same sd card module reader and from picture it seems pull-up resistors is in place on his module. Interestingly, he had problems associated to sd-card (only on new bootloader), but fixed it by adding (another one?!?) pull-up resistor to the MISO line. Not sure if he changed sd-card reader or removed existing pull up resistors.
I didn't remove the resistors, since it looks like they're just used for level conversion (5v -> 3v3). And yeah, adding the pull-up resistor to MISO fixed the issue with the new bootloader.

Plugging the SD module directly into the breadboard instead of using those long wires also made it more stable.
kricon wrote: Wed Sep 26, 2018 7:30 am BTW, for programming, I have one custom made Arduino (I think its based on Adruino nano with FDTI integrated), but never used it, i think ill give shot to stk200-based programmer with ponyprog.
You can follow this tutorial to use your Arduino as an ISP, then after wiring it up run this avrdude command (replace /dev/ttyACM0 with the correct port):

Code: Select all

avrdude -p m644 -b 19200 -c avrisp -P /dev/ttyACM0 -U flash:w:bootloader.hex

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Thu Sep 27, 2018 4:08 am
by uze6666
Receiving the family so I probably won't have time to test this until a couple days. :?

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Tue Oct 30, 2018 4:25 am
by kricon
ry755 wrote: Thu Sep 27, 2018 1:33 am I didn't remove the resistors, since it looks like they're just used for level conversion (5v -> 3v3). And yeah, adding the pull-up resistor to MISO fixed the issue with the new bootloader.
I was busy on an trip away from home and life things get in way so left the project 'in a drawer' for a while.
Just again checked the resistors with multimeter, and they're straight pull-up resistors, so no voltage dividors for level conversion.
In the meantime, I have bought arduino uno r3, I'll use it as programmer, thanks for instructions.
uze6666 wrote: Thu Sep 27, 2018 4:08 am Receiving the family so I probably won't have time to test this until a couple days. :?
I'm so sorry for taking your time, but I'm still not sure should I remove 10k pullups from SD card module or not, and which resistors to use as sdcard voltage dividors (uzebox/euzebox).
Also, there is change in oscillator capacitor value from older uzebox schematics, from 22pF to 18pF. Euzebox still shows old 22pF. Is there any real difference using one or another or I can place whichever one I have at hand?




I'm now ordering more parts for my homebrew (e)uzebox, and have few quick questions (posted before but without answer), just to make sure not to order something wrong:

For SPI-RAM, the chip in question I need to order is 23LC1024?
I suppose its just plug&play, so just solder 23LC1024 into place and no other work is needed (like new bootloader or something), old games works fine and new ones recognize there is SPI-RAM chip and start using it?

For keyboard module, I'll order AtTiny45/85 instead as its cheaper/more common, I do hope provided .hex is fine for these?
I plan to solder AtTiny onto mainboard, and have all three SNES Port1, SNES Port2 and PS/2 keyboard ports on the enclosure box.
My question is should it work if I just add a toggle switch between Data2 (Atmega pin 39), SNES Port2 and AtTiny to select if I want to use SNES port2 or PS/2 keyboard connector?

WiFi seems interesting, and I plan to order ESP8266-12 module aswell.
Can I just connect it, without need to modify anything, just to sit there so I'll have hardware ready if WiFi uzebox games became a thing?
Does ESP12 needs to be configured with FDTI when I'll want to use it later, or it can be done from sdcard (I read somewhere about ESP12 firmware updating from Atmega644)?

Re: SD Card pullup resistors, atmega 644 programmer, few questions

Posted: Wed Oct 31, 2018 2:47 am
by D3thAdd3r
For ESP12, they should all come with a semi-recent firmware. Currently there is no firmware flashing utility for Uzebox(though this should be possible and desirable). I guess there is no official firmware anyways, except perhaps that many probably have the same from the factory of the later versions. So..not sure what to tell you on that, but you are in the same boat as most others I think until the utility exists. I would leave it for now personally.

The ESP8266 and the SPI Ram are fairly easy to add to an E/Uzebox. I did it on a prebuilt official E/Uzebox PCB from Hartmut with some jumpers. That I know, the schematic was never updated, so you would need to consult the latest Uzebox revision for those pieces.

I think I flashed the prebuilt hex on ATtiny85s and it worked, otherwise I had assembled it, can't remember for sure. I would guess your switch idea works. I hope it does work, as I'd like to do something similar if you succeed with it.

Other stuff on pullups/etc. is out of my depth, but I would follow the schematic as closely as possible if you don't want to spend much time experimenting and troubleshooting with it. I think there is some possibilities of borderline cases, maybe combinations of soldering issues, the particular card, and the gravitational pull of the moon that can cause SD issues. It avoids a dedicated level shifter IC, and thus the original 2 chip console concept!...er I guess just 1 for E/Uzebox! Well, an optional 4 for the expanded Uzebox of course, something for everyone there! 8-)