-1

I am designing some boards that are powered and communicate through Cat 5 cables using a bit banged form of protocol inspired by quad spi.

Using the bus network topology in a half duplex manner, I am able to communicate reliably with 10kHz clock.

Since I am using the classic atmega328p-au do I have to worry about putting an external clock or it should do the job fine with just the internal RC circuit?

Modified image of this:

enter image description here

JRE
  • 67,678
  • 8
  • 104
  • 179
Lucas Alexandre
  • 676
  • 6
  • 16

2 Answers2

4

You don't need a reliable clock at all, since this is a synchronously clocked bus:

Your CLOCK signal determines when bits are sampled / set, so all that must be the case is that the data bits are latched on the edge of your clock signal.

So, no, there's no need for external clocking.

In fact, in SPI, a clock cycle can take anything from 1/max freq to an eon (as long as both ends of the link stay intact and powered for that eon).

Marcus Müller
  • 88,280
  • 5
  • 131
  • 237
3

SPI is a self clocked protocol, so having clock speeds match at both ends of the wire is not important, the internal oscillator should be fine.

maintaining signal integrity over cat 5 used in such an off-label way could be challenging, I hope all your cables are short.