RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sat Jul 20, 2019 8:07 am

All times are UTC




Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Sun Sep 29, 2013 11:00 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
So my feedback on the board after a weekend with it :) :
1. sdram swap/fs seems to work stable, no instabilities even when running more tasks over night
(it is 2x slower than the sramcpld ramdisk, but 4x bigger, thus in an average quite useful)
2. 2 sdcard's worked at 13MHz, the 20MHz needs to be tested more - here I would probably get rid of the SPI buffer chip when having only 1-2 sdcards hanging on it..
3. the programming header's pin layout is a NIGHTMARE :(
4. we need to think which specific pin shall be used as the bootloader's init pin (with pull-up!)
5. the board becomes warm when running more tasks with sdram fs accesses - not usable for ultra low power operations :), mind the RTC on it (probably a DS3231 would be a better choice)
6. Otherwise I like it ;), provided you will use 5 different colors for the LEDs :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Sep 29, 2013 5:09 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Great job Pito!

1, IMHO, 3MB/s is quite useful speed, I think. Provided we have 16MB of storage for 1,2EUR with no other components (except of a few resistor networks) it is good compromise between price, speed and board size.

2, SPI buffer chip is needed when having more than one SD card on bus, because we need to power off SDcard. If the card would be unpowered but attached to bus, internal protection diodes on SDcard data lines would be conductive and making high load on sensitive SPI lines, where communication with other card takes place. That's why there is buffer in path - when SD card is unpowered, data lines go into Hi-Z mode too.
However, in this board revision OE lines of buffers are connected by mistake to CS inputs instead of gates of PMOS transistors switching power supply.

3, Programming header pinout (GND-VDD-PGC-MCLR-PGD) is my own I use for years, before I even heard about PicKit layout (MCLR-VDD-GND-PGD-PGC). I think mine is better, because PGD/PGC are not on adjacent lines (if using flat cable between programmer/debugger and target device), but are separated by low-impedance MCLR line, so there is less cross-talk and ringing on those lines. Cross-talk is sometimes causing problems http://www.embedinc.com/picprg/icsp.htm
I can rearrange the pins to make it compatible with the rest of world.

4, Yes. Any suggestion?

5, Who cares about RTC on motherboards in laptops, with internal temperatures ~40-50 deg C? :-)
By the way, I thought of running retrobsd at few MHz. Consumption should decrease a lot. Are there any potential problems? Maybe SDRAM timing?

6, Feel free to unsolder LEDs and use what you want. I really hate blue LEDs, that's why I used only three colors :-) What more, blue and white LEDs do have Vf around 3-3,5V, making seris resistor selection difficult.
Any suggestions for five different colors, without one of them being blue? :)

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


Top
 Profile  
 
PostPosted: Sun Sep 29, 2013 6:05 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
4, Yes. Any suggestion?

Do we have a pin out on the headers, which has a pullup on it, and could be grounded before power up, and, worst case, can survive grounding when grounded during the normal operation (when doing a reset only in order to enter bootloader)?

Quote:
Programming header pinout (GND-VDD-PGC-MCLR-PGD)

I must admit it made me crazy, as I needed to flash the bootloader few times, and messing with jumper wires against pickit2 pin layout properly was something.. :) ..
I do not think there will be an issue with crosstalk, as the board is very small and traces short. I would highly recommend to have a pickit2 layout there.. Did not check that (for obvious reason), but maybe the pickit2 header might have got a good contact when attached to board's header directly (an optimal situation).

Quote:
Who cares about RTC on motherboards in laptops, with internal temperatures ~40-50 deg C?

The care is done by regular sync with an internet time server..

PS: when thinking about a new revision (if any), what would be the biggest sdram we can put there and operate? Having 32MB or 64MB chip there would be great, as we may run the entire stuff (I mean the OS fs) out of sdram, what would be fantastic..

AS4C16M16S-7TCN 16x16MB 1.5Euro/pc
MT48LC32M16A2P7 16x32MB 23Euro/pc :(

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Sep 29, 2013 9:16 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Oh yes, I remember.
PGC do have a pull-down resistor and is next to VDD pin (considering my programming header layout). This one was meant to be bootloader entry pin (when pulled high). Pull it up directly with jumper or via ~200R resistor and it will survive permanent pull-up even with RB1 output driver set to output low.
By the way, U3RX and U6RX do have pull-ups and near-by ground pins on pinheader. U3 is what I use for main terminal connection.

Seems like 32Mx16 memories in this package are not very common. I thing we need to settle down with 16Mx16.


Changes we mentioned above are relatively easy to do.
This is where manager decision should be made: start with 32MXSDRAM rev 1.1 or wait for PIC32MZ?

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


Top
 Profile  
 
PostPosted: Mon Sep 30, 2013 5:01 am 
User avatar

Joined: Sun Apr 21, 2013 8:46 am
Posts: 39
Location: Earth (by temporary assignment)
Is there anything I could help you out with, guys?


Top
 Profile  
 
PostPosted: Mon Sep 30, 2013 7:01 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Code:
This is where manager decision should be made: start with 32MXSDRAM rev 1.1 or wait for PIC32MZ?

:D no managers here fortunately..

I did my review of the 32MXSDRAM board, which is the best compact design today for retrobsd, and it could be used as-is, of course.

The programming pins layout change is just a nice to have, it is definitely not a bug, but matter of taste. The power consumptions is given by technology. You may run the whole stuff at lower clocks, for data-logging and control of a washing-machines 8MHz clock would be enough..

I would at least draw a v1.1 in your spare time with "improvements" we may discuss and a bigger sdram. It becomes a true retroboard when PIC32MX will become obsolete then :).

The PIC32MZ - here an sdram as a bitbanged swapdisk is not the best solution I think, as the external ram could be used for executing the code out of sram, so the board could be useful for other OSes as well. A bank of srams is needed there - in BGA packages, or, as used in the cpld ramdisk, the 16x2MB sram does exist in a flat pack - but expensive. The big Q would be whether the compilers will support banking or not, and when available.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Sep 30, 2013 10:10 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Well, I could not sleep during night, so I modified the board:
- hopefully fixed that terrible SDcard buffer mistake
- changed ICSP pins layout to match the rest of the world
- brought RB15 to header instead of RA9, so now we have RB8-R15 on it, completing 8-bit port
- changed TL431 package from SOIC to SOT-23. It is not powered continuously, but switched from RA9 pin in order to conserve some power
- SDRAM pads are bigger for easier soldering.

Now I have rectagle of cca 9x12mm of unused copper on bottom side, under RTC battery. I thought of placing DS3232 RTC on it, while leaving pads for original PCF RTC in place. User can decide whether to have cheaper or better RTC. Any better ideas to utlize this place?

By the way, DS2323 is quite expensive - about 4,5EUR locally. Triple the SDRAM price and 3/4 of PIC32MX price.

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


Top
 Profile  
 
PostPosted: Mon Sep 30, 2013 12:48 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
OK, during lunch break a added DS3231 (slightly cheaper than DS3232M) and because there was some spare PCB place, I added optional MCP9800 temperature sensor.


Attachments:
rbsd1.png
rbsd1.png [ 91.29 KiB | Viewed 15330 times ]

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Tue Oct 01, 2013 10:19 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
DS3231/2(M) does include a temperature sensor, which is readable (+/- 10bit).

FYI - be aware there is a difference between DS3231M and DS3231.
DS3231M - with MEMS resonator, Ibatt=2000nA, precision +/- 5ppm (-40+85degC)
DS3231 - with crystal resonator, Ibatt=840nA, precision +/- 3.5ppm (-40+85degC)

DS3232M - with MEMS resonator, Ibatt=1800nA, precision +/- 5ppm (-40+85degC), 236b ram
DS3232 - with crystal resonator, Ibatt=1500nA, precision +/- 3.5ppm (-40+85degC), 236b ram

FYI:
PCF8563T - external resonator, Ibatt=200nA, precision depends on the temp characteristics of the resonator and optional tuning capacitor temp characteristics

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Oct 01, 2013 11:04 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
What about bootloader gnd pin? Maybe RA9 could be used, with 100k pullup, and 2 pins header would be nice.
BTW the header could be used as analog REF output we still miss.

RA9 -- pullup -- 100k Vcc
RA9 -- 1k -- PIN(BOOT/VREF) -- tl431 -- Gnd.

Q: could be the pic32mx Vref input grounded?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Oct 01, 2013 4:54 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
I know DS3231 contains temperature sensor. Place for MCP9800 is optional (I had no idea what to put here), mainly those who use PCF RTC. You can still read both temperature sensors and compare results :-)

Bootloader entry pin is PGD/RB0 (to be pulled down) at this revision. There is pull-up resistor on board and it is next to GND pin.
Now I remember you had problems with RB pins. Was it beacuse of shared analog functionality? It could be turned off with one command (AD1PCFG = 0x0001; // for RB0). There is no problem in moving pull-up to another pin, however.

RA9 is no longer on pinheader, RB15 took its place.

There is not problem for PIC32 to have Vref grounded.

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


Top
 Profile  
 
PostPosted: Tue Oct 01, 2013 6:08 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I would not put something on analog pins (nor pullups or pulldowns).
I would put 2 ADS1110 16bit adcs (or the mchp equivalent) there. 6 pin sot package. With both inputs on a header.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Oct 01, 2013 7:18 pm 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
I agree on analog pins. I thought of using RC1 - it is next to VDD pin, it would have pull-down; jumper to VDD would invoke bootloader.

3-row main header is full. I can't add more signals (two analog inputs) here without sacrificing existing ones. After all, 16-bit ADC input routed next to digital lines is not the thing I'd like to see on two-layer board with SDRAM and 80-MHz MCU. I feel like internal 10-bit ADC is enough for RetroBSD (IIC is on main header, so you can add ADC externally).

Layout is here download/file.php?id=86 For 1.1 revision, RA9 is replaced by RB15
Feel free to submit ideas.

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


Top
 Profile  
 
PostPosted: Wed Oct 02, 2013 8:50 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Some more updates to schematics, cleanup and new main connector pinout.


Attachments:
File comment: Schematics (PDF), conenctor layout (PDF), layout picture (PNG)
rb.zip [110.2 KiB]
Downloaded 321 times

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/
Top
 Profile  
 
PostPosted: Thu Oct 03, 2013 9:25 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
FYI - I installed fubarino + sramc (cpld ramdisk) r.891 and did smallc make test:
Code:
2.11 BSD Unix for PIC32, revision 891M build 17:
     Compiled 2013-10-03 by pito@ubuntu:
     /home/pito/RETROCURRENT/retrobsd/sys/pic32/fubarino
cpu: 795F512H 80 MHz, bus 80 MHz
oscillator: HS crystal, PLL div 1:2 mult x20
console: tty1 (5,1)
sd0: port SPI2, select pin G9
PP Schema: (sramc0:sa@1500,fs@2572)
Found partition on sramc0 of type sa and size 1500
Found partition on sramc0 of type fs and size 2572
sd0: type SDHC, size 3872256 kbytes, speed 13 Mbit/sec
phys mem  = 128 kbytes
user mem  = 96 kbytes
root dev  = rd0a (0,1)
root size = 64000 kbytes
swap dev  = rd1a (1,1)
swap size = 1500 kbytes
temp0: allocated 18 blocks
/dev/rd0a: 605 files, 9455 used, 54294 free
temp0: released allocation
/dev/rd0c: 12 files, 12 used, 19908 free
Getting disk size for /dev/rd1b
Size: 2572 kbytes
Inodes: 160
Starting daemons: update cron


2.11 BSD UNIX (pic32) (console)

login: root
Password:
Welcome to RetroBSD!
erase, kill ^U, intr ^C
# df -i
Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  Mounted on
/dev/rd0a       63749     9456    54293    14%     606    3394    15%   /
/dev/rd0c       19920       12    19908     0%      13    1251     1%   /u
/dev/rd1b        2561        2     2559     0%       3     157     1%   /tmp
#
# pwd
/share/smallc
# time make
scc  -o hello  hello.c
scc  -o primelist  primelist.c
scc  -o primesum  primesum.c
scc  -o test1  test1.c
scc  -o test2  test2.c
scc  -o test3  test3.c
scc  -o gpio  gpio.c
scc  -o adc  adc.c
scc  -o rain  rain.c
scc  -o webserver  webserver.c -lwiznet
scc  -o q8  q8.c
       17.7 real         1.1 user        15.4 sys
#
# pwd
/tmp
# time make
scc  -o hello  hello.c
scc  -o primelist  primelist.c
scc  -o primesum  primesum.c
scc  -o test1  test1.c
scc  -o test2  test2.c
scc  -o test3  test3.c
scc  -o gpio  gpio.c
scc  -o adc  adc.c
scc  -o rain  rain.c
scc  -o webserver  webserver.c -lwiznet
scc  -o q8  q8.c
       16.7 real         1.1 user        14.3 sys
#

You may compare it with SDRAM swap/fs timing when Jaromir does it with sdcard@13MHz then (you need edit hello.c with re editor):
Code:
//extern int printf();

main()
{
    printf ("Hello, SmallC World!\n");
}

My SDcard writes 365kB/sec @13MHz SPI.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Oct 04, 2013 1:13 am 
User avatar

Joined: Sun Apr 21, 2013 8:46 am
Posts: 39
Location: Earth (by temporary assignment)
A few suggestions towards the hardware if I may. Which one will you take in consideration is entirely up to you.
1. The USB is good to have ESD protection diodes. I would also put a small ferrite on the Vbus line.
2. The two SD cards section could be much simpler. A typical SD card goes into standby after a few milliseconds of inactivity and then draws in the range of a few microamps. That makes enabling power through FETs unnecessary. If the whole idea is to conserve power, it should start from the power supply at first place (see below). Also, the pull-ups are only needed on the CS lines as once initialised as SPI master, the MCU drives the rest strong anyway. It is unclear to me what is the concept behind that 244 chip there since the two cards are separated by their CS signals anyway.
3. I am not quite sure what was the idea of having an external RTC (even two). Why not the PIC32's one? Anyway, if there is an external RTC, it is good to have the INT output fed into the MCU and possibly used as alarm source.
4. The selected power supply chip is good, but I would reccommend using a different one with positive logic enable input. That in combination with a pull-down digital transistor (MMUN2211 or similar) driven by the MCU, would make possible the board to switch off itself when needed. It would be (very) good to add a low ESR capacitor on the LDO's output. Something in the range 33-100uF maybe. C14 can be smaller. D1 can be set to a higher voltage - 10-12V at least. Also a cap may be needed in parallel with the clock battery.
5. R18 would be better to be moved before R1 and a 100n cap added in parallel with the reset button.
6. R9 and R10 are unnecessary low right now. Not a big issue, but a lot of current evaporates in the air. 10k (sometimes even higher) are completely acceptable values I think, speaking from past experience.
7. I would recommend replacing the MX795 chip with MX470. Completely pin-compatible, but the latter one is slightly faster, draws less current and have other nice additions such as PPS, etc.

I hope those might help.
Kon


Top
 Profile  
 
PostPosted: Fri Oct 04, 2013 6:27 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
I am not quite sure what was the idea of having an external RTC

The current of a pic32 in rtc mode is usually much larger (100x in this case) than with an external rtc chip. Therefore the pcf8563 with 200nA Ibatt current and the small 12mm 50mAH battery.
Quote:
I would recommend replacing the MX795 chip with MX470

We know that, waiting on real chips, which are not available yet..
Quote:
That makes enabling power through FETs unnecessary.

My idea has been to have the cards powered fully off for hot swap purposes, and, to have a chance to restart the sdcards in case of their lockup in a failure state, by powering them fully off/on..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Oct 04, 2013 8:00 am 
User avatar

Joined: Sun Apr 21, 2013 8:46 am
Posts: 39
Location: Earth (by temporary assignment)
As I said, it is completely up to you whether you will consider any of those or not. The term "we" as in "we know that" automatically puts everyone else offside.
I am just genuinely trying to help...


Top
 Profile  
 
PostPosted: Fri Oct 04, 2013 9:06 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
Kon,
"we" in this context means Pito and me. We talked through telephone and in person about the hardware.

1, Yes, good idea. Can you suggest any particular favorite USB TVS you use? Just to know what other use - I like to use TVS from Wuerth electronic.
2, The thing around SD cards because of possibility to power-off SD cards. I explained it somewhere in text above.
However, I'm still unsure about it.
3, There is room for two RTC's, but I assume only one will be populated. One is low cost, second one is precise. Feeding alarm output into PIC32 INT pin would be good. I'll try to find some spare pin.
4, There is a few 10u ceramic caps aroud the board. I believed this should be enough.
I thought of regulator with enable input too. But then I realized that board can "almost turn off" itself by placing MCU into sleep mode and turning off SD cards. I considered this as acceptable solution.
I'll rethink this, it may be good addition, after all.
5, I didn't put aby caps at MCLR line in order to not load this line when using programmer/debugger. By the way, what is purpose of this capacitor, considering we have power-up timer in PIC?
In fact, I don't even use any buttons at MCLR line in my devices, because I think only bad software needs reset anyway :) But a lot of people insist on it, so I put it there.
6, I use this value always. For smaller boards, 2K2 is maybe too low, but IIC is brought to pinheader, so I assume more capacity on lines.
7, Yes, you are right. But I can't buy it right now. MX450 is at Mouser, but 470 is still not at the stock. I designed board for 795, but anybody in future can use 470 when available.

Thank you for your valuable inputs.

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


Top
 Profile  
 
PostPosted: Fri Oct 04, 2013 9:54 am 
User avatar

Joined: Sun Apr 21, 2013 8:46 am
Posts: 39
Location: Earth (by temporary assignment)
Jaromir, see my comments below:
1. I don't have any particular favourite brand. Typically I end up using ESDA6V1, but there is some other interesting part from TI: TPD2EUSB30D, which I am planning to give a try as soon as there is a suitable chance. They are SOT32-3.
2. The SD cards section can be simplified. I stand by my suggestions there.
3. Makes sense. External RTC really can be much lower current. The two options for different types of RTC also make perfect sense. A cap in parallel with the battery would be good though due to the increasing internal resistance of the coin batteries with time of usage. I have to admit I have never used a single capacitor on the 32.768kHz crystal. If you have done it before and know the clock won't go off significantly, that's fine.
4. Maybe it will be ok. I agree there are a few caps spread across the circuit. It is just a little rule of thumb for me to add a large one on the LDO to cover any inrush events during power on and other situations. As to the enable input - that would be a nice feature, but also can be safely omitted.
5. Agree on that. In fact it was rather a bad idea to put the cap on the MCLR, but old habits die very hard. :)
6. The 2k2 resistors are fine. Just drawing a bit more current, but I guess people can live with that in favour of better signal waveforms.
7. Yes, unfortunately MX470 is not on the market yet. I expect that to happen any moment now and just wanted to point out the option. You already knew about it anyway.

If there is anything else I will write later. Just to make something perfectly clear: this is NOT any sort of criticism, because the board will work well just as it is. I am simply trying to give some collaborative input with my views about possible improvements.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3  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