I have an external memory device with pin configuration:

  1. Data Input
  2. Data Output
  3. Connection
  4. System CLock
  5. DC 24V
  6. Ground

Here is the link

I need to design a code to communicate with this device.

I am having Explorer-16 Starter kit with PIC24FJ128GA010 microcontroller. So, I was trying to setup a test environment to check the module before proceeding with the final design.

But I am stuck with few points. Might be lacking concept.

  1. My first requirement is to provide a System Clock Signal to the device. Please suggest me the best possible way to get/generate clock signal for the device?

  2. Secondly, as per the memory device instruction, to start communication, Send Start/Stop cmd while clock signal is stable in the high state? How can I achieve this?

I am badly stuck with these two points. Please provide me a better solution. I am starting microcontroller after very long time. So need to brush up. Please help me with any addtional information.


3 Answers 3


You didn't provide any identifying information about the memory device you're using, so I can only answer in generalities.

  1. A clock signal is typically just a square wave at some frequency. Generally, a 50% duty cycle works for most systems, but there are some systems that have unique duty cycle requirements that must be met. A square wave can be generated many different ways. I'm not familiar with the Explorer-16 Starter kit, but I presume it has at least one PWM output channel. PWM stands for Pulse Width Modulation, which is just a fancy term for a square wave with a programmable frequency and duty cycle. You could also just bit-bang a digital output pin high and low. If you're designing your own circuit, there are components called oscillators that are precision tuned to output a square wave at a set frequency.

The most important thing, however, is to understand what the memory device requires. The voltage level, frequency, and duty cycle of the system clock must be specified by the device. That information can only come from the manufacturer in the form of a datasheet or something similar.

  1. The answer to this question is similar to #1. Only the manufacturer of the memory device can answer that question. There is no universal definition of what a "Start" or "Stop" command is. Is it SPI? Is it UART? Is it a proprietary serial protocol? Only the datasheet will have that information.

If you update your question to include which external memory device you're using, you're more likely to get a more specific answer.

  • \$\begingroup\$ Thanks for your answer. Here is the link for the Memory device I am using. I could have used PWM. PWM will make my task mush more easier but its mentioned as a System Clock. Please check the link. \$\endgroup\$
    – skg
    Commented Jun 10, 2015 at 12:33
  • \$\begingroup\$ I have also modified my question.If any other information required. please let me know. \$\endgroup\$
    – skg
    Commented Jun 10, 2015 at 12:35

This is a weird device. The internal chip is I2C, but the surrounding hardware separates the Data In and Data Out lines for communication to a PLC.

I recommend trying to talk to the beast with an SPI protocol, and the SCLK on the SPI hsould provide the clock functionality you need. Depending on your PICs implementation, you might need to actually WRITE 0x00 (which will result in 8 clock ticks) to do the read.


I found the solution for the issue.

I used I2C bit-banging method to resolve the issue and finally made it working.

I have posted the answer with other quetion. Please follow this [link]{I2C: Unable to Read Multiple Byte using Bit-Banging method}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.