Skip to content

Clocking Around

June 22, 2014

I dislike having the big AVR on board so I’m looking for ways to reduce its role.  One thought was to see whether the 1802 could generate the 8 pulses needed for the spi clock.  Looking at the timing diagram from the 1802’s datasheet you can see that the clock cycles more-or-less 8 times during the time when the N lines are active(between the red verticals below).  It doesn’t look like 8 clean positive cycles but maybe 8 clear negative half cycles.

14-06-21 NClock

So I inverted the CPU clock and ANDed it with an N line and bingo I have 8 good pulses at 4 mhz (the bottom trace in the picture below).  I had used a bunch of jumpers and the signal looked awful on my scope but I think if I did it right beside the cpu it would be ok.  It does mean the 1802 has to do 3 instructions per byte sent(one to load the shift register, one to trigger the clock, and one housekeeping) but it is cute.

14-06-22 clock luck



From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: