<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><description>Part 2 in a series that gets you RTOS-ready for the MSP432 LaunchPad When you complete this example, you have a basic RTOS setup that integrates USB, ADC and a blinky. You can use Tasks, Semaphores and a UART interrupt. And you&amp;#39;ll know how...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>https://community.element14.com/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><pubDate>Fri, 23 Feb 2018 16:38:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a707f0ba-7c08-4481-8c56-c3e2e4ca3871</guid><dc:creator>fredws</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Thought while I was at it, I looked at timing in adc routine with printing and without printing.&lt;/p&gt;&lt;p&gt;Routine takes at least 60 microseconds to process an ADC convert routine.&lt;/p&gt;&lt;p&gt;With the print routine, it takes at least 220 microseconds, but not sure if this is just passing the printed value out of the routine or actually finishing printing it out the Serial Port.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am trying to get 1 millisecond and faster ADC readings using this method on a sampled period, so I am looking at this timing carefully.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So 1/0.000060 seconds = 16,666 readings per second maximum implementing it this way assuming no other interrupts.&amp;nbsp; Obviously, you cannot go this fast if you want your program to do something else.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Red Stars, comment in or comment out for this test, found in the adc_sample.c routine in this pages examples.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x325/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183765.png:620:325]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/677x664/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183766.png:677:664]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2377&amp;AppID=150&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>https://community.element14.com/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><pubDate>Fri, 23 Feb 2018 15:50:43 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a707f0ba-7c08-4481-8c56-c3e2e4ca3871</guid><dc:creator>fredws</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In case anyone is wondering, the clock Module shows the Tick period (us).&lt;/p&gt;&lt;p&gt;This is default to 1000 microseconds per tick generated, or one Tick per millisecond.&lt;/p&gt;&lt;p&gt;This 1 millisecond rate is what Is used as a time source for the Task Argument 0 value in this example.&lt;/p&gt;&lt;p&gt;so ADC Task Argument 0 = 10000 related to 10,000 milliseconds if used with Task_sleep((UInt)arg0);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/724x562/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183764.png:724:562]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2377&amp;AppID=150&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>https://community.element14.com/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><pubDate>Fri, 23 Feb 2018 15:04:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a707f0ba-7c08-4481-8c56-c3e2e4ca3871</guid><dc:creator>fredws</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;===================&amp;nbsp; added Extra comment with RTOS Execution Graphs ==================&lt;/p&gt;&lt;p&gt;So, RTOS Analyzer - Execution Graph with Argument 0 = 10,000,000&lt;/p&gt;&lt;p&gt;Pulses are spaced 10 seconds apart, graph shows heartBearFxn at 1 second, really can&amp;#39;t see taskAdcSample at 10 seconds, but at 30 second mark on graph, if I zoom in, I can see the Adc and heartbeat.&amp;nbsp; I would have to let this run much longer to get more sample to see this.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/1014x195/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183761.png:1014:195]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So, RTOS Analyzer - Execution Graph with Argument 0 = 10,000&lt;/p&gt;&lt;p&gt;Pulses are spaced 10 milli-seconds apart&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/1012x198/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183762.png:1012:198]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;You can setup RTOS Analyzer from Tools &amp;gt; RTOS Analyzer &amp;gt; Execution Graph.&lt;/p&gt;&lt;p&gt;You have to run it once to set it up, then the next time it should look like this.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/352x384/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183763.png:352:384]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In the .cfg file to enable logging, find the BIOS_logsEnabled = true; and comment It in, comment out the false one.&lt;/p&gt;&lt;p&gt;//BIOS.runtimeCreatesEnabled = false;&lt;/p&gt;&lt;p&gt;/*&lt;br /&gt; * Enable logs in the BIOS library.&lt;br /&gt; *&lt;br /&gt; * Pick one:&lt;br /&gt; *&amp;nbsp; - true (default)&lt;br /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enables logs for debugging purposes.&lt;br /&gt; *&amp;nbsp; - false&lt;br /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disables logging for reduced code footprint and improved runtime&lt;br /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; performance.&lt;br /&gt;*/&lt;br /&gt;BIOS.logsEnabled = true;&lt;br /&gt;//BIOS.logsEnabled = false;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;At end of .cfg file, add this text to get information you are looking for:&lt;/p&gt;&lt;p&gt;// Added at the end of the file&lt;br /&gt;/* FWS commented here and added below for RTOS Analyzer - extra things I added to show on RTOS Execution Graph */&lt;br /&gt;// Select what you want to see in your RTOS Analyzer.&amp;nbsp; &lt;br /&gt;// LoggingSetup.sysbiosTaskLogging = true;&amp;nbsp;&amp;nbsp;&amp;nbsp; // shows Tasks if true&lt;br /&gt;// LoggingSetup.sysbiosHwiLogging = true;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // shows HWI&amp;#39;s and Clock if = true&lt;br /&gt;// LoggingSetup.sysbiosSwiLogging = true;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // shows SWI&amp;#39;s if true&lt;/p&gt;&lt;p&gt;/* FWS Add for RTOS Analyzer - also comment in BIOS.logsEnabled = true; comment out =false about line 275 */&lt;br /&gt;var LoggingSetup = xdc.useModule(&amp;#39;ti.uia.sysbios.LoggingSetup&amp;#39;);&lt;br /&gt;LoggingSetup.sysbiosTaskLogging = true;&amp;nbsp;&amp;nbsp; // optional, shows Tasks if true&lt;br /&gt;// LoggingSetup.sysbiosHwiLogging = true;&amp;nbsp; // optional, shows HWI&amp;#39;s and Clock if = true&lt;br /&gt;// LoggingSetup.sysbiosSwiLogging = true;&amp;nbsp; // optional, shows SWI&amp;#39;s if true&lt;br /&gt;LoggingSetup.mainLogging = true;&amp;nbsp;&amp;nbsp; // optional, not sure what this logs, FWS. Hoping for IDLE.&lt;/p&gt;&lt;p&gt;LoggingSetup.sysbiosLoggerSize = 1024;&lt;br /&gt;LoggingSetup.loadLogging = false;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2377&amp;AppID=150&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>https://community.element14.com/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><pubDate>Fri, 23 Feb 2018 14:31:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a707f0ba-7c08-4481-8c56-c3e2e4ca3871</guid><dc:creator>fredws</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;First off, great example.&lt;/p&gt;&lt;p&gt;I started with resource explorer using SimpleLink example as shown.&lt;/p&gt;&lt;p&gt; TI-RTOS Kernel (SYS_BIOS), hello &amp;gt; TI-RTOS &amp;gt; CCS Compiler &amp;gt; hello project.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/498x650/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183757.png:498:650]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Alternate Starting Program with TI seems to direct you away from for new projects was the empty project used to start this example under the TI-RTOS for MSP430, there is a MSP432 folder under it.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/369x253/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183758.png:369:253]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Problem with 10 second interval in ADC routine.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Note in step 1, previous web site, GUI .cfg shows&amp;nbsp; Argument 0 =&amp;nbsp; 10,000,000&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/600x337/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183759.png:600:337]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In this web page, step 2, you enter 10000.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/545x375/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/contentimage_5F00_183760.png:545:375]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Your Task_Sleep(((UInt)arg0)/Clock_tickPeriod); The Task_Sleep(value); function is using the value entered as system clock period ticks.&lt;/p&gt;&lt;p&gt;so, Clock_tickPeriod is set in GUI .cfg as 1000&amp;nbsp;&amp;nbsp; microseconds&amp;nbsp; (this is 1 millisecond)&lt;/p&gt;&lt;p&gt;Your Arg0 was set to 10000 in this&amp;nbsp; step.&lt;/p&gt;&lt;p&gt;10000/1000 = 10 milliseconds&lt;/p&gt;&lt;p&gt;If your Arg0 was 10000000 then 10000000/1000 = 10,000 milliseconds or 10 seconds.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You could also change the code to:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Task_Sleep((UInt)Arg0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this now Sleeps for Arg0 clock tick period, so Arg0=10000, wait 10 seconds.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="comment"&gt;/* &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="comment"&gt; *&amp;nbsp; ======== taskAdcSample ======== &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt; *&amp;nbsp; Open an ADC instance and get a sampling result from a one-shot conversion. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt; */&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;Void taskAdcSample(UArg arg0, UArg arg1)&amp;nbsp; &lt;/li&gt;&lt;li&gt;{&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_Handle&amp;nbsp;&amp;nbsp; adc0;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_Handle&amp;nbsp;&amp;nbsp; adc1;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_Params&amp;nbsp;&amp;nbsp; params;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint16_t adcValue0;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint16_t adcValue1;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_Params_init(&amp;amp;params);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adc0 = ADC_open(Board_ADC0, &amp;amp;params);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adc1 = ADC_open(Board_ADC1, &amp;amp;params);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="keyword"&gt;while (&lt;span class="number"&gt;1&lt;/span&gt;) {&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Task_sleep(((UInt)arg0) / Clock_tickPeriod);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="comment"&gt;/* Blocking mode conversion */&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_convert(adc0, &amp;amp;adcValue0);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_convert(adc1, &amp;amp;adcValue1);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System_printf(&lt;span class="string"&gt;&amp;quot;Sample %u:%u\n&amp;quot;, adcValue0, adcValue1);&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="comment"&gt;/* SysMin will only print to the console when you call flush or exit */&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System_flush();&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="comment"&gt;// theoretically close the ADC driver. This code is never reached&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_close(adc0);&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; ADC_close(adc1);&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;}&amp;nbsp; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Note main c file&lt;/p&gt;&lt;p&gt;Task_sleep Is this way.&lt;/p&gt;&lt;p&gt;&lt;span class="comment"&gt;/* &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="comment"&gt; *&amp;nbsp; ======== heartBeatFxn ======== &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt; *&amp;nbsp; Toggle the Board_LED0. The Task_sleep is determined by arg0 which &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt; *&amp;nbsp; is configured for the heartBeat Task instance. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="comment"&gt; */&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;Void heartBeatFxn(UArg arg0, UArg arg1)&amp;nbsp; &lt;/li&gt;&lt;li&gt;{&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="keyword"&gt;while (&lt;span class="number"&gt;1&lt;/span&gt;) {&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Task_sleep((UInt)arg0);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_toggle(Board_LED0);&amp;nbsp; &lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/li&gt;&lt;li&gt;}&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Hope this helps others looking at this example.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2377&amp;AppID=150&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>https://community.element14.com/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><pubDate>Thu, 11 May 2017 19:39:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a707f0ba-7c08-4481-8c56-c3e2e4ca3871</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Debug and real-time scheduling don&amp;#39;t play well together. But there&amp;#39;s more than that that can go wrong. can you upload your project somewhere? it makes it easier to replicate your situation.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2377&amp;AppID=150&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: MSP432 and TI-RTOS: Getting Started Pt. 2 - Add an ADC Sample Task</title><link>https://community.element14.com/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-getting-started-pt-2---add-an-adc-sample-task</link><pubDate>Wed, 10 May 2017 21:53:22 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a707f0ba-7c08-4481-8c56-c3e2e4ca3871</guid><dc:creator>eriklho</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;ve been trying to set up the adc program, but whenever I build and go into debug the sampler doesn&amp;#39;t wait 10s between each sample. It seems to lock up the system with all the samples. The LED starts to blink really slow. Have no idea why. Tried to replicate what you have done a couple of times without luck.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/1600x526/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/5582.contentimage_5F00_183755.png:1600:526]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;adc_sample.c&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%2F*+XDCtools+Header+files+*%2F%0A%23include+%3Cxdc%2Fstd.h%3E%0A%23include+%3Cxdc%2Fruntime%2FSystem.h%3E%0A%23include+%3Cxdc%2Fruntime%2FError.h%3E%0A%0A%0A%2F*+BIOS+Header+files+*%2F%0A%23include+%3Cti%2Fsysbios%2FBIOS.h%3E%0A%23include+%3Cti%2Fsysbios%2Fknl%2FTask.h%3E%0A%23include+%3Cti%2Fsysbios%2Fknl%2FClock.h%3E%0A%0A%0A%2F*+TI-RTOS+Header+files+*%2F%0A%23include+%3Cti%2Fdrivers%2FADC.h%3E%0A%0A%0A%2F*+Example%2FBoard+Header+files+*%2F%0A%23include+%22Board.h%22%0A%0A%0A%2F*%0A+*++%3D%3D%3D%3D%3D%3D%3D%3D+taskAdcSample+%3D%3D%3D%3D%3D%3D%3D%3D%0A+*++Open+an+ADC+instance+and+get+a+sampling+result+from+a+one-shot+conversion.%0A+*%2F%0AVoid+taskAdcSample%28UArg+arg0%2C+UArg+arg1%29%0A%7B%0A++++ADC_Handle+++adc0%3B%0A++++ADC_Handle+++adc1%3B%0A++++ADC_Params+++params%3B%0A++++uint16_t+adcValue0%3B%0A++++uint16_t+adcValue1%3B%0A++++ADC_Params_init%28%26params%29%3B%0A++++adc0+%3D+ADC_open%28Board_ADC0%2C+%26params%29%3B%0A++++adc1+%3D+ADC_open%28Board_ADC1%2C+%26params%29%3B%0A%0A%0A++++while+%281%29+%7B%0A++++++++Task_sleep%28%28%28UInt%29arg0%29+%2F+Clock_tickPeriod%29%3B%0A++++++++%2F*+Blocking+mode+conversion+*%2F%0A++++++++ADC_convert%28adc0%2C+%26adcValue0%29%3B%0A++++++++ADC_convert%28adc1%2C+%26adcValue1%29%3B%0A++++++++System_printf%28%22Sample+%25u%3A%25u%5Cn%22%2C+adcValue0%2C+adcValue1%29%3B%0A++++++++%2F*+SysMin+will+only+print+to+the+console+when+you+call+flush+or+exit+*%2F%0A++++++++System_flush%28%29%3B%0A++++%7D%0A++++%2F%2F+theoretically+close+the+ADC+driver.+This+code+is+never+reached%0A%2F%2F++++ADC_close%28adc0%29%3B%0A%2F%2F++++ADC_close%28adc1%29%3B%0A%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/162x226/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-a707f0ba-7c08-4481-8c56-c3e2e4ca3871/4186.contentimage_5F00_183756.png:162:226]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;datalogger.c&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%2F*%0A+*+Copyright+%28c%29+2015%2C+Texas+Instruments+Incorporated%0A+*+All+rights+reserved.%0A+*%0A+*+Redistribution+and+use+in+source+and+binary+forms%2C+with+or+without%0A+*+modification%2C+are+permitted+provided+that+the+following+conditions%0A+*+are+met%3A%0A+*%0A+*+*++Redistributions+of+source+code+must+retain+the+above+copyright%0A+*++++notice%2C+this+list+of+conditions+and+the+following+disclaimer.%0A+*%0A+*+*++Redistributions+in+binary+form+must+reproduce+the+above+copyright%0A+*++++notice%2C+this+list+of+conditions+and+the+following+disclaimer+in+the%0A+*++++documentation+and%2For+other+materials+provided+with+the+distribution.%0A+*%0A+*+*++Neither+the+name+of+Texas+Instruments+Incorporated+nor+the+names+of%0A+*++++its+contributors+may+be+used+to+endorse+or+promote+products+derived%0A+*++++from+this+software+without+specific+prior+written+permission.%0A+*%0A+*+THIS+SOFTWARE+IS+PROVIDED+BY+THE+COPYRIGHT+HOLDERS+AND+CONTRIBUTORS+%22AS+IS%22%0A+*+AND+ANY+EXPRESS+OR+IMPLIED+WARRANTIES%2C+INCLUDING%2C+BUT+NOT+LIMITED+TO%2C%0A+*+THE+IMPLIED+WARRANTIES+OF+MERCHANTABILITY+AND+FITNESS+FOR+A+PARTICULAR%0A+*+PURPOSE+ARE+DISCLAIMED.+IN+NO+EVENT+SHALL+THE+COPYRIGHT+OWNER+OR%0A+*+CONTRIBUTORS+BE+LIABLE+FOR+ANY+DIRECT%2C+INDIRECT%2C+INCIDENTAL%2C+SPECIAL%2C%0A+*+EXEMPLARY%2C+OR+CONSEQUENTIAL+DAMAGES+%28INCLUDING%2C+BUT+NOT+LIMITED+TO%2C%0A+*+PROCUREMENT+OF+SUBSTITUTE+GOODS+OR+SERVICES%3B+LOSS+OF+USE%2C+DATA%2C+OR+PROFITS%3B%0A+*+OR+BUSINESS+INTERRUPTION%29+HOWEVER+CAUSED+AND+ON+ANY+THEORY+OF+LIABILITY%2C%0A+*+WHETHER+IN+CONTRACT%2C+STRICT+LIABILITY%2C+OR+TORT+%28INCLUDING+NEGLIGENCE+OR%0A+*+OTHERWISE%29+ARISING+IN+ANY+WAY+OUT+OF+THE+USE+OF+THIS+SOFTWARE%2C%0A+*+EVEN+IF+ADVISED+OF+THE+POSSIBILITY+OF+SUCH+DAMAGE.%0A+*%2F%0A%0A%0A%2F*%0A+*++%3D%3D%3D%3D%3D%3D%3D%3D+empty.c+%3D%3D%3D%3D%3D%3D%3D%3D%0A+*%2F%0A%2F*+XDCtools+Header+files+*%2F%0A%23include+%3Cxdc%2Fstd.h%3E%0A%23include+%3Cxdc%2Fruntime%2FSystem.h%3E%0A%0A%0A%2F*+BIOS+Header+files+*%2F%0A%23include+%3Cti%2Fsysbios%2FBIOS.h%3E%0A%23include+%3Cti%2Fsysbios%2Fknl%2FTask.h%3E%0A%0A%0A%2F*+TI-RTOS+Header+files+*%2F%0A%23include+%3Cti%2Fdrivers%2FGPIO.h%3E%0A%2F%2F+%23include+%3Cti%2Fdrivers%2FI2C.h%3E%0A%2F%2F+%23include+%3Cti%2Fdrivers%2FSDSPI.h%3E%0A%2F%2F+%23include+%3Cti%2Fdrivers%2FSPI.h%3E%0A%2F%2F+%23include+%3Cti%2Fdrivers%2FUART.h%3E%0A%2F%2F+%23include+%3Cti%2Fdrivers%2FWatchdog.h%3E%0A%2F%2F+%23include+%3Cti%2Fdrivers%2FWiFi.h%3E%0A%0A%0A%2F*+Board+Header+file+*%2F%0A%23include+%22Board.h%22%0A%0A%0A%23define+TASKSTACKSIZE+++512%0A%0A%0ATask_Struct+task0Struct%3B%0AChar+task0Stack%5BTASKSTACKSIZE%5D%3B%0A%0A%0A%2F*%0A+*++%3D%3D%3D%3D%3D%3D%3D%3D+heartBeatFxn+%3D%3D%3D%3D%3D%3D%3D%3D%0A+*++Toggle+the+Board_LED0.+The+Task_sleep+is+determined+by+arg0+which%0A+*++is+configured+for+the+heartBeat+Task+instance.%0A+*%2F%0AVoid+heartBeatFxn%28UArg+arg0%2C+UArg+arg1%29%0A%7B%0A++++while+%281%29+%7B%0A++++++++Task_sleep%28%28UInt%29arg0%29%3B%0A++++++++GPIO_toggle%28Board_LED0%29%3B%0A++++%7D%0A%7D%0A%0A%0A%2F*%0A+*++%3D%3D%3D%3D%3D%3D%3D%3D+main+%3D%3D%3D%3D%3D%3D%3D%3D%0A+*%2F%0Aint+main%28void%29%0A%7B%0A%0A%0A++++%2F*+Call+board+init+functions+*%2F%0A++++Board_initGeneral%28%29%3B%0A++++Board_initGPIO%28%29%3B%0A++++Board_initADC%28%29%3B%0A++++%2F%2F+Board_initI2C%28%29%3B%0A++++%2F%2F+Board_initSDSPI%28%29%3B%0A++++%2F%2F+Board_initSPI%28%29%3B%0A++++%2F%2F+Board_initUART%28%29%3B%0A++++%2F%2F+Board_initWatchdog%28%29%3B%0A++++%2F%2F+Board_initWiFi%28%29%3B%0A%0A%0A%0A%0A%0A%0A++++%2F*+Turn+on+user+LED+*%2F%0A++++GPIO_write%28Board_LED0%2C+Board_LED_ON%29%3B%0A%0A%0A++++System_printf%28%22Starting+the+example%5CnSystem+provider+is+set+to+SysMin.+%22%0A++++++++++++++++++%22Halt+the+target+to+view+any+SysMin+contents+in+ROV.%5Cn%22%29%3B%0A++++%2F*+SysMin+will+only+print+to+the+console+when+you+call+flush+or+exit+*%2F%0A++++System_flush%28%29%3B%0A%0A%0A++++%2F*+Start+BIOS+*%2F%0A++++BIOS_start%28%29%3B%0A%0A%0A++++return+%280%29%3B%0A%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=2377&amp;AppID=150&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>