<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: NHS3152  - Write NDEF message containing integer values (from ADC) in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207505#M43470</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Dries,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What do you mean with "Commit message"? Creating a text message so your phone can show the results?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Exactly.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to &lt;STRONG&gt;Demostrate&lt;/STRONG&gt; the tag &lt;STRONG&gt;fully passive&lt;/STRONG&gt; &lt;STRONG&gt;reading my resitance&lt;/STRONG&gt; sensor (X-ray radiaiton) and&lt;STRONG&gt; showing the result&lt;/STRONG&gt; &lt;STRONG&gt;on the Phone&lt;/STRONG&gt; screen. It's not the final product, but a DEMO to be delivered end of January so that the investors can decide whether to tranform it into a product or not.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a dedicated app running on your phone or PC to continually read the NFC memory?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is no dedicated app.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If not,&amp;nbsp;it means the NDEF message must be made available almost immediately after tapping your passive tag. This leaves very little time to do stuff from the moment the IC starts and the moment the phone decides to read the NFC memory.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I understood that even without a dedicated APP, when under NFC field the IC would create a message and commit it to memory. Then if i bring the phone out and into the filed again, i would read the message, i thought it would work like so:&lt;/P&gt;&lt;P&gt;1. Bring phone within Chip reach&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop 1&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. Chips sends back empty message&lt;/P&gt;&lt;P&gt;3. Chip calcualtes sensors resitance R: V1, V2, I, and R= (V1-V2)/I&lt;/P&gt;&lt;P&gt;4. Chip commits text message with value of R into memory (to be read next time)&lt;/P&gt;&lt;P&gt;5. Remove phone from NFC distance (chip stops operating)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;6. Bring phone back into NFC field&amp;nbsp;&lt;/P&gt;&lt;P&gt;7. Chip sends back Message saved in loop 1 (with Resitance value prev. measured)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically by entering and exiting the filed it reads the message twice, giving teh message it created the last loop. This is how it works while the Chip is connected to the PC (via LPC link).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However to convince investors that it is working powered only by phone i need it disconnected from the PC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously if investors do decide to fund the project to bring it to market, there will be a dedicated app, as the message it reads needs to be the current value. Also as we have discussed previusly, i cannot perfomr multiple reads and get a statistic without an app, so an app in the future is a must. But just to demostrate project viability this should be enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again for your help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Leo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 11:44:19 GMT</pubDate>
    <dc:creator>leo94</dc:creator>
    <dc:date>2021-01-06T11:44:19Z</dc:date>
    <item>
      <title>NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1206919#M43456</link>
      <description>&lt;P&gt;Using &lt;STRONG&gt;NHS3152&lt;/STRONG&gt; I am tyring to:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Power on with NFC (battery free)&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Get V1, V2, I (voltages and current from pin 1 and 4)&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Calculate resistance Res = (V1-V2)/I&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Commit message "V1: V1value, V2: V2value, I: Ivalue, Res: ResValue&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;The code is working, however i cannot remove semihosting becuase i am using a sprintf (&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Program-will-only-run-while-connected-to-LPC-link-2-amp/m-p/1186515#M42953" target="_self"&gt;Link to question with dries comment&lt;/A&gt; )&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leo94_0-1609850476929.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134013iDF81A129B390A2BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leo94_0-1609850476929.png" alt="leo94_0-1609850476929.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have the following questions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Can you confirm that i cannot flash to NHS3152 due to sprintf ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. How do i commit a message that contains the values of the variables V1, V2, I, RES ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically need to be able to disconnect the NHS3152 from hte LPCLINK, and still see my code running, but its been quite frustrating and everything i've tried hasn't worked, obviously i am not able to understand what the issue is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/144226"&gt;@converse&lt;/a&gt;&amp;nbsp;I am answering here since when i reply, it keeps telling me " &lt;SPAN&gt;Post flooding detected&amp;nbsp;&lt;/SPAN&gt; "&lt;/P&gt;&lt;P&gt;Thanks for the help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;So following on from&amp;nbsp;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Switching-the-selected-C-library/m-p/473669" target="_self"&gt;This post&lt;/A&gt;&amp;nbsp;I selected Quickstart --&amp;gt; set library/header --&amp;gt; redlibnohost. I then debugged and ran the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point when i &lt;STRONG&gt;bring the phone near the tag&lt;/STRONG&gt;, The LED goes red and the message&amp;nbsp; " adc_1: 0....." &lt;STRONG&gt;is displayed.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then &lt;STRONG&gt;stopped debug&lt;/STRONG&gt; and the &lt;STRONG&gt;message still updates normally&lt;/STRONG&gt; every time i bring the tag in contact.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leo94_0-1609875345308.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134040iC492FAC7CFF4CF68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leo94_0-1609875345308.png" alt="leo94_0-1609875345308.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I disconnected the USB from the PC, now the tag RED LED lights up, but as previously &lt;STRONG&gt;NO message&lt;/STRONG&gt; "Tag is empty or not alligned"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below is extra information incase the issue isn't a simple fix:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here I am assuming that the steps "Debug--&amp;gt;Resume--&amp;gt;stop Debug--&amp;gt; disconnect USB" Should allow the chip to have the program onboard, since it works with the blinky example ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference i have included the main and the libraries my code&amp;nbsp; (full code &lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Program-will-only-run-while-connected-to-LPC-link-2-amp/m-p/1186515#M42953" target="_self"&gt;here&lt;/A&gt;)is using: I have commeted out&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Chip_PMU_PowerMode_EnterDeepSleep();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;perhaps this causes an issue ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Libraries I imported:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include &amp;lt;string.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt; // contains sprintf function (needs to be included to avoid : https://stackoverflow.com/questions/8440816/warning-implicit-declaration-of-function
#include "board.h"
#include "ndeft2t/ndeft2t.h"

// MAIN
int main(void)
{
Board_Init();
NDEFT2T_Init();
NVIC_EnableIRQ(PIO0_IRQn); /* PIO0_IRQHandler is called when this interrupt fires. */
Chip_GPIO_EnableInt(NSS_GPIO, 0, 1);

// for ever, WHILE field is detected: 2. Connect the DAC to ANA1, set a continuous conversion of 1.25V.
for (;;) {
while (sFieldPresent) {

// 2. Connect the DAC to ANA1 -output Voltage
adcdac_nss_example_1();
// 3. Connect the I2D to ANA4, - read current ana4 through resistor
i2d_nss_example_1();
// 4. Connect the ADC to ANA4, and measure the voltage. -&amp;gt;v4
adcdac_nss_example_3();
// 5. Connect the ADC to ANA1, and measure the voltage. -&amp;gt; v1
adcdac_nss_example_3_2();
resval = (adcInput_1-adcInput_4)/(current_picoampere * 1e-12); // (v1-v4)/(I4pico * 1e-12) V/I=R [V/A =ohm]
sprintf((char *)sText, "adc_1: %6.2f adc_4: %6.2f current_picoampere: %8.d resistance: %e current_native: %6.d", adcInput_1, adcInput_4,current_picoampere, resval,current_native );//commented in from Thesis, changes payloadText to sText
// generate the message only once per field???
GenerateNdef_TextMime();

}
//Chip_PMU_PowerMode_EnterDeepSleep();
}
return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT2: reply to&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109560"&gt;@driesmoors&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hi Driers,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have modified loopx as you suggested, i am still running into the same problem: once i disconnect the USB from PC, "tag is empty or not alligned".&amp;nbsp;&lt;/P&gt;&lt;P&gt;To store values in fixed memory, i have created these two following voids that i modified from :&amp;nbsp;&lt;STRONG&gt;Example Read modify_ and write EEPROM&lt;/STRONG&gt; content in the section&amp;nbsp;&lt;STRONG&gt;eeprom: EEPROM driver&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Chip_reads_a_fixed_memory_location_in_EEPROM (void)
{
Chip_EEPROM_Init(NSS_EEPROM);
Chip_EEPROM_Read(NSS_EEPROM, 61, &amp;amp;sText, sizeof(sText-1));
Chip_EEPROM_DeInit(NSS_EEPROM);
}


void Chip_stores_values_in_fixed_memory_location_in_EEPROM (void)
{
Chip_EEPROM_Init(NSS_EEPROM);
Chip_EEPROM_Write(NSS_EEPROM, 61, &amp;amp;sText, sizeof(sText-1));
Chip_EEPROM_Flush(NSS_EEPROM, true);
Chip_EEPROM_DeInit(NSS_EEPROM);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code that i modified from the main, covering &lt;STRONG&gt;points 2-5 of your suggested loopx&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// MAIN
int main(void)
{
Board_Init();
NDEFT2T_Init();
NVIC_EnableIRQ(PIO0_IRQn); /* PIO0_IRQHandler is called when this interrupt fires. */
Chip_GPIO_EnableInt(NSS_GPIO, 0, 1);

// for ever, WHILE field is detected: 2. Connect the DAC to ANA1, set a continuous conversion of 1.25V.
for (;;) {
while (sFieldPresent) {

// 2. Chip reads a fixed memory location in EEPROM
	Chip_reads_a_fixed_memory_location_in_EEPROM();
	
// 3. Chip creates and commits an NDEF message
	GenerateNdef_TextMime();
	
// 4. Chip calculates sensors resistance R: V1, V2, I, and R= (V1-V2)/I
	// 2. Connect the DAC to ANA1 -output Voltage
	adcdac_nss_example_1();
	// 3. Connect the I2D to ANA4, - read current ana4 through resistor
	i2d_nss_example_1();
	// 4. Connect the ADC to ANA4, and measure the voltage. -&amp;gt;v4
	adcdac_nss_example_3();	
	// 5. Connect the ADC to ANA1, and measure the voltage. -&amp;gt; v1
	adcdac_nss_example_3_2();
	resval = (adcInput_1-adcInput_4)/(current_picoampere * 1e-12); // (v1-v4)/(I4pico * 1e-12) V/I=R [V/A =ohm]

// 5. Chip stores values in fixed memory location in EEPROM
	sprintf((char *)sText, "adc_1: %6.2f adc_4: %6.2f current_picoampere: %8.d resistance: %e current_native: %6.d", adcInput_1, adcInput_4,current_picoampere, resval,current_native );
	Chip_stores_values_in_fixed_memory_location_in_EEPROM();


GenerateNdef_TextMime();

}

}
return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;After debug-resume --&amp;gt; message is updating correctly&lt;/P&gt;&lt;P&gt;Stop --&amp;gt; message still updating correclty&lt;/P&gt;&lt;P&gt;Remove USB --&amp;gt;&amp;nbsp;tag is empty or not alligned&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 14:52:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1206919#M43456</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-07T14:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1206992#M43457</link>
      <description>&lt;P&gt;Set semihosting to NONE. sprintf is not semihosting, but printf is (semihosting means that any i/o operations are carried out on the host - such as file read and write). sprintf does not use i/o.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 16:38:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1206992#M43457</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-01-05T16:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207017#M43458</link>
      <description>&lt;P&gt;Do you have precise instructions to set semihosting to NONE?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might be giving infomation that isn't relevant here, but a difference i see between my project and one like Blinky are:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Image 1: The DAC_ADC_toghether folder view : It doens't create a Release.launch (like blinky does)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leo94_1-1609866240371.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134028i6C6E088103330147/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leo94_1-1609866240371.png" alt="leo94_1-1609866240371.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I have checked in properties, but i cannot see other options:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leo94_2-1609866622114.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134029iA4E4AB0FB0CC8377/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leo94_2-1609866622114.png" alt="leo94_2-1609866622114.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3. For Blinky (that works also whilst disconnected from PC and only in NFC presence) i have a release available:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leo94_4-1609866707021.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134031i4578F042E648DAF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leo94_4-1609866707021.png" alt="leo94_4-1609866707021.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please let me know the steps to remove semihosting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Leo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 17:23:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207017#M43458</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-05T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207020#M43459</link>
      <description>&lt;P&gt;Semihosting is a library selection and has nothing to do with debug or release builds, or launch configuration. Read this faq, and the others listed at the bottom of the faq&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/What-are-none-nohost-and-semihost-libraries/m-p/475327" target="_blank"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/What-are-none-nohost-and-semihost-libraries/m-p/475327&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 17:41:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207020#M43459</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-01-05T17:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207419#M43467</link>
      <description>&lt;P&gt;I have repied by adding an EDIT to the question above, since in the reply it kees telling me "&lt;SPAN&gt;Post flooding detected&amp;nbsp;"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 09:10:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207419#M43467</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-06T09:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207501#M43469</link>
      <description>&lt;P&gt;Hi Leo,&lt;/P&gt;
&lt;P&gt;What do you mean with "&lt;SPAN&gt;Commit message"&lt;/SPAN&gt;? Creating a text message so your phone can show the results?&lt;/P&gt;
&lt;P&gt;The NFC controller of the NHS3152 is a type 2 tag. It cannot hold off reading the NFC memory. Is there a dedicated app running on your phone or PC to continually read the NFC memory?&amp;nbsp; If not,&amp;nbsp;it means the NDEF message must be made available almost immediately after tapping your passive tag. This leaves very little time to do stuff from the moment the IC starts and the moment the phone decides to read the NFC memory.&lt;/P&gt;
&lt;P&gt;Br,&lt;BR /&gt;Dries.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:17:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207501#M43469</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2021-01-06T11:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207505#M43470</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Dries,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What do you mean with "Commit message"? Creating a text message so your phone can show the results?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Exactly.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to &lt;STRONG&gt;Demostrate&lt;/STRONG&gt; the tag &lt;STRONG&gt;fully passive&lt;/STRONG&gt; &lt;STRONG&gt;reading my resitance&lt;/STRONG&gt; sensor (X-ray radiaiton) and&lt;STRONG&gt; showing the result&lt;/STRONG&gt; &lt;STRONG&gt;on the Phone&lt;/STRONG&gt; screen. It's not the final product, but a DEMO to be delivered end of January so that the investors can decide whether to tranform it into a product or not.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a dedicated app running on your phone or PC to continually read the NFC memory?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is no dedicated app.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If not,&amp;nbsp;it means the NDEF message must be made available almost immediately after tapping your passive tag. This leaves very little time to do stuff from the moment the IC starts and the moment the phone decides to read the NFC memory.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I understood that even without a dedicated APP, when under NFC field the IC would create a message and commit it to memory. Then if i bring the phone out and into the filed again, i would read the message, i thought it would work like so:&lt;/P&gt;&lt;P&gt;1. Bring phone within Chip reach&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop 1&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. Chips sends back empty message&lt;/P&gt;&lt;P&gt;3. Chip calcualtes sensors resitance R: V1, V2, I, and R= (V1-V2)/I&lt;/P&gt;&lt;P&gt;4. Chip commits text message with value of R into memory (to be read next time)&lt;/P&gt;&lt;P&gt;5. Remove phone from NFC distance (chip stops operating)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;6. Bring phone back into NFC field&amp;nbsp;&lt;/P&gt;&lt;P&gt;7. Chip sends back Message saved in loop 1 (with Resitance value prev. measured)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically by entering and exiting the filed it reads the message twice, giving teh message it created the last loop. This is how it works while the Chip is connected to the PC (via LPC link).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However to convince investors that it is working powered only by phone i need it disconnected from the PC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously if investors do decide to fund the project to bring it to market, there will be a dedicated app, as the message it reads needs to be the current value. Also as we have discussed previusly, i cannot perfomr multiple reads and get a statistic without an app, so an app in the future is a must. But just to demostrate project viability this should be enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again for your help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Leo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:44:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207505#M43470</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-06T11:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207514#M43471</link>
      <description>&lt;P&gt;Hi Leo,&lt;/P&gt;
&lt;P&gt;Ok. Tx for sharing this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NFC memory exposed to the phone is partially NFC EEPROM, partially SRAM.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;page 0-3: NFC EEPROM&lt;/LI&gt;
&lt;LI&gt;page 4-84h: SRAM&lt;/LI&gt;
&lt;LI&gt;page 84h-E2h:&amp;nbsp;NFC EEPROM&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The ARM reads and writes into the SRAM region. After removing the phone, the NFC controller dies. In a passive setup, the chip dies too and the SRAM region is no longer refreshed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your loop can be modified to:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Loop x&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Bring phone within Chip reach&lt;/LI&gt;
&lt;LI&gt;Chip reads a fixed memory location in EEPROM&lt;/LI&gt;
&lt;LI&gt;Chip creates and commits an NDEF message&lt;BR /&gt;Less than ~16 ms have now passed since 1.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Chip calculates sensors resistance R: V1, V2, I, and R= (V1-V2)/I&lt;/LI&gt;
&lt;LI&gt;Chip stores values in fixed memory location in EEPROM&lt;/LI&gt;
&lt;LI&gt;Remove phone from NFC distance (chip stops operating)&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Good to read you will use a dedicated app. Without that, you are relying on the background reading. On Android, NFC keeps powering the tag as along as the tag is in reach. On iOS, the NFC field is immediately shut off after reading the NDEF message, preventing steps 4,5,6 to be executed.&amp;nbsp;When using an app, you can guarantee an NFC field on iOS too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Dries.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 12:14:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207514#M43471</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2021-01-06T12:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1208384#M43480</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109560"&gt;@driesmoors&lt;/a&gt;&amp;nbsp;I have again added an EDIT to the question above, since in the reply it kees telling me "&lt;/SPAN&gt;&lt;SPAN&gt;Post flooding detected&amp;nbsp;",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Leo&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 14:53:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1208384#M43480</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-07T14:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1208403#M43481</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;Post flooding detected" normally means that you are trying to post the same message&amp;nbsp;multiple times (are you hitting Submit/Post/Reply more than once?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One thing to try is to clear your browser cache for this website and see if that helps.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 15:30:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1208403#M43481</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-01-07T15:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1208821#M43492</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok,&amp;nbsp;&lt;BR /&gt;I selected "reply to this topic" and when i tried to submit it told me "incorrecly formatted HTML", so then i guess when i resubmitt it is considered a second submission and thus flooding.&lt;BR /&gt;&lt;BR /&gt;Is the EDIT to my original POST enough, or do you want me to try and reply again here below?&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Leo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 08:50:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1208821#M43492</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-08T08:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1209121#M43505</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you measure the time it takes from the moment main gets control and the call to &lt;FONT face="courier new,courier"&gt;GenerateNdef_TextMime&lt;/FONT&gt; finishes? And then to when &lt;FONT face="courier new,courier"&gt;Chip_stores_values_in_fixed_memory_location_in_EEPROM&lt;/FONT&gt; finishes? You can toggle a pin at different locations and detect the flank changes with a scope to measure this accurately.&lt;/P&gt;
&lt;P&gt;Some smaller remarks:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The loop &lt;FONT face="courier new,courier"&gt;while (sFieldPresent)&lt;/FONT&gt; is only useful to get more readings while debugging.&lt;/LI&gt;
&lt;LI&gt;In a passive setup, it seems best to have all actions before the &lt;FONT face="courier new,courier"&gt;for (;;)&lt;/FONT&gt; loop, and to remove the &lt;FONT face="courier new,courier"&gt;sFieldPresent&lt;/FONT&gt; loop.&lt;/LI&gt;
&lt;LI&gt;There is no need to call &lt;FONT face="courier new,courier"&gt;Chip_EEPROM_Init&lt;/FONT&gt; as it has already been called during &lt;FONT face="courier new,courier"&gt;Board_Init&lt;/FONT&gt;. And after calling &lt;FONT face="courier new,courier"&gt;Chip_EEPROM_Flush&lt;/FONT&gt; there is no need to call &lt;FONT face="courier new,courier"&gt;Chip_EEPROM_DeInit&lt;/FONT&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;BR,&lt;BR /&gt;Dries.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 20:57:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1209121#M43505</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2021-01-08T20:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1209649#M43522</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hello Driers,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I will run the tests &lt;STRONG&gt;on Tuesday&amp;nbsp;&lt;/STRONG&gt;as I have to go back to the LAB to use the scope I will update you &lt;STRONG&gt;Tuesday afternoon&lt;/STRONG&gt; or &lt;STRONG&gt;Wednesday&lt;/STRONG&gt;. Below are the answers to the points you raised: &lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#0000FF"&gt;The loop&amp;nbsp;&lt;FONT face="courier new,courier"&gt;while (sFieldPresent)&lt;/FONT&gt;&amp;nbsp;is only useful to get more readings while debugging.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have removed the &lt;FONT face="courier new,courier"&gt;while (sFieldPresent) loop&amp;nbsp;&lt;/FONT&gt;(see main below)&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#0000FF"&gt;In a passive setup, it seems best to have all actions before the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;for (;;)&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;loop, and to remove the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;sFieldPresent&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;loop.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I didn't understand this point. By &lt;EM&gt;actions&amp;nbsp;&lt;/EM&gt;what do you mean ?&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#0000FF"&gt;There is no need to call&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Chip_EEPROM_Init&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as it has already been called during&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Board_Init&lt;/FONT&gt;. And after calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Chip_EEPROM_Flush&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;there is no need to call&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Chip_EEPROM_DeInit&lt;/FONT&gt;.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have Now removed Chip_EEPROM_Init/DeInit from the EEPROM loops:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Chip_reads_a_fixed_memory_location_in_EEPROM (void)
{
	// REMOVED : Chip_EEPROM_Init(NSS_EEPROM);
	Chip_EEPROM_Read(NSS_EEPROM, 61, &amp;amp;sText, sizeof(sText-1));
	// REMOVED : Chip_EEPROM_DeInit(NSS_EEPROM);
}


void Chip_stores_values_in_fixed_memory_location_in_EEPROM (void)
{
	// REMOVED : Chip_EEPROM_Init(NSS_EEPROM);
	Chip_EEPROM_Write(NSS_EEPROM, 61, &amp;amp;sText, sizeof(sText-1));
	Chip_EEPROM_Flush(NSS_EEPROM, true);
	// REMOVED : Chip_EEPROM_DeInit(NSS_EEPROM);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Can you measure the time it takes from the moment main gets control and the call to&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;GenerateNdef_TextMime&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;finishes? And then to when&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Chip_stores_values_in_fixed_memory_location_in_EEPROM&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;finishes? You can toggle a pin at different locations and detect the flank changes with a scope to measure this accurately.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To toggle pins i have parts of the code from &lt;EM&gt;&lt;STRONG&gt;Example 1 - Configuring individual pins.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;I have toggled pin 7 with "&lt;STRONG&gt;Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7)&lt;/STRONG&gt;;"&amp;nbsp; 4 times, &lt;STRONG&gt;next line after&lt;/STRONG&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;&amp;nbsp;Chip_reads_a_fixed_memory_location_in_EEPROM();&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;GenerateNdef_TextMime();&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;sprintf((char *)sText...&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Chip_stores_values_in_fixed_memory_location_in_EEPROM&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;Below is the main part of the code that i intend to run tomorrow. And i Will let you know the results.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;int main(void)
{
Board_Init();
NDEFT2T_Init();
NVIC_EnableIRQ(PIO0_IRQn); /* PIO0_IRQHandler is called when this interrupt fires. */
Chip_GPIO_EnableInt(NSS_GPIO, 0, 1);

Chip_IOCON_SetPinConfig(NSS_IOCON, 7, IOCON_FUNC_0 | IOCON_RMODE_INACT | IOCON_LPF_DISABLE);


// for ever, WHILE field is detected: 2. Connect the DAC to ANA1, set a continuous conversion of 1.25V.
for (;;) {

// 2. Chip reads a fixed memory location in EEPROM
	Chip_reads_a_fixed_memory_location_in_EEPROM();
	Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7);
// 3. Chip creates and commits an NDEF message
	GenerateNdef_TextMime();
	Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7);

// 4. Chip calculates sensors resistance R: V1, V2, I, and R= (V1-V2)/I
	// 2. Connect the DAC to ANA1 -output Voltage
	adcdac_nss_example_1();
	// 3. Connect the I2D to ANA4, - read current ana4 through resistor
	i2d_nss_example_1();
	// 4. Connect the ADC to ANA4, and measure the voltage. -&amp;gt;v4
	adcdac_nss_example_3();
	// 5. Connect the ADC to ANA1, and measure the voltage. -&amp;gt; v1
	adcdac_nss_example_3_2();
	resval = (adcInput_1-adcInput_4)/(current_picoampere * 1e-12); // (v1-v4)/(I4pico * 1e-12) V/I=R [V/A =ohm]

// 5. Chip stores values in fixed memory location in EEPROM
	sprintf((char *)sText, "adc_1: %6.2f adc_4: %6.2f current_picoampere: %8.d resistance: %e current_native: %6.d", adcInput_1, adcInput_4,current_picoampere, resval,current_native );//commented in from Thesis, changes payloadText to sText
	Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7);
	Chip_stores_values_in_fixed_memory_location_in_EEPROM();
	Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7);

	GenerateNdef_TextMime();


}
return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 May 2021 09:28:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1209649#M43522</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-05-08T09:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1210501#M43547</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109560"&gt;@driesmoors&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have done the tests that you asked for:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have setup the code with&amp;nbsp;&lt;EM&gt;Chip_GPIO_SetPinOutHigh&lt;/EM&gt; instead of toggle since it was clearer in the oscilloscope. I place a &lt;STRONG&gt;HIGH&lt;/STRONG&gt;before the For loop, then &lt;STRONG&gt;LOW&amp;nbsp;&lt;/STRONG&gt;after Store values and &lt;STRONG&gt;HIGH&amp;nbsp;&lt;/STRONG&gt;after generate ndef; as shown below:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;Chip_IOCON_SetPinConfig(NSS_IOCON, 7, IOCON_FUNC_0 | IOCON_RMODE_INACT | IOCON_LPF_DISABLE);&lt;BR /&gt;Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 7);&lt;BR /&gt;for (;;) {&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;Chip_stores_values_in_fixed_memory_location_in_EEPROM();&lt;BR /&gt;Chip_GPIO_SetPinOutLow(NSS_GPIO, 0, 7);&lt;BR /&gt;GenerateNdef_TextMime();&lt;BR /&gt;Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 7);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;After debug-run while still connected, I have:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The signal goes LOW at &lt;STRONG&gt;333ms&lt;/STRONG&gt; after : Chip_stores_values_in_fixed_memory_location_in_EEPROM&lt;/LI&gt;&lt;LI&gt;Then goes HIGH at &lt;STRONG&gt;350ms&lt;/STRONG&gt; (17ms after) after:&amp;nbsp;GenerateNdef_TextMime();&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;With HIGH =&lt;STRONG&gt;3.3V&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I then disconnected the USB cable and powered by NFC (phone):&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the same results except High is &lt;STRONG&gt;1.9V&amp;nbsp;&lt;/STRONG&gt;instead of&lt;STRONG&gt; 3.3V&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What do you think the problem is? Perhaps the message isn't being retrieved from EEPROM ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;Leo&lt;/P&gt;&lt;P&gt;Below is the new main:&lt;/P&gt;&lt;PRE&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;Board_Init();&lt;BR /&gt;NDEFT2T_Init();&lt;BR /&gt;NVIC_EnableIRQ(PIO0_IRQn); /* PIO0_IRQHandler is called when this interrupt fires. */&lt;BR /&gt;Chip_GPIO_EnableInt(NSS_GPIO, 0, 1);&lt;BR /&gt;&lt;BR /&gt;Chip_IOCON_SetPinConfig(NSS_IOCON, 7, IOCON_FUNC_0 | IOCON_RMODE_INACT | IOCON_LPF_DISABLE);&lt;BR /&gt;Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 7);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;// for ever, WHILE field is detected: 2. Connect the DAC to ANA1, set a continuous conversion of 1.25V.&lt;BR /&gt;for (;;) {&lt;BR /&gt;// main gets control for loop starts&lt;BR /&gt;&lt;BR /&gt;// 2. Chip reads a fixed memory location in EEPROM adds value to sText&lt;BR /&gt;Chip_reads_a_fixed_memory_location_in_EEPROM();&lt;BR /&gt;//Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 7);&lt;BR /&gt;//Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7);&lt;BR /&gt;// 3. Chip creates and commits an NDEF message&lt;BR /&gt;GenerateNdef_TextMime();&lt;BR /&gt;//Chip_GPIO_SetPinToggle(NSS_GPIO, 0, 7);&lt;BR /&gt;&lt;BR /&gt;// 4. Chip calculates sensors resistance R: V1, V2, I, and R= (V1-V2)/I&lt;BR /&gt;// 2. Connect the DAC to ANA1 -output Voltage&lt;BR /&gt;adcdac_nss_example_1();&lt;BR /&gt;// 3. Connect the I2D to ANA4, - read current ana4 through resistor&lt;BR /&gt;i2d_nss_example_1();&lt;BR /&gt;// 4. Connect the ADC to ANA4, and measure the voltage. -&amp;gt;v4&lt;BR /&gt;adcdac_nss_example_3();&lt;BR /&gt;// 5. Connect the ADC to ANA1, and measure the voltage. -&amp;gt; v1&lt;BR /&gt;adcdac_nss_example_3_2();&lt;BR /&gt;resval = (adcInput_1-adcInput_4)/(current_picoampere * 1e-12); // (v1-v4)/(I4pico * 1e-12) V/I=R [V/A =ohm]&lt;BR /&gt;&lt;BR /&gt;// 5. Chip stores values in fixed memory location in EEPROM&lt;BR /&gt;sprintf((char *)sText, "adc_1: %6.2f adc_4: %6.2f current_picoampere: %8.d resistance: %e current_native: %6.d", adcInput_1, adcInput_4,current_picoampere, resval,current_native );//commented in from Thesis, changes payloadText to sText&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Chip_stores_values_in_fixed_memory_location_in_EEPROM();&lt;BR /&gt;Chip_GPIO_SetPinOutLow(NSS_GPIO, 0, 7);&lt;BR /&gt;GenerateNdef_TextMime();&lt;BR /&gt;Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 7);&lt;BR /&gt;// GenerateNdef_TextMime finishes&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Also, when powered by the phone &lt;STRONG&gt;NFC only&lt;/STRONG&gt; (USB disconnected), it occasionly displays the message "adc_try road" the original sText was "country road" (song came on spotify, no meaning", so it seems to be only replacing a piece of the message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LOW 333ms HIGH 350ms only NFC powered" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134592i45DF27D544F7E0D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="OSCI_HIGHLOW_NFC.jpg" alt="LOW 333ms HIGH 350ms only NFC powered" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;LOW 333ms HIGH 350ms only NFC powered&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Setup-Phone displays adc_tryroad now, not expected message" style="width: 150px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134594i2ACBD4B16A54FE5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Setup-Phone displays adc_tryroad now, not expected message" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Setup-Phone displays adc_tryroad now, not expected message&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 16:20:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1210501#M43547</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-12T16:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1212808#M43585</link>
      <description>&lt;P&gt;Hi Leo,&lt;/P&gt;
&lt;P&gt;I found these issues (after running the code myself; I kept reading over them)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The call to read from EEPROM is wrong:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;sText&lt;/FONT&gt; is already a pointer, no need to put an extra &amp;amp; in front of it&lt;/LI&gt;
&lt;LI&gt;The order of decrementing and sizeof is wrong: it should be &lt;FONT face="courier new,courier"&gt;sizeof(sText) - 1&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Line I used: &lt;FONT face="courier new,courier"&gt;Chip_EEPROM_Read(NSS_EEPROM, 61, sText, sizeof(sText));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likewise, the call to write to EEPROM has the same issues.&lt;/P&gt;
&lt;P&gt;Line I used:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Chip_EEPROM_Write(NSS_EEPROM, 61, sText, sizeof(sText));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When writing the NDEF text record, you can better use &lt;FONT face="courier new,courier"&gt;strlen&lt;/FONT&gt;, as the string length is less than the array you use to store it in.&lt;/P&gt;
&lt;P&gt;Line I used (in &lt;FONT face="courier new,courier"&gt;GenerateNdef_TextMime&lt;/FONT&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;if (NDEFT2T_WriteRecordPayload(instance, sText, strlen(sText))) {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;After changing the above (plus some dead code removal, which is irrelevant) I got it working, both while debugging and when run stand-alone.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Try this, and let me know whether this helped for you.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Best,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Dries.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2021 19:20:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1212808#M43585</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2021-01-17T19:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152  - Write NDEF message containing integer values (from ADC)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1216685#M43627</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/109560"&gt;@driesmoors&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the corrections you suggested and it worked! thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It still for some calibration issue is reads 40*actual_resitance, but this doesn't matter for the demos.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We even tried it witha&amp;nbsp; textile humidity sensor collegues are developping and it worked for them too,&lt;/P&gt;&lt;P&gt;Thanks fo your valuable help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Leo&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 08:43:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1216685#M43627</guid>
      <dc:creator>leo94</dc:creator>
      <dc:date>2021-01-19T08:43:57Z</dc:date>
    </item>
  </channel>
</rss>

