<?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>LPC MicrocontrollersのトピックRe: Lpc1115 reading a Hall sensor</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739118#M29812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vasil Borisov,&lt;/P&gt;&lt;P&gt;You are welcome, waiting for your updated information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jan 2018 02:32:26 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2018-01-23T02:32:26Z</dc:date>
    <item>
      <title>Lpc1115 reading a Hall sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739115#M29809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I am new to embedded programming and I want to ask some questions. I have a project where I need to measure time interval between two rising edges (formed by a Hall sensor). I plan to use a counter with a capture so I can measure the time interval between 2 rising edges and display that through a UART serial connection. For the time being I am trying to just to read the value of the TC at moment when a capture event occurs on the pin ( CAP PIN1_5 - for TMR32B0). The strange thing is that when I try to flash this code into the memory my UART stops sending, while I am using debug session and USB cable everything is OK. My point is that I need to flash that into the memory so I can connect the Hall sensor to the capture pin and supply the board with an external power supply in order them to share a common ground.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;===============================================================================&lt;BR /&gt; Name : TestLPC1115.c&lt;BR /&gt; Author : $(author)&lt;BR /&gt; Version :&lt;BR /&gt; Copyright : $(copyright)&lt;BR /&gt; Description : main definition&lt;BR /&gt;===============================================================================&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;#ifdef __USE_CMSIS&lt;BR /&gt;#include "LPC11xx.h"&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;cr_section_macros.h&amp;gt;&lt;BR /&gt;#include "delay.h"&lt;BR /&gt;#include "uart.h"&lt;BR /&gt;#include "gpio.h"&lt;BR /&gt;#include "timer32.h"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; float count_value;&lt;BR /&gt; char string[20];&lt;BR /&gt; UARTInit(9600);&lt;/P&gt;&lt;P&gt;LPC_IOCON-&amp;gt;PIO1_5 &amp;amp;= ~0x07; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Timer0_32 I/O config */&lt;BR /&gt; LPC_IOCON-&amp;gt;PIO1_5 |= 0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Timer0_32 CAP0 */&lt;BR /&gt; LPC_IOCON-&amp;gt;PIO1_5 = (0&amp;lt;&amp;lt;3) | (0&amp;lt;&amp;lt;4); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// disable pull-up and pull-down resistors&lt;/P&gt;&lt;P&gt;LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= (1&amp;lt;&amp;lt;10); // enable clock for timer1&lt;/P&gt;&lt;P&gt;//configure counter&lt;BR /&gt; LPC_TMR32B0-&amp;gt;TCR =0x2; //counter disable&lt;BR /&gt; LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= (1&amp;lt;&amp;lt;9); // enable clock for timer0&lt;BR /&gt; LPC_TMR32B0-&amp;gt;CTCR =0x1; //counter mode,increments on rising edges&lt;BR /&gt; LPC_TMR32B0-&amp;gt;PR =0x0; //set prescaler&lt;BR /&gt; LPC_TMR32B0-&amp;gt;TCR =0x1; //counter enable&lt;/P&gt;&lt;P&gt;while(1){&lt;/P&gt;&lt;P&gt;count_value = LPC_TMR32B0-&amp;gt;TC;&lt;BR /&gt; sprintf(string, "Value = %f \r\n", count_value);&lt;BR /&gt; UART_SendString(string);&lt;BR /&gt; delay32Ms(1,500);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2018 13:43:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739115#M29809</guid>
      <dc:creator>vasilborisov</dc:creator>
      <dc:date>2018-01-19T13:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Lpc1115 reading a Hall sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739116#M29810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vasil Borisov,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Two points you need to note:&lt;/P&gt;&lt;P&gt;1. When you program the chip, you need to download the code to the flash, not the RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; After you download the code to the chip flash, both debug and without debug, the code can work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; But if you download the code to the RAM, after power off and power on the board again, the code will be disappear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; So, please configure your project, download the code to the flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Note the PIO0_1 pin when you do the reset&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20465i373F43D08446303E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After you download the code to the chip, without debugging, before you do the reset, you must make sure PIO_1 is high, otherwise, you code will enter in the ISP mode.&lt;/P&gt;&lt;P&gt;So, just keep the PIO0_1 as higher.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 06:39:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739116#M29810</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-01-22T06:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lpc1115 reading a Hall sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739117#M29811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kerry,&lt;/P&gt;&lt;P&gt;thank you for your detailed reply, I am going to try that and post here if I had any success :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 15:02:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739117#M29811</guid>
      <dc:creator>vasilborisov</dc:creator>
      <dc:date>2018-01-22T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Lpc1115 reading a Hall sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739118#M29812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vasil Borisov,&lt;/P&gt;&lt;P&gt;You are welcome, waiting for your updated information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 02:32:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Lpc1115-reading-a-Hall-sensor/m-p/739118#M29812</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-01-23T02:32:26Z</dc:date>
    </item>
  </channel>
</rss>

