This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430-3P-GCC-MSPGCC-TPDE: MSP430G2553

Part Number: MSP430-3P-GCC-MSPGCC-TPDE

Tool/software: Code Composer Studio

We have a project  in our scholl. Write memory  interfacing program in MSP430G2553 which is connected to SRAM whose memory 128K.MSP430 has not  enough pins for adress and data input / output bus.At the same time, how can we supply time delays necessary for our program ?

Sam

  • Hi Sam,

    Thanks for posting. It sounds like you have two problems - 1) not enough pins, and 2) timing control.

    If you are not set on which external SRAM device to use, you could try to select one with a SPI or I2C interface built-in instead of just a parallel interface- that would help to solve both of your problems. If you need to use this SRAM device and you have to use a parallel interface, you can either use an IO-expander to translate e.g. SPI to control parallel lines that way with only a few pins on the MSP430, or you could use a larger MSP430 device with more pins.

    For timing, if there are certain delays that you need to ensure e.g. certain delay between write operations, that can be done with timers in the device. If it's more of a write frequency control, if you are using SPI or I2C you can configure the USCI communications module to create the desired SPI or I2C frequency based on one of the clocks in the device. You can find generic SPI and I2C examples in TI Resource Explorer: dev.ti.com/.../

    You can find more information in these other threads: e2e.ti.com/.../649280
    e2e.ti.com/.../1308439

    However, I was wondering how the SRAM will be used in your application? The MSP430 can't directly access external SRAM as if it is part of it's own RAM, though you could create function calls for yourself to store data there, but of course the data is lost on power loss. Another option could be to use a large FRAM device like MSP430FR5994 on the MSP-EXP430FR5994 Launchpad - then you can use the internal FRAM as if it is SRAM with the added bonus of it being non-volatile.

    I hope that this helps get you started!

    Regards,
    Katie
  • Thank you for your aswer Katie.
    We have some solutions for our this problem.We use 74HC164 and HEF4014 shift registers in our solution .
    In our design we choose Cypress CYDMX128A16/CYDMX128B16 to use. This RAM is special RAM. This RAM has two ports. The two ports are: one dedicated time multiplexed address and data (ADM) interface and one configurable standard SRAM or ADM interface. The two ports permit independent, asynchronous read and write access to any memory locations. Each port has independent control pins: Chip Select (CS#), Write Enable x(WE#), and Output Enable (OE#). We determine to use right and we run it as a SRAM. At the same time RAM has a latch operation.
    Due to there in no enough pin on the MSP430G2553.Therefore we determined to serial input and output usage. There for we need to use shift register. To be able to decrease the excitation time we divided the register two part whose memory is 8 bit all of each. For Series input parallel output register we chose 74HC164 and for parallel input series output we used 4014 shift register. Because of we divided into two parts for all operation we need to two register. Totally 6 register are used from whose two of them parallel input series output and four of them series input parallel output.
    In the side of the programming, we determine the construct three functions to write address to register and write data two register and read data from register. In main function we control the ram are other enable and clock pulses and we call the necessary function which we constructed in our program.Then , thanks to the our program,implement 128K RAM space and communication to the our choosen RAM.

    But we have a problem in time .how can we supply time delays necessary for our program ?

    Regards ,
    Sam
  • Hi Sam,

    In a general sense, there are a couple of ways to have delays in an MSP430 program. For long delays and low power applications, typically you would use the timer module in the device so that you can have an interrupt when the delay time expires - you can find lots of timer examples in TI Resource Explorer: dev.ti.com/.../

    If you don't care about power and your program doesn't need to do anything else during the delay, you can also do simple software delays using the command __delay_cycles(x) where x is the number of CPU cycles you want to delay. For example, if I want to delay 10 CPU cycles, I would put a line __delay_cycles(10); in my code at the point where I want to delay. The amount of time delayed then depends on your CPU frequency MCLK. This depends on what you have configured using the clock system (BCS+ module) in the device. There's more information in the user's guide www.ti.com/.../slau144 chapter on the BCS+ module. On MSP430G2553 devices, generally you configure the MCLK frequency near the beginning of your program by setting BCSCTL1 and DCOCTL registers to a calibrated value stored in memory. You can find a good example of setting the MCLK to different calibrated frequencies here: dev.ti.com/.../

    Regards,
    Katie

**Attention** This is a public forum