News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

SPI interface

Started by rpalmer, 09:37, 06 August 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rpalmer

Hello People,

Well here it is a CPC SPI interface.

1. It has 4 SPI ports which convert the data to serial via the CPC 4MHz clock.
2. The ports can be manually controlled or automatic (to get the next byte or send the byte).
3. Each port is individually addressable.
4. The interface transfers data with enough speed to not require the CPC for it to wait (since it is converting bytes to serial data).

   example code to send data

   OUTI
   INC  B

   repeat above as many times as needed.

   The above shows that the INC  B will take 4 clock cycles to load and complete and after that the next instruction will take 4 clock cycles to load.... voila byte of data transferred.

You can connect any SPI interface based devices. I have already got little PCBs for micro-SD cards. There is website which shows how to connect a Real-Time Clock.
You may find it possible to even connect an ethernet device much like the Wifi chip (ESP2866). I know the ENC28J60 ethernet chip has an SPI interface so it should be doable.

I am getting the SPI interface to work first with the micro-SD cards and then later with other devices.

Attached are the pictures of the SPI interfaceand the interface connected to the CPC BEx4.
I will of course only need 1 micro-SD, but to order the little PCB I had to get them in larger batches then i needed.

When all tests appear to show it working as expected I can release the schematic for others to see fit for their own uses (if they are brave enough to give it a go).

rplamer

rpalmer

here is the SPI to SD stuff

zhulien

#2
are SPI and TTL modules competitors?  What's the price for the SPI cards?



I guess, you can connect raspberry pi to it too 

https://learn.sparkfun.com/tutorials/raspberry-pi-spi-and-i2c-tutorial

Which would allow some cool things to be done.

rpalmer

what are SSP cards?

zhulien


rpalmer

I was left confused by that.

As for price of these cards, they are yet to be finalised until I get the first attachment going and working (namely the SD card adapter).
I have already got the little PCBs made (see attached photo) and from the photo I could make many, but I have only enough components for about 5 adapters for now.

I have already been looking at:

1. A Real-Time clock as well (google DS3234 as an example of such).
2. A conversion of the SPI port to USB (google MAX3421E).
3. Eventually as well an ethernet card which uses the SPI port (such as ENC28J60) as mention at start of the thread.

rpalmer

zhulien

#6
I've been thinking of for a while to add MP3 audio capability to mini booster but not sure how many people have one and would want this... through a serial controlled MP3 playing the board that costs only a few dollars. The scard in this case is treated like an audio patch card and controlled by the cpc without any CPU overhead.


Maybe your board is better suited?


http://www.ebay.com.au/itm/MP3-Serial-Port-Control-Music-Voice-Module-TF-Card-U-Disk-Card-Reader-File-Name/272225720534?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m1438.l2649



Bryce

There are some nice little SPI LCD / OLED dot matrix displays available quite cheaply, may connecting up one of those could be useful for something?

Bryce.

zhulien

I was thinking the same... to show debug info while developing.

Bryce

I connected one of those standard 16x2 LCD displays to the printer port at one time, but other than sending some "Hello world" text to it, I couldn't think of anything useful to do with it. Possibly with some proper software it could be used for hardware debugging (RAMTest perhaps?). It was done just using BASIC. I probably still have the program and notes on it somewhere.

Bryce.

zhulien

Quote from: Bryce on 13:41, 07 August 17
I connected one of those standard 16x2 LCD displays to the printer port at one time, but other than sending some "Hello world" text to it, I couldn't think of anything useful to do with it. Possibly with some proper software it could be used for hardware debugging (RAMTest perhaps?). It was done just using BASIC. I probably still have the program and notes on it somewhere.

Bryce.


that's even better - aside from a digiblaster (that I don't have), I cannot think of any other use for the printer port.  a taller display than 16x2 would be good though - especially since newer displays are not that expensive for small ones.  Debug info can be useful on a 2nd monitor from where the action is.

Bryce

The code is almost identical no matter what dimension LCD you use. It's just a matter of setting the right parameters.

Bryce.

LambdaMikel

#12
Nice idea!  :)
What kind of hardware is that based on?
The image is too blurry to tell.


I was thinking of doing a similar card after LambdaSpeak...
given that SPI and I2C etc. are easy to do with the Atmega
328, and the hardware interface is basically the same
(requires only software changes for LambdaSpeak).


Are you using a microcontroller for this?

rpalmer

The build almost worked.
I had used /M1 (not active) and A6 = 1 for device select... Bad choice as it was being selected on every I/O.... bugger.
The next build should be A10 = 1 and A6 = 0 (or full decode lower byte of I/O).

My design is based on something similar to a ZX81 MMC (see attached picture)

rpalmer

Powered by SMFPacks Menu Editor Mod