2
\$\begingroup\$

So basically, I'm wanting to finally get into electronics. A little while ago I bought a few MCP3008 chips and analog pressure sensors. I've been wanting to build an compressed air system with it.

However... I want to avoid using a microcontroller.

I've done a lot of programming in the past, and I tend to like being able to debug things. So I was wondering; Is it possible to replace a clock signal with a simple button? The reason being... I want to slow down the clock so I can manually figure out how to work with the SPI. Possibly using some LED's, buttons, etc and recording the results.

I understand that buttons may need debouncing, etc... but would it work?

For the past hour or so, I've been googling around for an answer, and nothing definitive came up.

After looking at the datasheet for the MCP3008 here: https://www.adafruit.com/datasheets/MCP3008.pdf

It seems that the minimum clock low/high time is 125 nanoseconds; there's no max listed. Does this mean if I hooked up a debounced button as a clock signal, it would work fine?

Thank you in advance for any help. I apologize if I'm missing something obvious.

\$\endgroup\$
  • 3
    \$\begingroup\$ Don't be silly! Use an MCU. \$\endgroup\$ – Leon Heller Oct 4 '15 at 17:34
  • \$\begingroup\$ The reason why I would like to avoid a MCU is because it seems overkill for such a project. All I would like to do is read and display air pressure using a sensor, a chip, and a display of sorts. I understand that there will need to be some 'glue' between these... but I feel a MCU is a little more glue than what should be needed. \$\endgroup\$ – Crynux Oct 4 '15 at 19:16
  • 2
    \$\begingroup\$ No, a microcontroller is exactly the glue that makes sense. Anything else would be messy, large, and difficult to change. \$\endgroup\$ – Olin Lathrop Oct 4 '15 at 19:37
  • 1
    \$\begingroup\$ Being afraid of MCU in a first step is maybe normal. It seems to be much work for a little output. But replacing protocolls with buttons or circuits gives you wide more work. If you really want to understand, how stuff work, then buy a oscilloscope and look at the signals which you send. Study datasheets and use some imagination. Furthermore with experience with MCUs you have it much easier for future projects. Imagine a world where you have to begin every counter with logic and, or etc connection. Or similar if every software even games would be programmed in assembler. Simply not useful \$\endgroup\$ – Sider Oct 4 '15 at 19:39
  • 2
    \$\begingroup\$ Honestly, while this questions contains some newbie mistakes, it does not deserve a -3. It was reasonably well formulated that two people could answer it. \$\endgroup\$ – Fizz Oct 4 '15 at 19:56
6
\$\begingroup\$

Page 4 of the datasheet you posted a link to. Note (3):

Because the sample cap will eventually lose charge, effective clock rates below 10 kHz can affect linearity.

It then says "Refer to Section 6.2" which is on page 22.

From that section it says that the clock rate doesn't need to be constant for conversion, but at effective clock rates lower than 10kHz the charge on the sample capacitor leaks away and the result is inaccurate.

Basically this could work, but you won't get a sensible conversion result.


I'm tempted to just say, if it is just for debugging, "Try it and see". But don't do it for anything sensible.

| improve this answer | |
\$\endgroup\$
4
\$\begingroup\$

Is it possible to replace a clock signal with a simple button?

Basically no. Not at the speed things needs to work here.

It seems that the minimum clock low/high time is 125 nanoseconds; there's no max listed. Does this mean if I hooked up a debounced button as a clock signal, it would work fine?

It's the other way around, you have worry about not sending fast enough with your button (besides the need to have sharp pulses).

In theory, SPI has no minimum clock speed but chips like MCP3008 do have one. There's no standard-mandated timeout on bus inactivity for SPI, unlike say on SMBus [where the standard timemout translates into a minimum 19kHz clock]. Practical matters are different. I know of memories an fancy MCUs whose SPI doesn't work below the MHz clock range. Tom actually found what the limitations are for your chip (+1).

For tips on debugging SPI on the cheap, you could probably look at Best tools to debug simple digital circuits? and Beginner's logic analyzer?

Finally regarding

The reason why I would like to avoid a MCU is because it seems overkill for such a project. All I would like to do is read and display air pressure using a sensor, a chip, and a display of sorts. I understand that there will need to be some 'glue' between these... but I feel a MCU is a little more glue than what should be needed.

Well, you bought the wrong chips (MCP3008) for that route. Assuming your analog pressure sensors output their measurement as voltage, a chip like ICL7107 would be a direct interface between an analog sensor like that and a display. Basically to avoid the MCU you want an A/D converter with a built-in display interface.

We even have a nice, detailed answer here comparing the relative complexities of a MCU/arduino-based and ICL7107 (ASIC-based) solutions: https://electronics.stackexchange.com/a/66580/54580

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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