<?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: BOD implementation in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610782#M23836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having the exact same problems, can't seem to reset my event status (hence it gets stuck in the IRQ handler). Have you tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_EVRT-&amp;gt;CLR_STAT &amp;amp;= (0x01UL&amp;lt;&amp;lt;EVRT_SRC_BOD1); // clears the status register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesnt work the only way I can actually get out of the IRQ is by doing&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; LPC_EVRT-&amp;gt;CLR_EN = (0x01UL&amp;lt;&amp;lt;EVRT_SRC_BOD1); // disable the bod event bit in the enable register&lt;BR /&gt;&lt;BR /&gt;But the 2nd command is pretty useless as you wouldn't use it in a real life application.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Let me know if you've found a solution to the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2016 01:10:58 GMT</pubDate>
    <dc:creator>jakeweiner</dc:creator>
    <dc:date>2016-11-30T01:10:58Z</dc:date>
    <item>
      <title>BOD implementation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610781#M23835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you have a example implementation for BOD LPC4317? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote the following lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Bown-Out Detect voltage level (0-3)&lt;BR /&gt;&amp;nbsp; uint32_t bodVoltageLevel = 3; // interrupt level 3 (3.05V)&lt;BR /&gt;&amp;nbsp; // Brown-Out Reset voltage level (0-3)&lt;BR /&gt;&amp;nbsp; uint32_t borVolatgeReset = 0; // reset level 0 (1.9V)&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;NVIC_DisableIRQ(EVENTROUTER_IRQn);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Initialize the event router.&lt;BR /&gt;&amp;nbsp;Chip_EVRT_Init();&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Configures the BOD level and reset level on LPC18xx/LPC43xx parts.&lt;BR /&gt;&amp;nbsp;// Note: BOD reset is not used!&lt;BR /&gt;&amp;nbsp;Chip_CREG_ConfigureBODaR(bodVoltageLevel, borVolatgeReset);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Set up the type of interrupt type for a source to EVRT.&lt;BR /&gt;&amp;nbsp;// Level configuration register (HILO)&lt;BR /&gt;&amp;nbsp;// Edge configuration (EDGE)&lt;BR /&gt;&amp;nbsp;// HILO bit &amp;nbsp;n EDGE bit n &amp;nbsp;Description&lt;BR /&gt;&amp;nbsp; // 0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Detect LOW level (currently active)&lt;BR /&gt;&amp;nbsp; // 0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Detect falling edge&lt;BR /&gt;&amp;nbsp; // 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Detect HIGH level&lt;BR /&gt;&amp;nbsp; // 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Detect rising edge&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Chip_EVRT_ConfigIntSrcActiveType(EVRT_SRC_BOD1, EVRT_SRC_ACTIVE_LOW_LEVEL);&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// ***&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Event Enable register (ENABLE)&lt;BR /&gt;&amp;nbsp;// The ENABLE register can be read at any time. To change the contents of this register, use&lt;BR /&gt;&amp;nbsp; // the CLR_EN and SET_EN registers.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Set event enable register (SET_EN)&lt;BR /&gt;&amp;nbsp;// The SET_EN register sets the corresponding bits in the ENABLE register.&lt;BR /&gt;&amp;nbsp;// Enable interrupt sources to EVRT. Source is BOD.&lt;BR /&gt;&amp;nbsp;// BOD interrupt. Not active in Deep-sleep, Power-down, and&lt;BR /&gt;&amp;nbsp; // Deep power-down mode. Use for wake-up from Sleep mode.&lt;BR /&gt;&amp;nbsp;// Note: BOD reset is not used!&lt;BR /&gt;&amp;nbsp;Chip_EVRT_SetUpIntSrc(EVRT_SRC_BOD1, ENABLE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;// Clear event enable register (CLR_EN)&lt;BR /&gt;&amp;nbsp; // The CLR_EN register clears the corresponding bits in the ENABLE register.&lt;BR /&gt;&amp;nbsp;// Nothing to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp; // ***&lt;BR /&gt;&amp;nbsp; // Event status register (STATUS)&lt;BR /&gt;&amp;nbsp;// The STATUS register monitors the internally generated interrupt or event signal from the&lt;BR /&gt;&amp;nbsp;// peripherals. The contents of this register can be read at any time. To change the contents&lt;BR /&gt;&amp;nbsp;// of this register, use the CLR_STAT and SET_STAT registers.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Set event status register (SET_STAT)&lt;BR /&gt;&amp;nbsp;// Nothing to do.&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;// Clear event status register (CLR_STAT)&lt;BR /&gt;&amp;nbsp;// Clear pending interrupt EVRT source. Source is BOD.&lt;BR /&gt;&amp;nbsp;Chip_EVRT_ClrPendIntSrc(EVRT_SRC_BOD1);&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;// ***&lt;BR /&gt;&amp;nbsp; // Set irq event router priority&lt;BR /&gt;&amp;nbsp; NVIC_SetPriority(EVENTROUTER_IRQn, 1); // High priority&amp;nbsp; &lt;BR /&gt;&amp;nbsp;// Clear a pending event router interrupt&lt;BR /&gt;&amp;nbsp; NVIC_ClearPendingIRQ(EVENTROUTER_IRQn);&lt;BR /&gt;&amp;nbsp;// Enable event router interrupt&lt;BR /&gt;&amp;nbsp; NVIC_EnableIRQ(EVENTROUTER_IRQn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IRQ Looks like:&lt;/P&gt;&lt;P&gt;void EVRT_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;// For debugging, remove later again&lt;BR /&gt;&amp;nbsp;__nop();&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;// Check if a source is sending interrupt to EVRT&amp;nbsp;&lt;BR /&gt;&amp;nbsp;if (SET == Chip_EVRT_IsSourceInterrupting(EVRT_SRC_BOD1))&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;Chip_EVRT_ClrPendIntSrc(EVRT_SRC_BOD1);&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Problem is, after I activate the IRQ NVIC_EnableIRQ(EVENTROUTER_IRQn);, the MCU jumps into the IRQ-handlder. Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another Problem is, that I can not reset the Status reg via &amp;nbsp;Chip_EVRT_ClrPendIntSrc(EVRT_SRC_BOD1);&amp;nbsp; The function call has no effect?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is wrong? Thank's for any Feedback!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 11:06:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610781#M23835</guid>
      <dc:creator>timokunze</dc:creator>
      <dc:date>2016-11-21T11:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: BOD implementation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610782#M23836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having the exact same problems, can't seem to reset my event status (hence it gets stuck in the IRQ handler). Have you tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_EVRT-&amp;gt;CLR_STAT &amp;amp;= (0x01UL&amp;lt;&amp;lt;EVRT_SRC_BOD1); // clears the status register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesnt work the only way I can actually get out of the IRQ is by doing&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; LPC_EVRT-&amp;gt;CLR_EN = (0x01UL&amp;lt;&amp;lt;EVRT_SRC_BOD1); // disable the bod event bit in the enable register&lt;BR /&gt;&lt;BR /&gt;But the 2nd command is pretty useless as you wouldn't use it in a real life application.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Let me know if you've found a solution to the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 01:10:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610782#M23836</guid>
      <dc:creator>jakeweiner</dc:creator>
      <dc:date>2016-11-30T01:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: BOD implementation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610783#M23837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. I resolved the problem. The problem was, that the IRQ was permanently active.&amp;nbsp;You can Close this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 07:54:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/BOD-implementation/m-p/610783#M23837</guid>
      <dc:creator>timokunze</dc:creator>
      <dc:date>2016-11-30T07:54:02Z</dc:date>
    </item>
  </channel>
</rss>

