Shop OBEX P1 Docs P2 Docs Learn Events
M48t02 — Parallax Forums

M48t02

Tricky NekroTricky Nekro Posts: 218
edited 2006-01-03 13:41 in BASIC Stamp
Hello to everyone
Merry Holidays

I have been resently suggested this SRAM for time keeping like the DS1302 the Parallax offers...
It is a parallel device and don't know how to haddle it...
Link to the docs http://www.futurlec.com/STMicro/M48T02-200PC1.shtml
Has anyone used such RAMs before...
With a 595 can I make it serial?

Regards, Provas, GReece

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--


provassiggy5yt.jpg

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2005-12-30 14:40
    Memories like these are the "easiest".· You just tell it whether you want to Read or Write, and specify the Address.· You'll require some shift registers to interface it with a STAMP (SIPO to set the Address from the STAMP, PISO to bring the Data back to the STAMP.)
    322 x 297 - 12K
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-01 00:52
    Thanks for your repply...



    Can you please be more specific about the shift-registers I must use...

    And I need exable code... Never writen in such a way before to Rams...



    Thanks again...

    Regards, Provas, Greece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-01 05:11
    A 74HC595 can be used as both a SIPO and a PISO.

    [noparse][[/noparse] I had to think about this again, because the RAM's Data pins are bi-directional (Inputs for Write and Outputs for Read, the Address pins are Inputs only.)
    I've only done this with EPROMs, which is why my original drawing had only the parallel-to-serial on the Data lines (I program the EPROMs with an EPROM Programmer/editor.) ]

    So, to Read Data you set the Read pin and·SHIFTOUT the Address, then you SHIFTOUT the Data.
    To Write Data, you SHIFTOUT the Address, SHIFTOUT the Data to be written, and PULSE the Write pin.

    As for "exable code"... do some research (SHIFTIN, SHIFTOUT, PULSOUT; and the RAM's /W, /E, and D0-D7; the 74HC595, too) and we'll talk some more.

    Maybe it's easier·to I2C, afterall -- given there's certainly a lot less hardware required when your micro-controller has special provision for it.· But my first experience with Memory was with SRAMs and EPROMs and there's a lot of it around.··Implementing a SRAM with a STAMP·will not happen with 3-wires, an IC, and a few instructions.·
    Whether it is worth the work is a question that only you can answer.

    [noparse][[/noparse]PISO = parallel in, serial out; SIPO = serial in, parallel out.]
    337 x 298 - 17K
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-01 12:27
    Ok...

    I know how to write to 595... I have used LCD, Led displays, 7-seg, Ir status and so on... But no SRAMs...

    I don't want to use the RAM itself ,although is quite usefull, but the clock it has... I've been given this RAM for free instead of the DS1302 Parallax offers... (Don't know if I can order free samples from Maxim)...



    Thanks for your repply...

    Regards, Provas, GReece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-01 15:23
    Reading the Clock ("The Timekeeper"), or Reading·from an Address,·is not a big deal.· However, you will have to set the Clock (set the time)·--·so, you will have to Write to the device [noparse][[/noparse]even if only once in a while: its stated accuracy is +/- 1 minute per month]·and that is the·complicated part.
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-01 20:27
    Please go on...
    I know nothing about this device... giving me an exable code maybe enough for me to go on...
    In meanwhile I'll try to figure out something...
    Thanks for your repply... I'll be waiting yours...
    Regards, Provas, GReece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-01 21:28
    I have just noticed that 2 Adress pin are off... There is no pin left at the 595...

    What will I do now... Please Advice...



    Regards, Provas, GReece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-01 21:42
    Two Address pins "are off"?· Broken off?· From the NVRAM?

    If there is still a tab, then you could probably use a low-temperature soldering iron and attach a wire.· If the pins are broken even with the body of the IC (no tab) then you can put it in "File 13."
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-02 01:34
    No no no no.... Not cut off...
    I have nowhere to connect them... A8 and A9...
    Should·they be connected?

    Please Advice....

    Regards, Provas, GReece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-02 03:44
    To Read the Timekeeper you will·need Address bits/pins·A0-A10.· The Timekeeper Addresses are listed on page 10 of the datasheet:
    1. 7FE (% 0111 1111 1001) seconds
    2. 7FA·(% 0111 1111 1010) minutes·
    3. 7FB·(% 0111 1111 1011) hours
    4. 7FC·(% 0111 1111 1100) day (Sun-Sat)
    5. 7FD·(% 0111 1111 1101) date
    6. 7FE·(% 0111 1111 1110) month
    7. 7FF·(% 0111 1111 1111) year

    There's an another Address for the Timekeeper Control Register (page 9.)· You can Read the data from the above addresses, but they will be updated during your read if you don't write % 0100 0000 to Address 7F8 (% 0111 1111 1000). Sending 40h freezes the Timekeeper registers till you finish your Read (the clock stays true, even though the time registers are not updated), then you would send 00h to Address 7F8.

    So, if you want to do some easy, non-STAMP experimenting first - you could look at the Seconds by putting LEDs on the RAM Data pins by hard-wiring the Address pins for 7FE along with the Control Pins (/W, /G, /E.) ·I have attached a schematic·if you are up for·a little fun.

    [noparse][[/noparse] I don't know what status the Control Register will be in (i.e. if its default =·Stop or Run.) ]

    There's another matter, the oscillator which the clock runs from needs to be put to sleep·-- the internal battery is not rechargeable.· The device will still "work" if the battery is dead, BUT it won't hold data/time without power.
    722 x 506 - 135K
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-02 12:00
    I'm a little confused...

    I never expected so many things that must to be done...

    Can you help me with the programm... I'm a bit rookie with parallel connections...

    A 595 can't be use as an adress shift-resister, so I don't know what to do...



    Please help me...

    Regards, Provas, GReece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2006-01-02 13:35
    Provas, you can use a 74HC165 to do the reverse function of the 74HC595. It is a shift register chip with input ports to read any parallel chip you want...


    BTW I have several DS12887 realtime clock chips that I want to use some day. The procedure to read/write them is simular, right?


    Thanos




    Post Edited (Tronic (Greece)) : 1/2/2006 1:39:23 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-02 15:01
    Provas said...
    A 595 can't be use as an adress shift-resister, so I don't know what to do...
    A 74HC595 is a serial-in, parallel-out shift register -- it is EXACTLY what you would use to transfer, serially, the RAM address.
    Transferring the Data from the RAM to the STAMP will require a parallel-in, serial-out shift register (as I'd written·once upon a time, and another concurs, the 74165 or similar.)
    The STAMP isn't all set-up to operate with a parallel RAM the way that it is all set-up to interface with an I2C device.· This is where the wheat and the chaff separate.
    You wrote that your primary interest was accessing the Timekeeper.· In my previous Reply, I went to some length and presented the information to you from the datasheet and made you a schematic for an experiment and all to lead you in the right direction, to get your feet wet.··It is elementary·and·you can actually SEE what is going on without having to use a STAMP at all.
    How about giving it a try?
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-02 15:21
    Well... What I'm trying to say is that Adress is an 10bit bus whereas 595 offers a 8bit bus!!!

    I saw your schematic and to tell you the truth, I didn't realise what it was for... Just blinking a Led???



    Thanks for your repply...



    BTW: Thano I don't think that the 595 is problem itself but the # of pins it has as outputs...



    Regerds, Provas, GReece...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-02 15:55
    My goodness.· Then I guess that I have to spell out every detail?· Attached is a schematic for cascading ("joining") 74HC595s.· To keep it simple, at this point, I would wire /OE to Ground.

    Yes, the experiment, if successful, would result in "blinking" LEDs --·so that you could see·whether it works, showing all of the outputs of the Seconds Register: no oscilloscopes, no "exable code", no "I think I fried my STAMP" boo-boo face stuff --·just rock-solid, undeniable, indisputable evidence, right·before your eyes.·

    This is what·I call "confidence building."· It's what I do when someone asks for help -- I help him.
    642 x 470 - 58K
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-02 19:11
    Sorry men...

    I haven't been working on 595 for a time now... Parallax offers a schematic who to cascade 595...

    I haven't been working on linked 595 since summertime , when the weather is finetongue.gif !!!

    The Stamp is able of lanching a 16bit array, right!!!

    Please go on... I'm generally something more that a nugget with a·bad memoryturn.gif... I prefer navigation codes... and controling my bot from distance... Only lately started to elaborate...



    Thanks for your repplies... and I'm keen on·waiting for·your next post...

    Regards, Provas, GReece

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-02 20:59
    I've been thinking about this.

    If you want to access only the Timekeeper (those registers), then you only need to send·4 Address bits to it from the STAMP.· You could send that over, easily, in parallel.· [noparse][[/noparse]You only "need" A4 - 10 if you want to use the RAM.]· All you need to send are A0,1,2,3 -- 4 bits.· You don't really NEED a shift register.

    So, what needs to be done is to rig the RAM so that it is READ only.· I have attached a schematic showing how to do this.· You NEED to write a program that will use P0,1,2,3 as outputs and P8-15 as inputs.· There is a table included with the schematic which shows how to "address" each of the Timekeeper Addresses (Registers.)

    Output the Address, Input the Data and store it in a variable.· I don't know if you are going to use an LCD or the Debug tool, that's your call, too.

    Use 1K resistors between the STAMP pins and the RAM pins (inputs and outputs.)· I would also prefer that all of the pins on the RAM that go to +5 would go through a 4.7K - 10K resistor (except pin 24.)

    That's it.
    378 x 538 - 70K
  • Tricky NekroTricky Nekro Posts: 218
    edited 2006-01-03 12:30
    Thanks for your repply that seems to be quit more logical than using so much coplicated code!!!!

    The inputs are set·as dirs and the output as outs... Programm question!!!



    Regards, Provas, GReece

    BTW I'll make it work as it is possible... should upload the whole project soon enough!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    provassiggy5yt.jpg
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-03 13:41
    It could be interesting, I guess.· I am not optimistic.

    You have no ability to set the clock.· I don't know if the oscillator is ON -- and you have no ability to change that.· I don't know if the Timekeeper registers are updating -- and you have no ability to change that.·

    I don't know if this is a used part or what.

    Details are everything.

    So, if nothing happens, it could be on account of this, it could be on account of that....· I'm anticipating a boo-boo face Post in the near future [noparse][[/noparse] "nothing works... and the STAMP·burns my finger·when I touch it..." ]

    I think that you should construct the circuit (provas_time.jpg) with the LEDs.· It's very odd to me how so many people post that they want to do this or want to do that, with the (un-stated) expectation that all that is required is some magical "code".· I suppose that you have no parts (no LEDs, no resistors.)

    This is bumming my trip.· I'm out of here.






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When you get 1st Place in the "Darwin Awards", you're a Winner & a Loser.
Sign In or Register to comment.