<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>CLK Amplitude Low</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89424/clk-amplitude-low</link><description>Hi, 
 I am using the nrf52dk_nrf52832 board and adding a peripheral SPI Flash. I had previously gotten the SPI Flash to work but now it does not. 
 I&amp;#39;ve hooked it up to the oscilloscope and determined that my CLK is likely the problem. 
 I can see the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jun 2022 13:48:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89424/clk-amplitude-low" /><item><title>RE: CLK Amplitude Low</title><link>https://devzone.nordicsemi.com/thread/374567?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 13:48:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb8c4e11-388b-41d4-b3f1-1cdb47357e13</guid><dc:creator>Tom Nowak</dc:creator><description>&lt;p&gt;The initialization function did not attach.&lt;/p&gt;
&lt;p&gt;Here it is.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define CS_PIN 29
#define size SPI_WORD_SET(8)

struct spi_cs_control cs_cfg = {
	// delay measured in microseconds
	.delay = .055,
	.gpio_dt_flags = GPIO_ACTIVE_LOW,
	.gpio_pin = CS_PIN,
};
struct spi_config spi_cfg = {
	.operation = SPI_OP_MODE_MASTER | !SPI_MODE_CPOL | !SPI_MODE_CPHA | SPI_TRANSFER_MSB | 
		size | SPI_LINES_SINGLE | SPI_FRAME_FORMAT_MOTOROLA, // | !SPI_CS_ACTIVE_HIGH,
    // Can be up to 45000000 must match devicetree
	.frequency = 5000000,
	.slave = 0,
	.cs = &amp;amp;cs_cfg,
};

const struct device * spi_dev;
const struct device * dev;

void spi_init(void)
{
	const char* const spiName = &amp;quot;SPI_1&amp;quot;;
	spi_dev = device_get_binding(spiName);
	if (spi_dev == NULL) {
		printk(&amp;quot;Could not get %s device\n&amp;quot;, spiName);
		return;
	}
}

void cs_init(void){
	dev = device_get_binding(&amp;quot;GPIO_0&amp;quot;);
	if (!dev) {
		printk(&amp;quot;Device not found\n&amp;quot;);
		return;
	}
	cs_cfg.gpio_dev = dev;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>