<?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>nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121011/nrf7002dk-fitness-tracker-using-mma7361-accelerometer-and-gc9a01-driven-round-lcd-display</link><description>Hello, 
 I&amp;#39;m currently working on a fitness tracker application using the Nordic nRF7002 DK board, paired with an analog MMA7361 accelerometer , and a round GC9A01 SPI-based LCD display. 
 I&amp;#39;m facing some challenges with properly integrating these components</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 May 2025 07:34:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121011/nrf7002dk-fitness-tracker-using-mma7361-accelerometer-and-gc9a01-driven-round-lcd-display" /><item><title>RE: nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/thread/535919?ContentTypeID=1</link><pubDate>Mon, 19 May 2025 07:34:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f738d33f-0b45-41b2-936f-70321ee7f20d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Krapic"]Additionally, I&amp;#39;ve connected the VIO REF pin on the nRF7002DK to 3.3V. Am I correct in assuming this sets the logic levels of the nRF5340 pins to 3.3V instead of the default 1.8V?[/quote]
&lt;p&gt;Correct. You can verify by using a multimeter for instance.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Krapic"]On my nRF7002DK, I initially attempted to use the Arduino SPI interface (&lt;code&gt;&amp;amp;spi3&lt;/code&gt;) because it seemed the simplest route. However, I encountered errors suggesting that the Arduino header pin D8 (if I&amp;#39;m not mistaken) is reserved or already in use by the nRF70 Wi-Fi companion chip.[/quote]
&lt;p&gt;Flip the kit over, and you will see what pins are in use. D8, ie. P1.10, does not seem to be used.&lt;/p&gt;
&lt;p&gt;What errors do you see?&lt;/p&gt;
[quote user="Krapic"]Therefore, I&amp;#39;d like to know if there&amp;#39;s a minimal &amp;quot;bare-metal&amp;quot; example available that I can use just to verify that the display functions correctly.[/quote]
&lt;p&gt;Unfortunately there is not.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/thread/535886?ContentTypeID=1</link><pubDate>Sun, 18 May 2025 22:51:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:beb5dcf3-0baa-40a8-bc8c-a4fb2a2d0aba</guid><dc:creator>Krapic</dc:creator><description>&lt;p data-start="97" data-end="268"&gt;I&amp;#39;m currently struggling with initializing the SPI interface for a display using the GC9X01X driver, which I noticed is officially supported in Zephyr&amp;#39;s GitHub repository:&lt;/p&gt;
&lt;ul data-start="270" data-end="503"&gt;
&lt;li data-start="270" data-end="368"&gt;
&lt;p data-start="272" data-end="368"&gt;&lt;a class="" href="https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers/display" target="_new" data-start="272" data-end="368"&gt;Zephyr drivers/display&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-start="369" data-end="503"&gt;
&lt;p data-start="371" data-end="503"&gt;&lt;a class="" href="https://docs.zephyrproject.org/latest/build/dts/api/bindings/display/galaxycore%2Cgc9x01x.html" target="_new" data-start="371" data-end="503"&gt;Zephyr GC9X01X Display Driver Docs&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-start="505" data-end="783"&gt;On my nRF7002DK, I initially attempted to use the Arduino SPI interface (&lt;code data-start="578" data-end="585"&gt;&amp;amp;spi3&lt;/code&gt;) because it seemed the simplest route. However, I encountered errors suggesting that the Arduino header pin D8 (if I&amp;#39;m not mistaken) is reserved or already in use by the nRF70 Wi-Fi companion chip.&lt;/p&gt;
&lt;p data-start="785" data-end="1033"&gt;I&amp;#39;ve tried various existing templates and examples, but I always end up overwhelmed by build errors. Therefore, I&amp;#39;d like to know if there&amp;#39;s a minimal &amp;quot;bare-metal&amp;quot; example available that I can use just to verify that the display functions correctly.&lt;/p&gt;
&lt;p data-start="1035" data-end="1214"&gt;Additionally, I&amp;#39;ve connected the VIO REF pin on the nRF7002DK to 3.3V. Am I correct in assuming this sets the logic levels of the nRF5340 pins to 3.3V instead of the default 1.8V?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/thread/535340?ContentTypeID=1</link><pubDate>Wed, 14 May 2025 13:14:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbef1901-1596-4c55-a3f9-3509d2fc2ffe</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I could not find a datasheet for the module that you have, to check if it accepts a range of IO voltage or not.&lt;/p&gt;
&lt;p&gt;If your display requires 3V logic level, you could use&amp;nbsp;a nRF5340-DK for instance, which runs on 3.0V.&lt;/p&gt;
&lt;p&gt;One alternative for the nRF7002-DK is to provide 3.3V to the &amp;quot;VIO REF&amp;quot; pin on header P20 on the nRF7002-DK.&lt;/p&gt;
&lt;p&gt;Note that the VBAT net runs on a higher voltage.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/thread/534746?ContentTypeID=1</link><pubDate>Sat, 10 May 2025 14:15:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76bc6643-cf76-4c59-af55-f0f2cf22e8dc</guid><dc:creator>Krapic</dc:creator><description>&lt;p&gt;&lt;span style="font-size:inherit;"&gt;Sorry to bother you again. I&amp;#39;ve managed to get the ADC‐reading part somewhat working:&lt;/span&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
/* STEP 3.1 - Include the header file of the Zephyr ADC API */
#include &amp;lt;zephyr/drivers/adc.h&amp;gt;
#include &amp;lt;math.h&amp;gt;

/* STEP 3.2 - Define a variable of type adc_dt_spec for each channel */
static const struct adc_dt_spec adc_channel0 = ADC_DT_SPEC_GET_BY_IDX(DT_PATH(zephyr_user), 0);
static const struct adc_dt_spec adc_channel1 = ADC_DT_SPEC_GET_BY_IDX(DT_PATH(zephyr_user), 1);
static const struct adc_dt_spec adc_channel2 = ADC_DT_SPEC_GET_BY_IDX(DT_PATH(zephyr_user), 2);

LOG_MODULE_REGISTER(Fitness, LOG_LEVEL_DBG);

int main(void)
{
	int err;
	uint32_t count = 0;

	/* STEP 4.1 - Define a variable of type adc_sequence and a buffer of type uint16_t */
	int16_t buf0;
	struct adc_sequence sequence0 = {
		.buffer = &amp;amp;buf0,
		/* buffer size in bytes, not number of samples */
		.buffer_size = sizeof(buf0),
		// Optional
		//.calibrate = true,
	};
	int16_t buf1;
	struct adc_sequence sequence1 = {
		.buffer = &amp;amp;buf1,
		/* buffer size in bytes, not number of samples */
		.buffer_size = sizeof(buf1),
		// Optional
		//.calibrate = true,
	};
	int16_t buf2;
	struct adc_sequence sequence2 = {
		.buffer = &amp;amp;buf2,
		/* buffer size in bytes, not number of samples */
		.buffer_size = sizeof(buf2),
		// Optional
		//.calibrate = true,
	};

	/* STEP 3.3 - validate that the ADC peripheral (SAADC) is ready */
	if (!adc_is_ready_dt(&amp;amp;adc_channel0))
	{
		LOG_ERR(&amp;quot;ADC controller devivce %s not ready&amp;quot;, adc_channel0.dev-&amp;gt;name);
		return 0;
	}
	if (!adc_is_ready_dt(&amp;amp;adc_channel1))
	{
		LOG_ERR(&amp;quot;ADC controller devivce %s not ready&amp;quot;, adc_channel1.dev-&amp;gt;name);
		return 0;
	}
	if (!adc_is_ready_dt(&amp;amp;adc_channel2))
	{
		LOG_ERR(&amp;quot;ADC controller devivce %s not ready&amp;quot;, adc_channel2.dev-&amp;gt;name);
		return 0;
	}
	/* STEP 3.4 - Setup the ADC channel */
	err = adc_channel_setup_dt(&amp;amp;adc_channel0);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Could not setup channel #%d (%d)&amp;quot;, 0, err);
		return 0;
	}
	err = adc_channel_setup_dt(&amp;amp;adc_channel1);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Could not setup channel #%d (%d)&amp;quot;, 0, err);
		return 0;
	}
	err = adc_channel_setup_dt(&amp;amp;adc_channel2);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Could not setup channel #%d (%d)&amp;quot;, 0, err);
		return 0;
	}
	/* STEP 4.2 - Initialize the ADC sequence */
	err = adc_sequence_init_dt(&amp;amp;adc_channel0, &amp;amp;sequence0);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Could not initalize sequnce&amp;quot;);
		return 0;
	}
	err = adc_sequence_init_dt(&amp;amp;adc_channel1, &amp;amp;sequence1);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Could not initalize sequnce&amp;quot;);
		return 0;
	}
	err = adc_sequence_init_dt(&amp;amp;adc_channel2, &amp;amp;sequence2);
	if (err &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Could not initalize sequnce&amp;quot;);
		return 0;
	}

	while (1)
	{
		int val_mv0;
		int val_mv1;
		int val_mv2;

		/* STEP 5 - Read a sample from the ADC */
		err = adc_read(adc_channel0.dev, &amp;amp;sequence0);
		if (err &amp;lt; 0)
		{
			LOG_ERR(&amp;quot;Could not read (%d)&amp;quot;, err);
			continue;
		}

		err = adc_read(adc_channel1.dev, &amp;amp;sequence1);
		if (err &amp;lt; 0)
		{
			LOG_ERR(&amp;quot;Could not read (%d)&amp;quot;, err);
			continue;
		}

		err = adc_read(adc_channel2.dev, &amp;amp;sequence2);
		if (err &amp;lt; 0)
		{
			LOG_ERR(&amp;quot;Could not read (%d)&amp;quot;, err);
			continue;
		}

		val_mv0 = (int)buf0;
		LOG_INF(&amp;quot;ADC reading[%u]: %s, channel %d: Raw: %d&amp;quot;, count++, adc_channel0.dev-&amp;gt;name,
				adc_channel0.channel_id, val_mv0);

		val_mv1 = (int)buf1;
		LOG_INF(&amp;quot;ADC reading[%u]: %s, channel %d: Raw: %d&amp;quot;, count++, adc_channel1.dev-&amp;gt;name,
				adc_channel1.channel_id, val_mv1);

		val_mv2 = (int)buf2;
		LOG_INF(&amp;quot;ADC reading[%u]: %s, channel %d: Raw: %d&amp;quot;, count++, adc_channel2.dev-&amp;gt;name,
				adc_channel2.channel_id, val_mv2);

		/* STEP 6 - Convert raw value to mV*/
		err = adc_raw_to_millivolts_dt(&amp;amp;adc_channel0, &amp;amp;val_mv0);
		/* conversion to mV may not be supported, skip if not */
		if (err &amp;lt; 0)
		{
			LOG_WRN(&amp;quot; (value in mV not available)\n&amp;quot;);
		}
		else
		{
			LOG_INF(&amp;quot; = %d mV&amp;quot;, val_mv0);
		}
		err = adc_raw_to_millivolts_dt(&amp;amp;adc_channel1, &amp;amp;val_mv1);
		/* conversion to mV may not be supported, skip if not */
		if (err &amp;lt; 0)
		{
			LOG_WRN(&amp;quot; (value in mV not available)\n&amp;quot;);
		}
		else
		{
			LOG_INF(&amp;quot; = %d mV&amp;quot;, val_mv1);
		}
		err = adc_raw_to_millivolts_dt(&amp;amp;adc_channel2, &amp;amp;val_mv2);
		/* conversion to mV may not be supported, skip if not */
		if (err &amp;lt; 0)
		{
			LOG_WRN(&amp;quot; (value in mV not available)\n&amp;quot;);
		}
		else
		{
			LOG_INF(&amp;quot; = %d mV&amp;quot;, val_mv2);
		}

		k_sleep(K_MSEC(1000));
	}
	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p data-start="483" data-end="829"&gt;&lt;span style="font-size:inherit;"&gt;I&amp;rsquo;m not sure if I can simplify the code, since I&amp;rsquo;ve repeated it for all three channels. Now I&amp;rsquo;m stuck on the display part. From what I&amp;rsquo;ve read, the display&amp;rsquo;s SPI interface requires 3.3 V logic, but my nRF7002DK only provides 1.8 V logic. Is that correct, and would I need a level shifter, or is there a way to connect it without extra components?&lt;/span&gt;&lt;/p&gt;
&lt;p data-start="831" data-end="852"&gt;&lt;span style="font-size:inherit;"&gt;Thank you in advance!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/thread/533481?ContentTypeID=1</link><pubDate>Tue, 29 Apr 2025 22:49:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2253a4e1-3afe-48e4-a13d-b50cae8d38e8</guid><dc:creator>Krapic</dc:creator><description>&lt;p&gt;Thank you so much for your help. This will definitely speed things up and help me finish my final project for university. I&amp;rsquo;ll try to implement this as soon as possible and let you know once I&amp;rsquo;ve got it working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF7002DK Fitness Tracker using MMA7361 Accelerometer and GC9A01 driven round LCD display</title><link>https://devzone.nordicsemi.com/thread/533278?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 22:23:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:075035d2-1694-4f41-8053-d56e26f38a95</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;For the display, perhaps you can test the sample:&lt;/p&gt;
&lt;p&gt;NCS\zephyr\samples\subsys\display\cfb&lt;/p&gt;
&lt;p&gt;But you need to specify the display you are using using devicetree. You should be able to build this sample for the &amp;quot;&lt;a href="https://docs.zephyrproject.org/latest/boards/phytec/reel_board/doc/index.html"&gt;reel_board&lt;/a&gt;&amp;quot;, which has a display. You can look at the reel_board devicetree files located in:&lt;/p&gt;
&lt;p&gt;NCS\zephyr\boards\phytec\reel_board\reel_board.dts.&lt;/p&gt;
&lt;p&gt;You can add something like this to a file called nrf5340dk_nrf5340_cpuapp.overlay in your application&amp;#39;s main folder, and any parts that you copy from the zephyr\boards\nordic\nrf5340dk\nrf5340dk_nrf5340_cpuapp.dts and paste in your overlay file, and then change there will overwrite what it says in the original .dts file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for SPI and ADC, I would recommend that you check out the Developer Academy. Both the nRF Connect SDK &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;Fundamentals&lt;/a&gt; and &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/"&gt;Intermediate&lt;/a&gt; courses are relevant. The intermediate course even has a lesson dedicated to the PWM, SPI and ADC peripherals.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>