Home
AN10908 - NXP Semiconductors
Contents
1. RTC Alarm Interrupt WDT timeout USBActivity or CANActivity interrupt will wake up the device Afterwards it requires re initialization of the PLL and clock dividers Power down Same as Deep Sleep however flash and the IRC are also powered down Deep Power down Power is shut off to the entire chip Only reset or the RTC can wake up the device 2 Requirements 2 1 Hardware This sample software was developed on Keil s MCB1700 development board which features an LPC1768 microcontroller This particular microcontroller contains two CAN controllers In this sample project only CAN1 is used to receive CAN packets Aarati Pol Or CAN Rx d CANAct CPU RST INTO Fig 1 Keil s MCB1700 featuring the LPC1768 AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 4 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup Since our objective here is to test the CAN Activity interrupt we need to place the LPC1700 into Deep Sleep or Power down mode This means that we need some additional hardware that will generate CAN packets This hardware should be the only CAN node connected to the LPC1700 so that we are in control of the CAN bus activity The hardware required to connect the LPC1700 to the CAN network can be referred to the application note referenced in the Introduction Although specialize
2. product names service names and trademarks are property of their respective owners NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 11 of 12 NXP Semiconductors AN10908 7 Contents CAN activity wakeup WINtRO DUCTION scek desc seee ci ceeteseccestecncendevieeseaeteciencesisens 3 CAN activity e i eed ee eh est 3 Reduced power Modes ceecee 3 Requirements cceseeeeeeseeeeeeeeeeenseneeeeeeeneneeenaeen 4 HardWwate ccsccccccceceeeececeeceeeeeeeeneeaeeeseeeeeeennaees 4 SOMWAMNG aeeiiaii aireta aieeaa endsideceet 5 Implementation ccccssseeeeeeeeeeeeeeeeeseneneeeee 5 Button INpUt esens saadaa 5 LED OUPUt cisien oieee enaos erapr Ooi EEn tue 6 VART O tp t iissa as 6 DICEPIMOME 2i 22 cssseccesssdeecsesagecdsepensacias cesedbensniecase 7 Deep sleep and Power down mode 0 7 Conclusion ssnnnannnn ana 8 KNOWN ISSUES ccceceeeeeseee cece ee eeeeeeeeeeeeeeeeeeeeeeee 9 LPG1 0G R ies scannen iaae aniraa enaena ekar EEA Ena tense 9 startup LPG17XX Sinirin inian 10 Legal information sssssessssnssnunennnnrnnnnnrnnnnernnnnena 11 DOTIMITIONS seeen aeai 11 DiSCIAIMETS 0 ccccceceeeeceeceeeeeeeeeeeeeeeeeeteeeesaees 11 Trademarks cccccccceceeeceeeececeeceeeeeeeenenaeeeeees 11 Contents iis ee hee 12 Please be aware that important notices concerning this document and the product s described herein have been included
3. in the section Legal information NXP B V 2010 All rights reserved For more information please visit http www nxp com For sales office addresses please send an please send an email to salesaddresses nxp com Date of release 25 February 2010 Document identifier AN10908_1
4. the accuracy or completeness of such information and shall have no liability for the consequences of use of such information In no event shall NXP Semiconductors be liable for any indirect incidental punitive special or consequential damages including without limitation lost profits lost savings business interruption costs related to the removal or replacement of any products or rework charges whether or not such damages are based on tort including negligence warranty breach of contract or any other legal theory Notwithstanding any damages that customer might incur for any reason whatsoever NXP Semiconductors aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms and conditions of commercial sale of NXP Semiconductors Right to make changes NXP Semiconductors reserves the right to make changes to information published in this document including without limitation specifications and product descriptions at any time and without notice This document supersedes and replaces all information supplied prior to the publication hereof Suitability for use NXP Semiconductors products are not designed authorized or warranted to be suitable for use in medical military aircraft AN10908_1 All information provided in this document is subject to legal disclaimers space or life support equipment nor in applications where failure or malfunct
5. we need to clear the CAN controller s wakeup flags In this case we should see P1 29 toggled 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 029 void CaNactivity IRQHandler void Fig 5 CAN activity service routine canactflag 1 Restore CAN channel clocks LPC_SC gt CANSLEEPCLR 1 lt lt 1 1 lt lt 2 Wakeup CAN controllers LPC CAaN1 gt MOD LPC CANZ gt MOD amp 1 lt lt 4 f Clear CANi amp CAN2 WAKE FLAG LPC_SC gt CANWAKEFLAGS 1 lt lt 1 1 lt lt 2 Toggle LED to indicated that the CANActivity Handler was executed LPC_GPIO1 gt FIOPIN A 1 lt lt 29 return AN10908_1 It is also important to note that after the LPC1700 is woken up from Deep sleep or Power down mode it needs to have its PLL and clock dividers re initialized Moreover the CAN controller also needs to be reinitialized so that the current activity on the CAN bus can be serviced However due to the nature of the CAN protocol if the CAN node transmits a CAN packet onto the bus it will continuously transmit the same packet until another node sends an acknowledge bit This may inadvertently cause an issue when there is another CAN node on the CAN network By protocol design any CAN node on the network can send this acknowledgment bit When the LPC 1700 is put into Deep Sleep or Power down mode it will require some amount of time to wake u
6. woken up from the reduced power mode it will perform the re initialization and service the CAN Activity 4 Conclusion AN10908_1 Assuming that the CAN Activity interrupt service routine is enabled it can only be executed if the LPC1700 is in either Deep Sleep or Power down mode To prevent this service routine to execute indefinitely the CAN controllers wakeup flags need to be cleared After the device has been restored from Deep Sleep or Power down mode it needs to be re initialized This includes the PLL clock dividers and CAN controllers Until the CAN controller has been re initialized the LPC1700 may miss several CAN packet transmissions therefore special care should be taken when including other CAN nodes onto the network All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 8 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup 5 Known issues Depending on the version of uVision that is being used you may have to make some file modifications If you are planning to use the LPC17xx h Or startup_LPC17xx s supplied with the uVision development tools please take a moment to verify or make the necessary changes shown below The portions of code within the red boxes are the updated definitions The LPC17xx h and startups_LPC17xx s supplied with the sample software are already updated and therefore d
7. 908 CAN activity wakeup 5 2 startup_LPC17xx s Add all of the following statements into the startup file if not present already 105 106 107 108 Fig 9 Interrupt vector table handler definitions 207 EXPORT PLL1 IRQHandler WEAK 208 EXPORT USBActivity IRQHandler WEAK 209 EXPORT CaNactivity_ IRQHandler WEAK 210 Fig 10 Interrupt vector table EXPORT definitions 242 QEI_ IRQHandler 43 PLL1 IROQHandler 244 USBactivity_IRQHandler 245 CAaNActivity IRQHandler 246 Fig 11 Interrupt vector table handlers AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 10 of 12 NXP Semiconductors AN10908 6 Legal information CAN activity wakeup 6 1 Definitions Draft The document is a draft version only The content is still under internal review and subject to formal approval which may result in modifications or additions NXP Semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information 6 2 Disclaimers Limited warranty and liability Information in this document is believed to be accurate and reliable However NXP Semiconductors does not give any representations or warranties expressed or implied as to
8. AN10908 Wakeup from Deep Sleep using the CANActivity interrupt Rev 01 25 February 2010 Application note Document information Info Content Keywords LPC1700 CAN Controller CAN Activity WIC NVIC Deep Sleep Power down Abstract This application note is meant to be accompanied with the CAN Activity wakeup sample project It briefly discusses on how to utilize the CAN Activity interrupt to wake up the LPC1700 and service CAN bus activity NXP Semiconductors AN1 0908 CAN activity wakeup Revision history Rev Date Description 01 20100225 Initial version Contact information For additional information please visit http www nxp com For sales office addresses please send an email to salesaddresses nxp com AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 2 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup 1 Introduction The LPC1700 contains up to two high performance CAN controllers These CAN controllers are designed to provide a full implementation of the CAN protocol according to the CAN specification version 2 0B CAN networks are commonly used in automotive industrial and high speed network applications and can be utilized using low cost twisted pair media By design the CAN protocol is a multi master network architecture This allows any particular CAN nod
9. d CAN hardware and software products can generate the require CAN packets it is also possible to use another microcontroller For additional debugging information a RS 232 serial cable can be connected to UARTO COMO 2 2 Software Keil uVision version 4 01 was used to create this sample project There is an issue with the header and startup files included in this version This sample software uses its own version of corrected files For more details see the Known issues section For programming purposes you can use a ULINK ME JTAG module or a free optional ISP programming software such as Flash Magic http www nxp com redirect flashmagictool com Tera Term Pro can be used to observe the debug information coming from UARTO 3 Implementation This sample application will demonstrate the wakeup functionality of the LPC1700 s CAN Activity interrupt As a comparison we will put the device into Sleep Deep Sleep and Power down modes to observe the behavior of the CAN Activity interrupt The behavior of the LPC1700 can be observed using the MCB1700 s provided LEDs and serial connection UARTO 3 1 Button input Aside from the RESET button only the INTO button is used Pressing INTO will put the LPC1700 into one of the three applicable reduced power modes The reduced power mode is specified by the PoWERMODE definition uug 009 define SLEEP 1 010 define DEEPSLEEP 2 011 define POWERDOUN 3 012 013 Specify
10. e to send a message to any one or more other CAN nodes on that particular bus The full details on how CAN networks function is not discussed in this application note It is recommended to become familiarized with these networks before continuing this document Another application note from Keil can be found at http www standardics nxp com support documents microcontrollers pdf lpc17xx can arm pdf It briefly describes on how to create a CAN network using the LPC1700 1 1 CAN activity A CAN network is designed on a shared bus network meaning that all CAN controllers or nodes on a particular bus will send and receive packets on the same physical medium When no device is currently transmitting then the bus is known to be in an Idle state Any transition from an Idle state to a non Idle state is referred to as activity throughout this application note Activity on the bus can be generated from one or more nodes at once It is important to note that according to CAN specifications if two or more nodes are transmitting at the same time the node with a highest priority will gain control of the bus 1 2 Reduced power modes One of the features of the LPC1700 is that it can be put into four different reduced power modes Sleep Deep Sleep Power down and Deep Power down In regards to this application note we will be primarily focusing on the Deep Sleep and Power down modes The CANActivity interrupt will only functio
11. ing enable The debug information displays the most recent action performed on the LPC1700 If a CAN packet was received it will output the contents of the packet received Tera Term Web 3 1 COM1 VT File Edit Setup Web Control Window Help Initialized CAN Packet Rx d Frame 0x80080400 ID 0x00012345 DataA O0x3C3C3C3C DataB OxC3C3C3C3 Going to POWER DOWN Wake up Complete CAN Packet Rx d Frame 0x80080400 ID 0200012345 DataAd Ox3C3C3C3C DataB OxC3C3C3C3 Fig 4 Sample debug information on COMO UARTO AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 6 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup 3 4 Sleep mode By default if the wri instruction is issued to the device it will go into Sleep mode If there is any activity on the CAN bus while the LPC 1700 is in sleep mode then the CAN_IRQHandler interrupt will cause the device to wake up From that point it will then automatically process the current packet on the bus In other words the CAN Activity interrupt will not be executed while in Sleep mode therefore P1 29 will not toggle 3 5 Deep sleep and Power down mode Assuming its interrupt handler is enabled the CAN Activity interrupt will execute from either Deep Sleep or Power down mode To prevent an infinite loop from servicing this interrupt
12. ion of a NXP Semiconductors product can reasonably be expected to result in personal injury death or severe property or environmental damage NXP Semiconductors accepts no liability for inclusion and or use of NXP Semiconductors products in such equipment or applications and therefore such inclusion and or use is at the customer s own risk Applications Applications that are described herein for any of these products are for illustrative purposes only NXP Semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification NXP Semiconductors does not accept any liability related to any default damage costs or problem which is based on a weakness or default in the customer application use or the application use of customer s third party customer s hereinafter both referred to as Application It is customer s sole responsibility to check whether the NXP Semiconductors product is suitable and fit for the Application planned Customer has to do all necessary testing for the Application in order to avoid a default of the Application and the product NXP Semiconductors does not accept any liability in this respect Export control This document as well as the item s described herein may be subject to export control regulations Export might require a prior authorization from national authorities 6 3 Trademarks Notice All referenced brands
13. n when the device is either in Deep Sleep or Power down mode In sleep mode any enabled interrupt will wakeup the LPC1700 however in this mode the CAN_IRQHandler will process the incoming CAN packet In Deep Power down mode the LPC1700 will only wake up when an external reset or RTC interrupt is generated therefore this reduced power mode is not applicable to this application note Full details on what the reduced power modes do to the LPC1700 can be found in its user manual For our purposes we will briefly summarize the information that applies to this application note AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 3 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup Table 1 Reduced power modes This table is intended just as a quick summary applicable to this application note Full details on the LPC1700 s reduced power modes are found in its user manual Power Mode Short summary Sleep A reset or any enabled interrupt will wake up the device The clock to the ARM core is whereas the clock to the peripherals continues to run This power mode does not require any re initialization of the PLL after being waked up Deep Sleep The IRC remains running while the main oscillator is powered down Flash is put into standby mode Reset NMI EINTO 3 GPIO Interrupts Ethernet WOL Brownout Detect
14. o not need any changes 5 1 LPC17xx h Add the interrupt vector number definitions in the IRQn_Type structure wrw aawa wae aarmen z OAN fee A AYS fees dekh d d A Ge F 077 QEI_IROn 3f lt Quadrature Encoder Interface Interrupt a 078 LEOn I lt PLL1 Lock USB PLL Interrupt wd 079 USBActivity_IRQn 33 USB Activity interrupt s 080 CaNactivity IRQn 33 CAN Activity interrupt 081 Wn Type Fig 7 Additional interrupt vectors for the LPC17xx h The LPC_SC_TypeDef structure may have a larger RESERVED4 placeholder This placeholder should be modified with the contents shown in Fig 8 126 IO uint32 t CLKSRCSEL 127 uint32 t CANSLEEPCLR 128 uint32 t CANWAKEFLAGS 129 uint32 t RESERVED4 10 130 _ IO wint3s2 t EXTINT 131 uint32_t RESERVEDS 132 __ IO uint32_t EXTMODE 133 IO uint32_t EXTPOLAR 134 uint32_t RESERVED6 12 135 __I0 uint32_ t RSID 136 uint32 t RESERVED 7 137 __I0 uint32_ t SCS 138 10 uint32_t IRCTRIM 139 __ IO uint32 t PCLKSELO 140 __ 10 uint32 t PCLKSEL1 141 uint32_t RESERVEDS 4 142 __ 10 uint32_ t USBIntst 143 _ 10 uint32 t DMAREQSEL 144 __ 10 wint32 t CLEKOUTCFG 145 LPC_SC_TypeDef 146 Fig 8 Additional register definitions AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 9 of 12 NXP Semiconductors AN1 0
15. p again and re initialize the PLL clock dividers and CAN controller If any other CAN node sends the Acknowledgement bit bus during the wakeup period then the LPC1700 s CAN controller will not read in the initial packet that All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 7 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup generated the activity on the bus in the first place This wakeup delay will most likely cause several CAN packets to be lost before a re initialized CAN controller can read the current or perhaps the new CAN packet on the bus One solution to avoid this situation would be to put the other CAN nodes into a listen only mode 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 Waken up from deep sleep if canactflag Fig 6 Re initializing the LPC1700 after the CAN Activity ISR canactflag 0 Re intialized the PLL and CAN interface SystemInit if UART_ENABLE UARTInit O 57600 endif CAN Init BITRATE125K18MHZ if UART_ENABLE UaRTSend o r nWake up Complete r n sizeof r nUake up Complete r n endif Fortunately this scenario will not take place when only two devices are on the CAN bus The transmitting CAN node will continuously transmit the same packet until the receiver acknowledges it Once the LPC1700 has been
16. the reduced power mode 014 Select from SLEEP DEEPSLEEP or POWERDOWN 015 Note that only DEEPSLEEP and POWERDOWN will cause the O16 CANActivity interupt to be generated O17 define POWERMODE POWERDOWN mn Fig 2 Selecting the reduced power mode when pressing INTO Note that pressing INTO will also turn off all three LED indicators AN10908_1 All information provided in this document is subject to legal disclaimers NXP B V 2010 All rights reserved Application note Rev 01 25 February 2010 5 of 12 NXP Semiconductors AN1 0908 CAN activity wakeup 3 2 LED output The MCB1700 features several onboard LEDs Only three of them are used in this sample project These LEDs will give us an insight on how the CANActivity interrupt works Table 2 LED indicator summary This table will summarize the functions of each LED on the MCB1700 LED Indicator Descriptive function P2 6 P2 6 is toggled by the CPU while it is not in a reduced power mode P1 28 Receiving a CAN packet on CAN1 will cause P1 28 to be toggled P1 29 P1 29 is set only when the CAN Activity interrupt is executed 3 3 UART output Optionally debug information can be outputted onto UARTO COMO To enable UARTO output simply specify UART_ENABLE to 1 003 Debug information on UVARTO 004 UART enabled i 005 VART disabled o 006 Baud Rate 57600 8 N 1 007 define UART ENABLE 1 Fig 3 UART debugg
Download Pdf Manuals
Related Search
Related Contents
Laser guide star simulations for 8-m class telescopes ( A Government of India Enterprise ) PO Udayan CT Nr.: 10/2014 - Filtros com tampa OX69D e OX168D Os motores SAMEDI 16 MARS 2013 à 14 h 30 Guide d`utilisation 2674 MANUALE DI ISTRUZIONI 2 - DEA Polska ZE-MC296 データシート Philips P-8265-A User's Manual Copyright © All rights reserved.
Failed to retrieve file