RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Aug 22, 2017 3:18 am

All times are UTC




Post new topic Reply to topic  [ 205 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next
Author Message
PostPosted: Sun Nov 18, 2012 12:28 am 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
That looks good to me. Since manipulating the DQM signals during a burst would be difficult (and take more kernel ram), i''ll probably treat the upper/lower bytes as super banks and pre-select in the c-code before calling the assembly. Net result would be twice the memory with an extremely tiny performance hit. Given the improved address layout the net result is probably a wash with respect to performance.

Actually, would it cause problems to swap the RF0-2 and RG0-1 (adding RG2)? I currently use RF2 as part of the console. If anyone needs/wants RG2 for something then I retract the request.

I'll wait for some consensus before I start rewiring, just in case someone really needs one of the pins you've assigned.


Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 12:37 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Yes, I thought of that, as I realized that RF2 is part of USART1, but RG2 is D+ line on USB peripheral, so USART1 is smaller sacrifice. There is a few other USARTs left.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 1:03 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
You may use the ldqm and udqm as an A13 address signal I think (with an invertor between them). Need to check the signals work as expected..

Nope, you cannot.. They must be controlled individually..
Or, they can, when we do not need do highZ with them.. That needs to be elaborated somehow..

UPDATE: when adjusting the driver - pls do it such it will start with D0-7 in the first 8MB and with d8-15 in the second 8MB block:
0-8MB ... LDQM LOW
8-16MB ... UDQM LOW

Then we may populate 8MBx8 chips as well..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 12:22 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
So, first iteration of schematics.
SDRAM connection as before, SPI utilizes SPI4, USART 2 and 6 on separate pinheaders, JTAG too (or it can be used as 4 GPIO), long pinheader with power and 11 GPIO, 4 of them analog pins. There is a bit of free space on board, I would place there few more headers.

TODO: add lithium battery holder for RTC backup, place headers into 2,54mm module, rethink RTC choice, add reset button and probably user button. There will be a bit of unused space on bottom part of PCB.


Attachments:
File comment: PCB case study
dr1_a_p.png
dr1_a_p.png [ 27.35 KiB | Viewed 4937 times ]
File comment: bsd schematics, first try
dr1_a.png
dr1_a.png [ 70.7 KiB | Viewed 4937 times ]

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 3:20 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
The board is half empty (or half full?) :)
I think you have to go with 0603 for this design.. 0805 only with 10u caps..
Try to put all the big stuff there and I would add to the schematics then..

I would go with cr1220 that is 15mm dia socket. RTC - ?? I am a fan of PCF8563 (0.4Euro, 200nA) needs 2 diodes.

Rear connector - would it be even possible to have there 3 rows @15pins with 2.54mm pitch?? (so no space between the rows)? And everything on it (a 3x15pin block) with round pads maybe (to be able to break them out).

We need an usr button or jumper - for uploader..

The usb - I would place it fully left, leds in the middle, sdcard right.

Well done! Waiting on 2nd iteration..

Some points to power and sdcard from older designs:
Attachment:
sdcard.jpg
sdcard.jpg [ 8.08 KiB | Viewed 4932 times ]

Attachment:
power.jpg
power.jpg [ 8.68 KiB | Viewed 4932 times ]

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 3:59 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
The board may look half-empty, unless you start routing it. I think it will not be trivial job.

PCF8563... are you using cap trimmer on OSCI pin? I don't feel like I want it on my board.
I looked on other RTCs, like MCP79410. it looks reasonable.

Pinheaders in 2,54mm rows, pull-ups, buttons are on todo list.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 5:49 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
RTC - yes there should be a capacitor, not trimmer however. A 0805 capacitor, usualy 15pf. Make a semifinal schematics and I will comment details then..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Nov 18, 2012 6:57 pm 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
You'll want to put bypass caps on the sdram power pins.

Oops - there are caps for the ram. Seems I missed them hiding there in plain sight.


Last edited by madscifi on Mon Nov 19, 2012 7:31 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 6:54 am 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
The new layout has been wired. I had missed the fact that E0-E3 are tied to leds on the UBW32, so I pulled the led resistors off the board along with one led and a bit of trace by mistake (I need more practice removing tiny parts on fragile boards).

At this point the code consistently reads from the ram, at least within the lower 4 megs (I don't know if the upper ranges work reliably or not). However, writes are randomly scrambled. It seems to be ground related. The number of chunks that fails seems related to how I set up the ground paths between boards. The exact location that fails is variable, but it tends to fail in similar locations and frequency depending on the ground connections.

Often the failure is that a chunk of 8 bytes is rotated one byte - this is consistent with the ram chip picking up the wrong row address on writes.

My breadboard is a UBW32 and some wirewrapped protoboards, so that alone might explain the problem. Moving to a small PCB with good grounding might solve the problem. Or, the fact that the data lines are connected to two different data inputs on the ram might be contributing to the problem (even if it is the problem might disappear on the PCB).

While it is still possible that the problem is due to a coding problem and I'll keep looking for a bug that might cause this, I think that the most cause is grounding/signal issues. I'll probably try cutting the connection between the lower and upper byte on the ram chip to see if that offers any improvement.

Update: I just cut the wires between the upper and lower bytes of the sdram and writes are now reliable (for simple testing values of reliable). At this point there are too many possibilities to say for certain what the problem is, but if you do connect the upper and lower data bytes on the ram I'd suggest making it easy to cut the connections in case it turns out to be necessary.


Last edited by madscifi on Mon Nov 19, 2012 7:33 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 7:33 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
madscifi: hm... though it is likely problem of grounding/decoupling etc.., it doesn't look very optimistic. Did you try to put small capacitors, few dozens of pF on some sensitive lines, like CLK or WE? It may help to reduce signal bounce problems on longer lines.

Should I wait for your results before trying to finish the board?

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 7:45 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
You may try ie 220ohm resistors in series with CLK, WE etc.
Check UDQM, LDQM handling again - it might be a collision on the common data bus..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 7:47 am 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
There was an earlier attempt to share data and address lines and I was never able to get that to work reliably. It is probably my testbed as it is known that they can be shared.

I'd go ahead and wire the upper and lower bits together, but expose the connection between each upper and lower bit so it can be cut after soldering on the ram chip. Maybe small inline resistors on the data lines between the cpu and the ram - maybe there too much instantaneous current draw when switching with both ram pins connected (really conjecture here)?

Pito - I'm pretty certain the DQM signals are not the problem. They are set at the start and then, due to the address range involved in my testing so far, left unchanged. I guess a good test would be to connect the upper-lower data bits back together and then physically wire UDQM high. That would eliminate any possibility of a collision between the sides.


Last edited by madscifi on Mon Nov 19, 2012 7:55 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 7:50 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
Check again the LDQM and UDQM in your driver. Maybe there is a bug where you not setting one of those HIGH (highZ). Both LOW means crash..
They must be changed - otherwise you get crash on the common bus:
0-8MB .. LDQM LOW .. UDQM HIGH
8-16MB .. LDQM HIGH .. UDQM LOW
Never both LOW..
The easier way to test is to hardwire LDQM LOW and UDQM HIGH, and run the tests in 0-8MB.
That is equiv. of cutting the bus wires. If not, then the DQM stuff does not work as expected..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 7:55 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
If it worked in one pin configuration and doesn't work in another, it sounds like signal bounce or crosstalk problem due to changed trace lengths. 10cm of wire can be problem here, because SDRAM is likely to have fast input stage, catching ringing signals. Reducing slew rate (adding capacitors or serial resistors) is likely to reduce such as problems.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 7:59 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
Yea, and use 100-300ohm resistors instead of wires on CLK, WE and other control signals if required..
And 2k2-2k7 or so pullups (at pic32 side, the vcc3v3 point good decoupled) on
UDQM LDQM WE CS
(it may float somewhere ie during reset and thus create bus collisions with high current peaks)..
Bus collisions - not only between two data banks, but between portE and data bus direction too..
@jaromir - even it will work on the testbed finally, I would recommend to put above 4 pullups and 100ohm serial in CLK, WE (close to pic32 pins) in the final pcb design as well..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 9:44 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
OK, second revision.
Changed most passsives to 0603, changed RTC to PCF8563, added battery for RTC, headers put together, pull-up resitors around SD card, VTS diode on external supply, RC network on USB shield, reset button.
Pull-up resistor on PGC programming line. It doesn't interfere with normal programming-debugging functions, but programming header can be repurposed for entering bootloader with jumper between VCC and PGC line.

No resistors around SDRAM for now.


Attachments:
File comment: pcb case study
dr1_b_p.png
dr1_b_p.png [ 29.76 KiB | Viewed 4901 times ]
File comment: bsd board, second revision
dr1_b.png
dr1_b.png [ 71.2 KiB | Viewed 4901 times ]

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 10:11 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
sd card:
sckl shall be pulldown
cs shall be pullup

power: 5V zener at 5V usb? it might take 100mA.. use rather serial as depicted above on my picture - use 2diodes in 3pin smd as we need either
a) power from usb (VBUS=5V vid diode to LF33),
b) an external source available from a rear connector pin as well (via diode to LF33).

rtc - do not use 2diodes in one package, but 2 separate diodes - one planar epi Si 1n4148 like (from battery) and one schottky (from 3v3). It reduces current drain from battery then (because 3V3 Vcc is too close to 3V of the battery)..

buttons - always use ~330-560ohm in series with buttons (big issue on fubarino)..

usb and sdcard are too close - mind a manipulation with it - I would rather place the usb left, the leds in the middle, sdcard right hand side (current pcb view from top)

rear connector - hopefully it will be 2x15 finally :)

crystal 8MHz - is that package a common one??

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 10:27 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
pito:
yes, pull-up up on CS adn pull-down on CLK. My mistake

6V8 TVS on power line is part of normal design practice

schottky diodes have quite huge reverse current. It is nice that RTC itself consumes 200nA, but if reverse current of diode will be 500nA, it is pointless.
What is Vf of normal silicon diode at 1uA? What about Vf of schottky at 1uA?

resistor in series with button is probably good idea.

don't want to move SD card and USB for now.

this package is common for 12MHz crystals, hopefully it is not a problem. I use 12MHz crystals with PIC32 a lot, few lines of config have to be changed.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 10:49 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2396
Location: Rapa Nui
Quote:
6V8 TVS on power line is part of normal design practice

Not aware of that, shunt diodes ok, but serial are better.
I think we need following setup with power:
a) sourced from USB only (diode from VBUS to LF33)
b) sourced from rear connector only (diode from rear pin to LF33)
c) the LF33 input and otput available on the rear pin header
d) the input voltage could be 6V-7,4V then (4xAA, 2xLion, 2xLipo)

Quote:
schottky diodes have quite huge reverse current

What you need is to have V on rtc higher than Vbattery in such way the current from battery will not leak out into the rtc when rtc is powered. Try to simulate that and you may see. It is basically not an issue, you may loose stnby current from battery then.

Xtal - 8MHz is standard with bootloaders and settings, you have to rebuild then, not sure the package is common

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 19, 2012 11:04 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Yes, I need to add diodes to allow double supply - USB or external. External supply will be 3,6 to "many" volts then. Many is determined by power loss on LF33. I assume more than 9V anyway.
3V3 output is already on rear connector.

I know it will not leak into powered 3,3V rail :) But we need to take unpowered state into account - battery will leak through diode into power supply if power is off.

8MHz crystal: http://cz.mouser.com/ProductDetail/Epso ... 52b3pkM%3d
For 12MHz the only change you have to do is to change one setting is config bits - crystal divider.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 205 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission