tag 标签: lpc1768

相关博文
  • 热度 19
    2012-8-12 22:50
    4221 次阅读|
    1 个评论
    随便google了下,发现貌似没什么人关心这个问题,不过没关系,就让以后的初学者看到后不用再迷茫了。 其实两者是有很大不同的,前者只能通过软件不停查询LPC_GPIOINT-IO2IntStatR或LPC_GPIOINT-IO2IntStatF来获得端口边沿情况,而后者则一般由硬件自动进入中断处理函数。前者清除中断标志用LPC_GPIOINT-IO2IntClr,后者则用LPC_SC-EXTINT。 前者编程示例: void EINTInit( void ) {        LPC_GPIO2-FIODIR  =  ~(1 11);    /* PORT2.11 defined as input       */          LPC_GPIO2-FIODIR      = ~(1 11);          LPC_GPIOINT-IO2IntEnR |=  (1 11);      /* enable rising edge irq         */          LPC_GPIOINT-IO2IntEnF |=  (1 11);       /* enable falling edge irq         */} }   int main(void) {          While(1)          {            if(LPC_GPIOINT-IO2IntStatF!=0x0)                        LED_On (0xff);                                                //点亮LED               if(LPC_GPIOINT-IO2IntStatR)                      LED_Off (0xff);                                               //熄灭LED            LPC_GPIOINT-IO2IntClr |= (1 11);     /* clear pending interrupt         */   }   }   后者编程示例: void EINTInit( void ) {        LPC_GPIO2-FIODIR  =  ~(1 10);    /* PORT2.10 defined as input       */ LPC_PINCON-PINSEL4 = 0x00100000;            // set P2.10 as EINT0 LPC_SC-EXTMODE = 0x01;                           /* INT0 edge trigger */ LPC_SC-EXTPOLAR = 0x01;                 /* INT0 is rising edge by default */   NVIC_EnableIRQ(EINT0_IRQn);                       //使能EINT0中断 } void EINT0_IRQHandler() {          LPC_SC-EXTINT = 0x01;         //EXIT0中断状态清零,在P2.10 }
  • 热度 18
    2012-8-4 17:27
    3226 次阅读|
    0 个评论
      调试LPC1768, NXP的库好像不如Luminary的好用(大家都这么说,也就跟着人云亦云了)。对照LPC1768的手册看了看Keil例程的PLL0配置过程,记录如下:                #if (CLOCK_SETUP)                       /* Clock Setup                        */   LPC_SC-SCS       = SCS_Val;          // 启用外部主时钟   if (SCS_Val (1 5)) {             /* If Main Oscillator is enabled      */     while ((LPC_SC-SCS (16)) == 0);/* Wait for Oscillator to be ready    */   } //PLL倍频出来的时钟送给CPU前的分频,CCLKCFG_Val=3,为4分频   LPC_SC-CCLKCFG   = CCLKCFG_Val;      /* Setup Clock Divider                */   LPC_SC-PCLKSEL0  = PCLKSEL0_Val;     /* Peripheral Clock Selection         */   LPC_SC-PCLKSEL1  = PCLKSEL1_Val;   LPC_SC-CLKSRCSEL = CLKSRCSEL_Val;    /* Select Clock Source for PLL0       */ #if (PLL0_SETUP) //PLL0CFG_Val = 0x00050063, 5为pre-div的值既N,所以除数为N+1=6 // 0x63为乘数M,M+1=100,记得要把16进制换算为10进制 //Fcco = 2*100*12/6 = 400,然后再除以CPU clock的4,即该设置主频为100M   LPC_SC-PLL0CFG   = PLL0CFG_Val;   LPC_SC-PLL0CON   = 0x01;             /* PLL0 Enable                        */ //确认序列   LPC_SC-PLL0FEED  = 0xAA;   LPC_SC-PLL0FEED  = 0x55;   while (!(LPC_SC-PLL0STAT (126)));/* Wait for PLOCK0                    */   LPC_SC-PLL0CON   = 0x03;             /* PLL0 Enable Connect              */   LPC_SC-PLL0FEED  = 0xAA;   LPC_SC-PLL0FEED  = 0x55; #endif #if (PLL1_SETUP)   LPC_SC-PLL1CFG   = PLL1CFG_Val;   LPC_SC-PLL1CON   = 0x01;             /* PLL1 Enable                        */   LPC_SC-PLL1FEED  = 0xAA;   LPC_SC-PLL1FEED  = 0x55;   while (!(LPC_SC-PLL1STAT (110)));/* Wait for PLOCK1                    */   LPC_SC-PLL1CON   = 0x03;             /* PLL1 Enable Connect              */   LPC_SC-PLL1FEED  = 0xAA;   LPC_SC-PLL1FEED  = 0x55; #else   LPC_SC-USBCLKCFG = USBCLKCFG_Val;    /* Setup USB Clock Divider            */ #endif   LPC_SC-PCONP     = PCONP_Val;        /* Power Control for Peripherals      */   LPC_SC-CLKOUTCFG = CLKOUTCFG_Val;    /* Clock Output Configuration         */ #endif   /* Determine clock frequency according to clock register values             */   if (((LPC_SC-PLL0STAT 24)3)==3) {/* If PLL0 enabled and connected      */     switch (LPC_SC-CLKSRCSEL 0x03) {       case 0:                           /* Internal RC oscillator = PLL0     */       case 3:                           /* Reserved, default to Internal RC   */         SystemFrequency = (IRC_OSC *                           ((2 * ((LPC_SC-PLL0STAT 0x7FFF) + 1)))  /                           (((LPC_SC-PLL0STAT 16) 0xFF) + 1)    /                           ((LPC_SC-CCLKCFG 0xFF)+ 1));         break;       case 1:                           /* Main oscillator = PLL0            */      //待Pll锁定和连接后PLL0STAT中有M和N,可以计算出实际频率         SystemFrequency = (OSC_CLK *                           ((2 * ((LPC_SC-PLL0STAT 0x7FFF) + 1)))  /                           (((LPC_SC-PLL0STAT 16) 0xFF) + 1)    /                           ((LPC_SC-CCLKCFG 0xFF)+ 1));         break;       case 2:                           /* RTC oscillator = PLL0             */         SystemFrequency = (RTC_CLK *                           ((2 * ((LPC_SC-PLL0STAT 0x7FFF) + 1)))  /                           (((LPC_SC-PLL0STAT 16) 0xFF) + 1)    /                           ((LPC_SC-CCLKCFG 0xFF)+ 1));         break;     }   } else {     switch (LPC_SC-CLKSRCSEL 0x03) {       case 0:                           /* Internal RC oscillator = PLL0     */       case 3:                           /* Reserved, default to Internal RC   */         SystemFrequency = IRC_OSC / ((LPC_SC-CCLKCFG 0xFF)+ 1);         break;       case 1:                           /* Main oscillator = PLL0            */         SystemFrequency = OSC_CLK / ((LPC_SC-CCLKCFG 0xFF)+ 1);         break;       case 2:                           /* RTC oscillator = PLL0             */         SystemFrequency = RTC_CLK / ((LPC_SC-CCLKCFG 0xFF)+ 1);         break;     }   }
相关资源
  • 所需E币: 3
    时间: 2022-3-3 16:57
    大小: 384.44KB
    上传者: ZHUANG
    基于LPC1768的微创脊椎手术辅助机器人控制器通信的研究
  • 所需E币: 3
    时间: 2019-12-25 03:01
    大小: 1.42MB
    上传者: 2iot
    开发板手册LPC1768开发板用户手册LPC1768开发板用户手册Page1/39LPC1768开发板用户手册Page2/39LPC1768开发板用户手册目录1.概述..........................................................................................................................................52.电路及接口说明.......................................................................................................................52.1.电源模块.......................................................................................................................52.2.USB通信模块............................................……
  • 所需E币: 4
    时间: 2019-12-25 03:01
    大小: 73.32KB
    上传者: 微风DS
    原理图123456……
  • 所需E币: 3
    时间: 2019-12-24 22:26
    大小: 432.25KB
    上传者: wsu_w_hotmail.com
    快速了解熟悉LPC1768微控制器mbedNXPLPC1768prototypingboardRapidprototypingfortheLPC1768MCUThisboard,whichworkswiththegroundbreakingmbedtoolsuite,letsyoucreateafunctioningprototypefasterthanever.Thetightlycoupledcombinationofhardwareandsoftwaremakesiteasytoexploredesignsquickly,soyoucanbemoreadventurous,moreinventive,andmoreproductive.FeaturesThembedNXPLPC1768boardletsyoucreateprototypes}Convenientform-factor:40-pinDIP,0.1-inchpitchwithouthavingtoworkwithlow-levelmicrocontrollerdetails,}Drag-and-dropprogramming,withtheboardrepresentedsoyoucane……
  • 所需E币: 5
    时间: 2019-12-24 21:55
    大小: 490.89KB
    上传者: quw431979_163.com
    本用户手册介绍了NXPPOS_RD评估板,参考设计论证和评估了POS机上的恩智浦的设备。UM10493POSReferenceDesign-FirmwaredescriptionRev.1.1―21March2012Usermanual211411COMPANYPUBLICDocumentinformationInfoContentKeywordsPN512,TDA8026,LPC1768,Pointofsalesterminal,ReferenceDesignAbstractThisusermanualpresentstheNXPPOS_RDevaluationboard.ThisreferencedesignisusedtodemonstrateandevaluatetheimplementationofNXP’sdevicesinaPointOfSalesterminal.ThisdocumentationdescribestheFirmwareembeddedintheLPC1768:Howtomodify,compile,andloadit.NXPSemiconductors……
  • 所需E币: 4
    时间: 2019-12-24 15:28
    大小: 6.14KB
    上传者: rdg1993
    这是一个测试LPC1768的源代码,希望大家有用来源:21ic中国电子网http://www.21ic.com/……
  • 所需E币: 3
    时间: 2019-6-14 23:13
    大小: 780.92KB
    上传者: royalark_912907664
    FYICE仿真器调试LPC1768