RetroBSD

2.11BSD operating system for microcontrollers
It is currently Mon Oct 14, 2019 11:27 am

All times are UTC




Post new topic Reply to topic  [ 205 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 11  Next
Author Message
PostPosted: Sat Nov 24, 2012 10:15 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
For P's I tend to use these: http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=9103511 controlled by one of these: http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1757986

This is the circuit I usually use:
Attachment:
PFetSwitch.png
PFetSwitch.png [ 40.08 KiB | Viewed 14492 times ]

Reduce the mosfet pull-up resistor if you want faster switching.

Incidentally, the NPN I use (listed above) has a 10KΩ base resistor built in, so you can loose the base resistor from the circuit - saves a component...

I find it a good combination, but there is probably a better one you can more efficiently directly drive with 3.3V.

I am doing work with getting hot-swap working in the partition branch (http://retrobsd.org/viewtopic.php?f=5&t=5009) and we need some way of isolating the SD card that's going to be removed - powering it off is probably the best way - but it'd only really be needed on the secondary slot - the primary should never be removed, or the OS will crash. But then, there is nothing to say which is the primary and which is the secondary - you could boot off either - so maybe having it on both would be best.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Nov 24, 2012 10:24 pm 
Committer

Joined: Thu Nov 08, 2012 3:55 am
Posts: 177
If you can reliably hotswap on a single SPI port (without pausing anything) then there is no value in using a second SPI port.

I stopped testing it and have been working on the general crash problem. I have been running swap on the new sdram configuration without problems while working on the crash problem.

Moving the resistor from WE# (pullup) to CKE (pulldown) would make sense, I think. Leave the pullup on CE#. That would be my suggestion, anyway.


Top
 Profile  
 
PostPosted: Sun Nov 25, 2012 11:08 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Add 1meg resistors from sdcard's /cs to ground (sdcard device detection).
The pullups on cs/ are optional (leave them there, when using above trick do not populate them)..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Nov 25, 2012 8:52 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi All,

I would favor power up/down for both SDs as well as seperate pins to drive each. Hot swap only works for SD if ALL pins are less that 1/2 volt or so. So pullups should be to SD power not system cpu power!

2nd card could not be driven by its own SPI maybe? Do we have enough SPI ports?

Ideally RetroBSD tries to boot drive A and failing that tries drive B. So if drive A gets hot removed, the system eventually recovers and resumes running. Maybe a big order right now?

Other uses for 2nd drive seem to me to be. Image copying whole RetroBSD system. Writiing and reading MSDOS stuff on 2nd drive. Maybe multiple partitions. I believe this is working now in partition?

It would be nice to be able to use the unused portion of Drive A for an MSDOS compatible filesystem of some sort. We only use 16MB of 2 or 4 or 8 GB right now!

Wiz


Top
 Profile  
 
PostPosted: Sun Nov 25, 2012 9:01 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Jaromir,

Pins or pads to connect external panel mounted SD(s) (big ones) might be useful in some applications.

Board is getting pretty full :). Maybe this is on the wish list for now?

Are we tired enough to run a few boards yet :) ?

LOL

Wiz


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 8:52 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
wiz,
if you wan't to unplug power of SD card, you should place all remaining signals to low level. This is not possible, if there is communication on shared SPI bus. If you simply cut the power, SD card will be powered through internal diodes on data lines.
So if we want to have VDD switch (I'm not sure about this), we should have transparent drivers on SPI with tristate outputs too.
Pullups should be powered from SD power - which one? We have two SD card, thus two power lines.

Honestly, I'm still unsure about power switch on SD power, I have feeling like it's redundant. There is no need to remove power from SD card in order to remove card. Pins on SD card, as well as sockets are made to unplug first data pins and then power pins when removing card from socket. You only need to wait for erase/write operations to finish, then you can remove card and wait for reinsertion.
We probably don't have second easily available SPI bus

Pull-downs on CS are possible, though using it for detection of SD card is somehow clunky.

I'll put SPI connector on board.

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


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 10:57 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Well, parts around bottom connector routed.
No changes in schematics by now.


Attachments:
dr1_f.png
dr1_f.png [ 67.75 KiB | Viewed 14462 times ]

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 12:21 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Few remarks:
sdcards:
================
- could take 200mA each - pls consider that, maybe 2-3x10u ceramic each
- switch vcc - the only way how to get an sdcard from a "bad" state is to power it on/off. So the switches could be useful when we have a driver which attempts to recover the sdcard's state in case of a trouble (ie retrobsd as the board computer on a mission to Europa)
- pullups on respective vcc of course
- 1meg pull downs on /cs - you must not populate them, just make a place holder for them
- spi buffer - a single 244 can buffer two channels if needed, I would consider an external SPI channel buffered, though..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 12:50 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Pito wrote:
...retrobsd as the board computer on a mission to Europa

Did you mean missile?

For decoupling... OK, I'll do it a bit more powerful. Few more caps can't hurt.

I've never needed to get SD card from bad state. Maybe I'm lucky enough, but this just didn't happen.
If we will add power switches to SD cards, buffer would be definitely needed. Without buffering of signal lines, switching power is worthless - unless you put (shared) SPI lines on low level.
Now the question is - where the heck do I put the driver? There is not much space left :)
Something like 74LVX244 in TSSOP20 should do the job.

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


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 1:31 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
This is something like buffer with power control.
What about this one? I think I can manage to put it on board.


Attachments:
Clipboard01.png
Clipboard01.png [ 15.46 KiB | Viewed 14455 times ]

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 2:48 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Now this is getting really tough :evil:

I added SPI buffer and power switches. LED on 3V3 rail is there too, as fifth status LED.


Attachments:
dr1_g.png
dr1_g.png [ 67.71 KiB | Viewed 14453 times ]

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 3:12 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Jaromir,

Layout getting tough => Time to make PCBs !!

Looks *VERY* good to me :). You are a gifted PCB layout person. I got Eagle 5.11 free running here. Maybe I can load your PCB? Maybe even edit it? Haven't used Eagle for real stuff yet.

Not sure whether you plan a silk screen? Maybe not necessary?

If you do. I would mark connector pins with their CPU pin and if room their Port designation.

i.e.- P5-RA14 Pin 5 Port (Register) A bit 15. I think the Arduino insanity of labeling pins with their 'logical' (illogical?) names only confuses real engineers. Just my humble opinion :).

Can't wait until all of us see and can play with real PCBs.

Dusting off my ethernet plugin. Maybe I can get it to work in/under RetroBSD?

Wiz


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 3:22 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Jaromir,

SD cards from bad state?

In running RetroBSD: unplug SD and plug it back in. RetroBSD 'should' recover gracefully and keep running. VERY few systems are even capable of doing this. RetroBSD is NOT yet able to tolerate this kind of abuse.

Or to make it a better test. Unplug good SD, replace with bad SD, remove bad SD and reinsert good SD. System should gracefully pick up the pieces and resume running :). I don't know of ANY systems that can do this!

One of my SD interfaces has power up/down control and my prototype MSDOS PIC32 driver leaves power off on the 2nd SD and only tuns it on when accessed. Works VERY well :). If the SD has a valid filesystem it mounts and can read/write to it. If the SD is bad or there is no SD it gives the appropriate error message. When you reinsert a good SD things resume working correctly.

I wouldn't worry about this sort of feature for now. There are so many things that can cause this not to work correctly.

Amazing Layout :) :).

Wiz


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 3:31 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Nice..
Sdcard's:
1. with 244 we do not need 1meg pulldown on cs
2. pullups on sdrcard's /cs. di, do - I think they are still needed- when you go high with card's off signal, as first the 244's outputs go tristated, and then the voltage drops on vcc (caps). During this time I would keep pullpus there (ie 33k-100k). Pullups connected to their vcc.
2. If you breaks out with SPI then from the buffer's output (ie SPI2).

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 4:43 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
wiz: where could I upload it? It is made in eagle 5.10, free edition should be enough, as size is 5x5cm.
Yes, I'm planning to make silk screen, as Itead offers this as standard. Labeling the connector pins is good idea, though I don't know how to make labels automatically. I can do it manually, but it will be slow, boring and error-prone work. Labels would be useful from both sides of PCB, presumably.

Pito: Yes, you are probably right. I'll try how many pull-up's I can on board, starting with pull-up on CS, then Di and finally DO.
I didn't understand the thing with breaking out from buffer. Did you mean that I should break out SPI from signals to some SD card and not original PSI from PIC?

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


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 4:46 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
You do know that iTead have sneakily increased their prices by now charging $8.98 extra for delivery ...?

http://digital-diy.com/forum/chit-chat/a-sneaky-price-increase-from-itead-and-trouble-at-seeed-t2533.html

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 5:19 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Jaromir,

IIRC I found it in some project subdirectory and downloaded it since it looked interesting. I have never used Eagle and figured it was just another free to try program on the web?

After you said you were using it, I tried to install it on my Knoppix box. With the usual ''are you celebate?' sorts of questions it installed! Maybe it works?

Please try to search web for eagle-lin-5.11.0.run. Hopefully you will 'just find it'. Also, please give me your e-mail address.

Wiz


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 5:21 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Jaromir,

Just noticed your question. Silk screens ARE a real drag. Maybe Eagle has some shortcuts, like an ASCII file that can be edited?

Otherwise, I'd just ship the PCB and worry about it for Rev. 2.

Wiz


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 5:50 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Jaromir,

I just looked at cadsoft.de/eagle/program and found the current Linux version as: eagle-lin-6.3.0.run.

I am now downloading it. Maybe it is free? and useful? I would be *very* careful about 'upgrading' at this point. Better to keep your current version of Eagle and your PCB in a known working condition than take a chance by upgrading right now !! :).

Download just finished. Who knows? Maybe it will work usefully?

HTH

Wiz


Top
 Profile  
 
PostPosted: Mon Nov 26, 2012 5:58 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
@jaromir: when you going to break out an SPI port to a connector, do it from the buffer instead directly from pic32, that is my suggestion..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 205 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 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