Rapid design with Raspberry Pi + I2C - Page 1
Forum section: electronics / projects

author: TiN
author_rank: Super Contributor
timestamp: May 08, 2014, 06:59:34 pm
content: Hi all,Here's new weekend project for fun.DDR DIMM SPD Adapter for Raspberry PiAll computer DDR memory today have little I2C EEPROMs to store vendor, configuration and module spec information.This is done to allow computer to detect memory type, and configure memory interface to correct speeds and voltages according tomodule spec. This mechanism is based on JEDEC Serial presence detection specification (SPD) which isavailable for downloadSometimes it's needed to modify SPD and there are rarely available software tools to do so in-system.To overcome this issue design can be done stand-alone, with independent hardware to read/write EEPROM on memory module.Raspberry Piis one from hundreds of possible ways to do such, and it's easy and widely popular linux platform, whichenables lot of engineers to customize and discover new uses of ARM embedded platform.And since we don't want to modify anything on DIMM modules directly, there is requirement to have standard DIMM sockets,so user can easily interchange modules to perform SPD operations, without any damage risk or soldering.Basic spec for this little project* Open-source project, managed viadev.xdevs.comand mercurial DVCS* Full-size DDR3/DDR4 UDIMM/RDIMM slots to support most of standard memory modules* Standard header for direct connection to Raspberry Pi host* I2C EEPROM interface connection for Raspberry Pi port* Fixed +3.3V voltage level for SPD power* Power switch to allow swapping modules without RPI power down.* I2C address switch to enable multiple adapters to be used with single RPI.* Onboard MCU (LPC11U37FBD64) for future development/standalone operation without RPI (e.g. automation usage)Project file treeAll project files and documentation tracked byMercurial DVCS.It's free and well maintained version control engine, with syntax similar to git and SVN.So if you want to play with project or repeat by yourself, you can get tree by runninghg clonehttp://dev.xdevs.com/hg/ddr4sOr to view just some files you canbrowse project tree here

author: TiN
author_rank: Super Contributor
timestamp: May 08, 2014, 07:00:05 pm
content: Hardware designAfter few hours here is adapter board schematics (PDF format on click).Pretty simple design with minimal amount of parts. MCU section is optional and not required for operation with RPI.PCB Layout is done for 4-layer FR4, with silkscreen on both sides for assembly aid. All parts except connectors, switches and solid capacitorare SMD. Gerber files available "for download as well":http://dev.xdevs.com/projects/rpi/repository/show/gerberManufactured adapter (hand assembled board and bare PCB)Required parts for Raspberry Pi only operation:* Power switch SW4 (2-position)* I2C pullup resistors R10,R9 (2.2kOhm, 0603 5%)* Bypass resistor R7 (0-10 ohm, 0603 5%)* Decoupling capacitors C3,C2 (0.1uF 0603 X7R)* Bulk capacitor C4 (100-560uF 6.3-16V 7mm diameter, pin pitch 4mm)* 2.54mm 26-pin header for RPI extension port P1.* DDR3 240-pin DIMM slot* DDR4 288-pin DIMM slot (if required)All these components located in bottom right area.Bottom side have only optional decorative 0603 LEDs.Power, I2C, SPI and UART are routed from 26-pin header, which mates with Raspberry Pi expansion port just with straight ribbon cable.Adressing for multiple adapters is set via 2-position switches and indicated by LEDs. It's just usual A0,A1,A2 pin signaling for I2C EEPROMs.Onboard MCU is NXP LPC11U37FBD64 with SWD header for debug/firmware development. SMD crystal is 12.000 MHz, to support UART and USB.Overall kit looks like this:From top to bottom - DDR3 Corsair UDIMM, DDR adapter board, Raspberry Pi Model B with 2GB SD card and 26-pin 2.54mm cable.Using DDR3 module and connections:Using DDR4 RDIMM module and connections:Cannot use both DIMM types at same time, as there will be address conflict on I2C bus.Inner layers just carry ground and power. PCB stackup photo:

author: TiN
author_rank: Super Contributor
timestamp: May 08, 2014, 07:00:27 pm
content: Software designThis is step-by-step tutorial how to get fresh Raspberry Pi up and running for this project:I used minimal OS, as intention was only to use network-based connection to RPI via ssh.OS Image can be downloaded from origin here:http://www.linuxsystems.it/raspbian-wheezy-armhf-raspberry-pi-minimal-image/or fromlocal mirror. It's 120MB, so can take a little time to download.The root password is raspberry.* Add to /etc/modulesi2c-bcm2708i2c-dev* sudo apt-get install python-smbusroot@raspberry-pi:~# apt-get install python-smbusReading package lists... DoneBuilding dependency treeReading state information... DoneThe following extra packages will be installed:i2c-toolsSuggested packages:libi2c-devThe following NEW packages will be installed:i2c-tools python-smbus0 upgraded, 2 newly installed, 0 to remove and 32 not upgraded.Need to get 71.0 kB of archives.After this operation, 317 kB of additional disk space will be used.Do you want to continue[Y/n]? YGet:1http://archive.raspbian.org/raspbian/wheezy/main i2c-tools armhf 3.1.0-2 [59.5 kB]Get:2http://archive.raspbian.org/raspbian/wheezy/main python-smbus armhf 3.1.0-2 [11.5 kB]Fetched 71.0 kB in 1s (36.0 kB/s)Selecting previously unselected package i2c-tools.(Reading database ... 22286 files and directories currently installed.)Unpacking i2c-tools (from .../i2c-tools_3.1.0-2_armhf.deb) ...Selecting previously unselected package python-smbus.Unpacking python-smbus (from .../python-smbus_3.1.0-2_armhf.deb) ...Processing triggers for man-db ...Setting up i2c-tools (3.1.0-2) ...Setting up python-smbus (3.1.0-2) ...* sudo apt-get install i2c-toolsroot@raspberry-pi:~# apt-get install i2c-toolsReading package lists... DoneBuilding dependency treeReading state information... Donei2c-tools is already the newest version.i2c-tools set to manually installed.0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.* i2cdetect -y 1root@raspberry-pi:~# i2cdetect -y 10 1 2 3 4 5 6 7 8 9 a b c d e f00: -- -- -- -- -- -- -- -- -- -- -- -- --10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --70: -- -- -- -- -- -- -- --Install wiringPi libraryIf you have "wiringPi library":https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/ not installed, need to install it.Minimalist linux builds may not have gcc, make toolkit so need to install those as well.apt-get install gccapt-get install make* If get errors like:sudo: unable to resolve host raspberry-pi* Add line to /etc/hosts127.0.0.1 raspberry-pi* Now can install wiringPiroot@raspberry-pi:/rpdb/ddr4s/fw/wiringPi# ./buildwiringPi Build script=====================WiringPi Library wiringPi.c wiringSerial.c wiringShift.c piHiPri.c piThread.c wiringPiSPI.c wiringPiI2C.c softPwm.c softTone.c mcp23008.c mcp23016.c mcp23017.c mcp23s08.c mcp23s17.c sr595.c pcf8574.c pcf8591.c mcp3002.c mcp3004.c mcp4802.c mcp3422.c max31855.c max5322.c sn3218.c drcSerial.c[Link (Dynamic)][Install Headers][Install Dynamic Lib]WiringPi Devices Library ds1302.c maxdetect.c piNes.c gertboard.c piFace.c lcd128x64.c lcd.c piGlow.c[Link (Dynamic)][Install Headers][Install Dynamic Lib]GPIO Utility gpio.cgpio.c:85:12: warning: 'decodePin' defined but not used [-Wunused-function] extensions.c readall.cAll Done.NOTE: This is wiringPi v2, and if you need to use the lcd, Piface,Gertboard, MaxDetext, etc. routines then you must change yourcompile scripts to add -lwiringPiDevRunning test GCC-compiled software in putty terminal connection to Raspberry Pi's Debian Linux.References:JEDEC Standard No. 21C : Serial Presence Detect (SPD), General StandardJEDEC Registration - DDR4 DIMM PTH 288 Pin Socket Outline, 0.85 mm Pitch. SKTJEDEC 288 PIN DDR4 DIMM, 0.85 mm PITCHJEDEC Definitions of the EE1004-v 4 Kbit Serial Presence Detect (SPD) EEPROM and TSE2004av 4 Kbit SPD EEPROM with Temperature Sensor (TS) for Memory Module ApplicationsJEDEC DDR4 UDIMM Design Specification Annex DJEDEC Proposed Annex for DDR4 UDIMM, R/C BJEDEC Standard No. 21C : Annex L: Serial Presence Detect (SPD) for DDR4 SDRAM ModulesJEDEC Standard No. 21C : Serial Presence Detect (SPD) for DDR3 SDRAM Modules DDR3 SPD Document Release 6JEDEC Standard No. 21C : Memory Module NomenclatureJEDEC Standard No. 21C : Definition of the TSE2002av Serial Presence Detect (SPD) EEPROM with Temperature Sensor (TS) for Memory Module Applications

author: andy_silicon
author_rank: Regular Contributor
timestamp: May 08, 2014, 07:11:07 pm
content: Reprogram the I2C chip on some DIMMs?Or somehow use the RPi to test dimms?I.e. Change the contents of the SPD Eeprom ?

author: AlfBaz
author_rank: Super Contributor
timestamp: May 08, 2014, 11:13:14 pm
content: Quote from: TiN on May 08, 2014, 06:59:34 pmLearn to solder small header connectors with breaking the plastic?

author: tonyarkles
author_rank: Regular Contributor
timestamp: May 08, 2014, 11:19:27 pm
content: Memory tester?Carrier for multiple Raspberry Pi Compute Modules?Super slow RAM expansion board for the RPi?

author: free_electron
author_rank: Super Contributor
timestamp: May 08, 2014, 11:33:12 pm
content: speedtest rams and reprogram the SPD memory to overclock em ?

author: TerraHertz
author_rank: Super Contributor
timestamp: May 09, 2014, 12:08:55 am
content: Make a really big DRAM-based external memory for Raspberry Pi, accessed via a high speed serial bus?Effectively like a fast flash hard disk, but with no worries about write cycle fatigue.Edit: And hopefully some sensible access protocol, that isn't like the existing layers upon layers upon layers of crud, as used for hard disks.

author: TiN
author_rank: Super Contributor
timestamp: May 09, 2014, 04:18:45 am
content: Too easy, i shouldn't mention I2C in titleSoldering bodgery with wrong sized partsAnd yes, it's SPD programmer to read/write DDR3 and DDR4 DIMMs. Plus optional Cortex-M for future.It's doing nothing to memory interface itself, as there are much higher frequencies needed than ARM11 on RPI can cope with