Topics

SPI Software


G8ZHA
 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA


Colin G4EML
 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


G8ZHA
 

AD also do a VHF/UHF version, somewhat cheaper.

 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 

From: UKMicrowaves@groups.io [mailto:UKMicrowaves@groups.io] On Behalf Of Colin G4EML
Sent: 14 February 2021 21:32
To: UKMicrowaves@groups.io
Subject: Re: [UKMicrowaves] SPI Software

 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


Robin Szemeti - G1YFG
 

Plenty of Arduino stuff around, and you can program an Arduino with a simple USB cable ... that's the way I would go.

On Sun, 14 Feb 2021 at 22:03, G8ZHA via groups.io <g8zha-1=blueyonder.co.uk@groups.io> wrote:

AD also do a VHF/UHF version, somewhat cheaper.

 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 

From: UKMicrowaves@groups.io [mailto:UKMicrowaves@groups.io] On Behalf Of Colin G4EML
Sent: 14 February 2021 21:32
To: UKMicrowaves@groups.io
Subject: Re: [UKMicrowaves] SPI Software

 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


--
Robin Szemeti - G1YFG


Alan Melia
 

Hi rich a small firm called ByVac used to produce a USB to I2C and SPI interface and a driver i the form of a terminal program running under Windows. I have had some modules from them in the past but not dealt recently. Google should find their web-site.
 
Alan
G3NYK
 

----- Original Message -----
Sent: Sunday, February 14, 2021 9:15 PM
Subject: [UKMicrowaves] SPI Software

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA


Robin Szemeti - G1YFG
 

Oh, and the small compass modules .. I assume you mean the 9 axis compass/gyro things?  I've played extensively with those on a project  .. they are a bit "tricky", you have to keep a hell of a rate up reading them,  if you don't read them often enough, they just lock up ... I had one running on an Arduino being read by SPI, and it was 100% fine ... until I added a few functions reading a GPS chip .. and it got upset when the micro spent too long messing arounf with GPS messages and woudl just hang the compass chip. it wasn't interrupt driven either, just a loop.


On Sun, 14 Feb 2021 at 22:05, Robin Szemeti <robin@...> wrote:
Plenty of Arduino stuff around, and you can program an Arduino with a simple USB cable ... that's the way I would go.

On Sun, 14 Feb 2021 at 22:03, G8ZHA via groups.io <g8zha-1=blueyonder.co.uk@groups.io> wrote:

AD also do a VHF/UHF version, somewhat cheaper.

 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 

From: UKMicrowaves@groups.io [mailto:UKMicrowaves@groups.io] On Behalf Of Colin G4EML
Sent: 14 February 2021 21:32
To: UKMicrowaves@groups.io
Subject: Re: [UKMicrowaves] SPI Software

 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


--
Robin Szemeti - G1YFG


Andy G4JNT
 

There are a lot of variables to SPI, it is not a properly defined protocol.   Does data change on the positive or negative clock edge;  is it LSB first or LSM first?   Does LE/CE have to be held active for the duration of the data transfer, or is it pulsed at the end?  Is the active edge low going or high going? 
For I/O devices, are there separate IP and OP wires, or is the D line tristate?
Every ine of these can be different
So you see there can be no standard chip or interface, every one has to be customised.   WHich is why a programmable device like a PIC or something else is aways used



On Sun, 14 Feb 2021 at 22:03, G8ZHA via groups.io <g8zha-1=blueyonder.co.uk@groups.io> wrote:

AD also do a VHF/UHF version, somewhat cheaper.

 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 

From: UKMicrowaves@groups.io [mailto:UKMicrowaves@groups.io] On Behalf Of Colin G4EML
Sent: 14 February 2021 21:32
To: UKMicrowaves@groups.io
Subject: Re: [UKMicrowaves] SPI Software

 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


Andy G4JNT
 

I had one like that once.   I gave it a dedicated PIC interface that read it as fast as possible and just chuck put what was needed on serial stop-start line in my chosen format.



On Sun, 14 Feb 2021 at 22:09, Robin Szemeti - G1YFG <robin@...> wrote:
Oh, and the small compass modules .. I assume you mean the 9 axis compass/gyro things?  I've played extensively with those on a project  .. they are a bit "tricky", you have to keep a hell of a rate up reading them,  if you don't read them often enough, they just lock up ... I had one running on an Arduino being read by SPI, and it was 100% fine ... until I added a few functions reading a GPS chip .. and it got upset when the micro spent too long messing arounf with GPS messages and woudl just hang the compass chip. it wasn't interrupt driven either, just a loop.


On Sun, 14 Feb 2021 at 22:05, Robin Szemeti <robin@...> wrote:
Plenty of Arduino stuff around, and you can program an Arduino with a simple USB cable ... that's the way I would go.

On Sun, 14 Feb 2021 at 22:03, G8ZHA via groups.io <g8zha-1=blueyonder.co.uk@groups.io> wrote:

AD also do a VHF/UHF version, somewhat cheaper.

 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 

From: UKMicrowaves@groups.io [mailto:UKMicrowaves@groups.io] On Behalf Of Colin G4EML
Sent: 14 February 2021 21:32
To: UKMicrowaves@groups.io
Subject: Re: [UKMicrowaves] SPI Software

 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


--
Robin Szemeti - G1YFG


Jim Mcilroy
 

Hi

It may be worth searching for some AD9850 code. That has an SPI interface which is usually implemented using a 'bit banging' technique which is a hardware SPI (I think) rather than dedicated SPI pins.

The AD9850 is set on frequency using a 32-bit word

I probably have some Arduino code like that somewhere.

Jim  G4EQX

On 14/02/2021 22:12, Andy G4JNT wrote:
I had one like that once.   I gave it a dedicated PIC interface that read it as fast as possible and just chuck put what was needed on serial stop-start line in my chosen format.



On Sun, 14 Feb 2021 at 22:09, Robin Szemeti - G1YFG <robin@...> wrote:
Oh, and the small compass modules .. I assume you mean the 9 axis compass/gyro things?  I've played extensively with those on a project  .. they are a bit "tricky", you have to keep a hell of a rate up reading them,  if you don't read them often enough, they just lock up ... I had one running on an Arduino being read by SPI, and it was 100% fine ... until I added a few functions reading a GPS chip .. and it got upset when the micro spent too long messing arounf with GPS messages and woudl just hang the compass chip. it wasn't interrupt driven either, just a loop.


On Sun, 14 Feb 2021 at 22:05, Robin Szemeti <robin@...> wrote:
Plenty of Arduino stuff around, and you can program an Arduino with a simple USB cable ... that's the way I would go.

On Sun, 14 Feb 2021 at 22:03, G8ZHA via groups.io <g8zha-1=blueyonder.co.uk@groups.io> wrote:

AD also do a VHF/UHF version, somewhat cheaper.

 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 

From: UKMicrowaves@groups.io [mailto:UKMicrowaves@groups.io] On Behalf Of Colin G4EML
Sent: 14 February 2021 21:32
To: UKMicrowaves@groups.io
Subject: Re: [UKMicrowaves] SPI Software

 

An interesting chip, SPI is well supported by Arduinos or Pics so controlling it wouldn’t be a problem.  

 

However at £500 each I think I will give it a miss for a while!.

 

Colin G4EML

 

 

 

From: G8ZHA via groups.io
Sent: 14 February 2021 21:15
To: UKMicrowaves@groups.io
Subject: [UKMicrowaves] SPI Software

 

I wonder if anyone knows if there is any software about that can control a device connected via an SPI bus.

 

There are small compass modules available that are SPI controlled. Along with various PLL modules.

 

Also, Analog Devices has released a SPI controlled Filter chip ADMV8818 which maybe useful for amateur use.

 

 

 

Regards, Rich G8ZHA

 


--
Robin Szemeti - G1YFG


Andy G4JNT
 

40 bits actually.  32 for the frequency, and another 8 bits for control (which have to be correct)



On Mon, 15 Feb 2021 at 12:08, Jim Mcilroy via groups.io <gts53=btinternet.com@groups.io> wrote:


The AD9850 is set on frequency using a 32-bit word



Jim Mcilroy
 

Yes

My error.

Jim

On 15/02/2021 12:14, Andy G4JNT wrote:
40 bits actually.  32 for the frequency, and another 8 bits for control (which have to be correct)



On Mon, 15 Feb 2021 at 12:08, Jim Mcilroy via groups.io <gts53=btinternet.com@groups.io> wrote:


The AD9850 is set on frequency using a 32-bit word



Glyn M0XGT
 

On Sun, Feb 14, 2021 at 10:03 PM, G8ZHA wrote: 

I just want some software that will allow me to specify a number of bytes to be sent, then to allow me to load up the bytes and send them.

 An Arduino is probably the easiest for loading up some bytes and transferring them over SPI.

Cut and paste the code below into the Arduino IDE for a quick starting point - check the device datasheet for a sensible SPI bus speed and choose the SPIMode to match the SPI clock polarity and phase. The code transfers the bytes in buffer[] over SPI MOSI/MISO/CLK pins using Arduino pin 10 for SPI chip select and prints the sent and received data.  The screenshot is a capture of the data on the bus.

Glyn M0XGT

//---------------------------snip-------------------------
// Arduino SPI
#include <SPI.h>
#include <stdint.h>
 
// SPIMode CPOL CPHA
// ---------------
//   0      0    0
//   1      0    1
//   2      1    0
//   3      1    1
// ---------------
 
// SPI chip select pin
const int pin_cs = 10;
 
// SPI bus speed [Hz], bit-order, mode
SPISettings spi_settings(1000000, MSBFIRST, SPI_MODE3); 
 
// transfer bytes over SPI
void spi_transfer(uint8_t buffer[], int length, int pin_cs)
{
  digitalWrite(pin_cs, LOW);
  SPI.beginTransaction(spi_settings);
  SPI.transfer(buffer, length);
  SPI.endTransaction();
  digitalWrite(pin_cs, HIGH);
}
 
// print buffer
void print_buffer(String text, uint8_t buffer[], int n)
{
  Serial.print(text);
  Serial.print(":");
  for (int i = 0; i < n; i++) {
    Serial.print(' ');
    Serial.print(buffer[i], HEX);
  }
  Serial.print('\n');
}
 
void setup()
{
  // serial
  Serial.begin(19200);
  while (!Serial) {
    ; // wait for serial
  }
 
  // SPI
  SPI.begin();
  pinMode(pin_cs, OUTPUT);  // chip select pin
}
 
void loop()
{
  // fill a buffer with some bytes
  uint8_t buff[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
  int n = sizeof(buff) / sizeof(uint8_t);
 
  // print the buffer
  print_buffer("sending", buff, n);
 
  // transfer bytes
  spi_transfer(buff, n, pin_cs);
 
  // print what came back
  print_buffer("received", buff, n);
 
  delay(1000);  // [mS]
}
//---------------------------snip-------------------------


Mike Willis
 

SPI Driver Core is good for checking things. There is one for I2C as well.


--
Mike G0MJW