Mémoire - FAQ & Guide

Mémoire - FAQ & Guide

Message non lude Lionel » Ven 15 Juil 2011 14:04

Mémoire - FAQ & Guide


Mémoire pin use


Digital (5 pins)
    D9 : user available Indicator Led
    D10 : SS (SPI Bus - Slave Select)
    D11 : MOSI (SPI Bus - Master Output, Slave Input)
    D12 : MISO (SPI Bus - Master Input, Slave Output)
    D13 : SCK (SPI Bus - Clock)

Analog (2 pins)
    A4 : DATA I²C (for RTC with DS1307 chip)
    A5 : CLOCK I²C (for RTC with DS1307 chip)

Going Deeper :
- SPI bus
- I²C bus

Mémoire Guide

To use "Mémoire" shield, libraries are needed :

SD Card Read/Write [SD]

    The board is compatible with the integrated SD library provided wtih Arduino 22 GUI.
    You just need to adjust ChipSelect parameter to match with the "Mémoire" design
    To check it works, you juste have to open Datalogger example located in examples SD/Datalogger and for Uno, 2009 and compatible replace the line

    Code: Tout sélectionner
    const int chipSelect = 4;

    with :
    Code: Tout sélectionner
    const int chipSelect = 10;

    Upload code as usual in the arduino board, unplug usb, insert SD card, plug usb, et voila, analog input 0 to 3 data are logged in a text file "datalog.txt".
    You'll just have to modify the code to match your needs, or be inspired by its structure to create your own.

RTC - Real Time Clock Use [RTClib]

    The board is RTClib (RTC Lib by Adafruit) fully compatible
    Last version we used succesfull was from 30/07/2010
    You can download the library here RTClib
    Once library installed, you'll be able to use the examples.
    To set date and time in the RTC for the first time, you'll have to use DS1307 sketch in RTClib example and uncomment the line 16
    Code: Tout sélectionner
    //RTC.adjust(DateTime(__DATE__, __TIME__));
    to sets the RTC to the date & time this sketch was compiled.

Contributed Librairies install, see below

Contributed Libraries
If you're using one of these libraries, you need to install it first. To do so, download the library and unzip it. It should be in a folder of its own, and will typically contain at least two files, one with a .h suffix and one with a .cpp suffix. Open your Arduino sketchbook folder. If there is already a folder there called libraries, place the library folder in there. If not, create a folder called libraries in the sketchbook folder, and drop the library folder in there. Then re-start the Arduino programming environment, and you should see your new library in the Sketch > Import Library menu.
(source Arduino.cc)


Howto : use Mémoire on arduino Mega

1. SD card read/write

What are we doing ?
We'll re-route SPI bus signals (used to talk to SD card) originally dedicated to arduino Uno to match with the Arduino Mega SPI bus.

Components needed :
Mémoire 1.0
Arduino Mega (ici un 2560)
4 Male/Male jumper wire

Tool needed :
Soldering iron / tin
Diagonal cutters

And let's go !! :

Step 1 : Get ready !

Step 2 : Using the cutter, cut the small wire inside the 4 solder jumper

Step 3 : Using a multimeter or a magnifier or your eyes, check your cut is clean and effective

Step 4 : Solder the jumper wires in the pads 10/11/12/13 (for Uno they are SS/MOSI/MISO/SCK)

Step 5 : Put the other side of the jumper wires in the corresponding arduino Mega Pins
    Mémoire pad N°10 -> pin 53 / Mega
    Mémoire pad N°11 -> pin 51 / Mega
    Mémoire pad N°12 -> pin 50 / Mega
    Mémoire pad N°13 -> pin 52 / Mega

Step 6 : Update check using a demo sketch

We'll use the Datalogger example to check everything is ok
It's located in examples SD/Datalogger of the arduino GUI

For the Mega, you'll have to replace the line
const int chipSelect = 4;

by :
const int chipSelect = 53;

This line modification declare the slave select pin is now pin 53 (and able to work with arduino Mega)
You'll have to use it in each sketch using SD librairie on arduino Mega

Step 7 : Enjoy

NB : This modification is not definitive, if you want to go back to Uno compatibility, you'll have to remove the wire jumpers and put a drop of solder on each solder jumper 8-)

2. Real Time Clock - RTC DS1307 - use

To use the RTC, you just have to link :
    Mémoire pin 4 with Arduino Mega pin 20
    Mémoire pin 5 with Arduino Mega pin 21

IMG_0217.JPG (92.8 Kio) Vu 3044 fois

And you can just use directly the RTClib examples as explained above.
Image - Distributeur officiel Arduino - Conception de shields
Avatar de l’utilisateur
Messages: 734
Inscription: Mar 21 Déc 2010 09:52
Localisation: Toulouse

Retourner vers Support for Snootlab Products

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité