完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,所有,我有一个自定义板,我在运行最新的遗留应用程序(MLA 2013-0615)。在这方面,我已经制造了引脚D3、D4、D5和D6短(外部连接)。当我尝试设置上述引脚高,它打开约100-1ms(连续变化),作为脉冲。有没有内置的函数使这个引脚低?代码:TrISDITS.TrISD5=0;TrISDBIT。TrISD4=0;TrISDIT3=1;LabdBo.LaDd4=1;LADDITS.LATD5=1;LADDITS.LATD6=1;我的HWP文件在下面://DeFCFG3,PracMa配置,FSRSSEL=PrimyTyIs7//SRS选择(SRS优先级7)α-PrAPMA配置FMIIN=OU//ETH。我的Ernet RMII/MII使能(RMII启用)γ-PracMA配置FETHOI= ON//Ethernet I/O PIN选择(默认以太网I/O)α-PracMA配置FuBidio= ON//USB USED选择(由USB模块控制)图FIPLIDEV=DIVIO2/2(PLL Input Divider)(2x除法器)μPrima配置FFLLMUL = Mulr20//PLL乘法器(20X乘法器)α-PrimaMaul-Fig配置,LoopLi=DIVI2//USB PLL输入分频器(2X分频器)时钟分频器(PLL除以1)//DVCFG1α-PrAPMA配置FFONC=PROPLL//振荡器选择位(主OSC W/PLL(XT+,HS+,EC+PLL))α-PracMA配置FSOSCEN=OF//次级振荡器使能(禁用)D=hs//主振荡器配置(XT OSC模式)α-PracMA配置OSCIOFNC=ON//CLKO输出信号在OSCO PIN(禁用)上,PARMA DFIDE1/ /外围时钟除数(PBH-CK是SysYLCK/1)* PracMA配置FCKSM=CSDCMD/ /时钟切换和监视器选择(时钟)开关禁用,FSCM禁用)timer Postscaler,Pt31768//看门狗(1∶1048 57)),PracMA配置FFDTEN=关闭/ /看门狗定时器启用(WDT禁用(SWDTEN位控制))//DVCFG0*PracMA配置调试=关闭/背景调试器启用(调试器禁用)CISEL=ICSYPGX1//ICE/ICD COMM信道选择(ICEUC2/EUD2引脚与PGC2/PGD2共享)* PracMA配置PWP=OF//程序闪存写保护(禁用)α-PrAPMA配置BWP=OF//启动闪存写保护位(保护禁用)//ICE/ICD COMM信道选择:γPrimaIsELSL=ICSU-PGX1//在PGEC1/PGED1//看门狗定时器启用上进行通信:USB模块//USB VBUS的选择:α-PrimaFvBuxONIO=/ /由USB模块控制/时钟/频率/ /这些直接影响定时事件使用嘀嗒模块。它们也被用于UART和SPI波特率的生成。{定义GETStaseCycLoT()(8000 000 0UL)/Hyz定义SysFRYQ(8000 000 0UL),定义PICTeOrthCopyCube()(GETSealCyCub())1(/GETSealCycLoCH)(4)/PICT24/DSPIC的GETStaseCyCub()/ 2,PIC32的GETSealCyCub()/ 1。如果使用do瞌睡模式,可能需要改变。{为PIC32定义GePosialErrCordCube()(GETSealCyCub())1 / /正常GeStCycLoCK()/ 4,PIC24/DSPIC,GETSealCyCub()/ 1,PIC32系统。除数可能是不同的,如果使用PIC32,因为它是可配置的。/硬件I/O引脚映射/ /发光二极管定义了Le00TrI(Tra***But.TrISB0)//REF LD1*定义LeD0SyIO(LabbTo.LATB0),定义Le11TrIS(TrISBITS.TrISB1)//REF LD2*定义LeD1SyIO(LabbTo.LATB1),定义Le22TrIS(LeD1TrI)//NO。定义Le2bIO(LATBIT.LATB2),定义Le31TrI(/LeD1TrIs)//NO,定义Le33IO(LaBbTo.LATB2),定义Le44TrI(LeD1TrIs)//没有这样的LED定义Le44IO(LabbTo.LATB2),定义Le55TrI(LeD1TrIs)//没有这样的LED定义Le55IO(LabbTo.LATB2),定义Le66TrIS(LeD1TrIs)//NO。发光二极管LED定义了De66IO(LabbTo.LATB2)定义了Le77TrI(LeD1TrIs)//没有这样的LED定义了Le77IO(LabbStudio.LATB2),定义了LeDyGET()((无符号CHAR)LATB&0x03)定义LeDyPUT(A)DO {Labb=(LATB&0xFFFC)〉((a)和0x03);}(0)/瞬时按钮Y*定义了ButoNo0TrIS(TrISBBIT)。这样2. //REF SW2*定义了ButoNo0IO(1)//(PurbButs.RB2),定义了ButoNo1TrIS(TrsibBut.TrISB3)//REF SW3,定义了ButoNo1IO(1)//(PurbButs.RB3),定义了这个板上的Buto22TrIS(TrsibBut.TrISB3)//NO Butn2,定义了Butn2IIO(1),定义了Buto33TrIS(TrISBBIT.TrISB3)//No.Butn3。三轮车定义Buto3SyIO(1)//UART配置/ /y定义UARTXXTI(TrISDITS.TrISD3)//*定义UARTXXTILIS(TrISDITS.TrISD2)//*定义UBRG U1BRG//Y定义UMODE U1MOD//Y定义USTA U1STA//Y定义BuyAuto()BuyAtAR1()//定义CeleUnAtter())CuLuEuTAR1()//y定义CONTICONTART(A)CONTICONTARTAR1(A)董事会(/a,b,c)定义RuuuART1(a,b,c)//*定义DeuluTART()//*定义DeuluTART(a)Read EuthAR1(a)//y定义GETSUART(A,B,C)GETSUTAR1(A,B,C)//α定义PuxART(a)PutSuT1((char *)a)//y*定义GeCuTART()GutCuTAR1()//*定义PuCuART(a)DO {(总线)//y*定义DATAUDAART()DATARADYARTAR1()当(0)//y定义PUTRAUTART(A)PUTRUTART1(A)/ /外部SMSC LAN820PHY配置时,定义RiMi模式下的PyrasRMII//外部PHY运行,定义了用于LAN820定义的PHYAXOFICALIDENTION//DEFION配置,使用y*定义PHYAL地址0x0// 0。很抱歉问这么简单的问题。我已经陷入这个问题一段时间了。
以上来自于百度翻译 以下为原文 Hi all, I have a custom board in which I am running the latest legacy application (MLA 2013-06-15). In that I have made pins D3, D4, D5 and D6 short ( external connections). When I try to set the above pins high, it turns ON for about 100us to 1ms ( varying continuously), as pulses. Is there any inbuilt functions that make this pin low ? My code : TRISDbits.TRISD6=0; TRISDbits.TRISD5=0; TRISDbits.TRISD4=0; TRISDbits.TRISD3=0; LATDbits.LATD3 = 1; LATDbits.LATD4 = 1; LATDbits.LATD5 = 1; LATDbits.LATD6 = 1; My HWP file is below: // DEVCFG3 #pragma config FSRSSEL = PRIORITY_7 // SRS Select (SRS Priority 7) #pragma config FMIIEN = OFF // Ethernet RMII/MII Enable (RMII Enabled) #pragma config FETHIO = ON // Ethernet I/O Pin Select (Default Ethernet I/O) #pragma config FUSBIDIO = ON // USB USID Selection (Controlled by the USB Module) #pragma config FVBUSONIO = ON // USB VBUS ON Selection (Controlled by USB Module) // DEVCFG2 #pragma config FPLLIDIV = DIV_2 // PLL Input Divider (2x Divider) #pragma config FPLLMUL = MUL_20 // PLL Multiplier (20x Multiplier) #pragma config UPLLIDIV = DIV_2 // USB PLL Input Divider (2x Divider) #pragma config UPLLEN = ON // USB PLL Enable (Enabled) #pragma config FPLLODIV = DIV_1 // System PLL Output Clock Divider (PLL Divide by 1) // DEVCFG1 #pragma config FNOSC = PRIPLL // Oscillator Selection Bits (Primary Osc w/PLL (XT+,HS+,EC+PLL)) #pragma config FSOSCEN = OFF // Secondary Oscillator Enable (Disabled) #pragma config IESO = ON // Internal/External Switch Over (Enabled) #pragma config POSCMOD =HS // Primary Oscillator Configuration (XT osc mode) #pragma config OSCIOFNC = ON // CLKO Output Signal Active on the OSCO Pin (Disabled) #pragma config FPBDIV = DIV_1 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/1) #pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled) #pragma config WDTPS = PS32768 // Watchdog Timer Postscaler (1:1048576) #pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls)) // DEVCFG0 #pragma config DEBUG = OFF // Background Debugger Enable (Debugger is disabled) #pragma config ICESEL = ICS_PGx1 // ICE/ICD Comm Channel Select (ICE EMUC2/EMUD2 pins shared with PGC2/PGD2) #pragma config PWP = OFF // Program Flash Write Protect (Disable) #pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled) #pragma config CP = OFF // Code Protect (Protection Disabled) //ICE/ICD Comm Channel Select: #pragma ICESEL = ICS_PGx1 //Communicate on PGEC1/PGED1 //Watchdog Timer Enable: #pragma FWDTEN = OFF //WDT Disabled (SWDTEN Bit Controls) //Background Debugger Enable: #pragma DEBUG = ON //Debugger is Enabled //USB USID Selection: #pragma FUSBIDIO = ON //Controlled by the USB Module //USB VBUS ON Selection: #pragma FVBUSONIO = ON //Controlled by USB Module #endif // Clock frequency values // These directly influence timed events using the Tick module. They also are used for UART and SPI baud rate generation. #define GetSystemClock() (80000000ul) // Hz #define SYS_FREQ (80000000ul) #define GetInstructionClock() (GetSystemClock()/1) // Normally GetSystemClock()/4 for PIC18, GetSystemClock()/2 for PIC24/dsPIC, and GetSystemClock()/1 for PIC32. Might need changing if using Doze modes. #define GetPeripheralClock() (GetSystemClock()/1) // Normally GetSystemClock()/4 for PIC18, GetSystemClock()/2 for PIC24/dsPIC, and GetSystemClock()/1 for PIC32. Divisor may be different if using a PIC32 since it's configurable. // Hardware I/O pin mappings // LEDs #define LED0_TRIS (TRISBbits.TRISB0) // Ref LD1 #define LED0_IO (LATBbits.LATB0) #define LED1_TRIS (TRISBbits.TRISB1) // Ref LD2 #define LED1_IO (LATBbits.LATB1) #define LED2_TRIS (LED1_TRIS) // No such LED #define LED2_IO (LATBbits.LATB2) #define LED3_TRIS (LED1_TRIS) // No such LED #define LED3_IO (LATBbits.LATB2) #define LED4_TRIS (LED1_TRIS) // No such LED #define LED4_IO (LATBbits.LATB2) #define LED5_TRIS (LED1_TRIS) // No such LED #define LED5_IO (LATBbits.LATB2) #define LED6_TRIS (LED1_TRIS) // No such LED #define LED6_IO (LATBbits.LATB2) #define LED7_TRIS (LED1_TRIS) // No such LED #define LED7_IO (LATBbits.LATB2) #define LED_GET() ((unsigned char)LATB & 0x03) #define LED_PUT(a) do{LATB = (LATB & 0xFFFC) | ((a)&0x03);}while(0) // Momentary push buttons #define BUTTON0_TRIS (TRISBbits.TRISB2) // Ref SW2 #define BUTTON0_IO (1) //(PORTBbits.RB2) #define BUTTON1_TRIS (TRISBbits.TRISB3) // Ref SW3 #define BUTTON1_IO (1) //(PORTBbits.RB3) #define BUTTON2_TRIS (TRISBbits.TRISB3) // No BUTTON2 on this board #define BUTTON2_IO (1) #define BUTTON3_TRIS (TRISBbits.TRISB3) // No BUTTON3 on this board #define BUTTON3_IO (1) // UART configuration //#define UARTTX_TRIS (TRISDbits.TRISD3) //#define UARTRX_TRIS (TRISDbits.TRISD2) //#define UBRG U1BRG //#define UMODE U1MODE //#define USTA U1STA //#define BusyUART() BusyUART1() //#define CloseUART() CloseUART1() //#define ConfigIntUART(a) ConfigIntUART1(a) //#define DataRdyUART() DataRdyUART1() //#define OpenUART(a,b,c) OpenUART1(a,b,c) //#define ReadUART() ReadUART1() //#define WriteUART(a) WriteUART1(a) //#define getsUART(a,b,c) getsUART1(a,b,c) //#define putsUART(a) putsUART1((char *)a) //#define getcUART() getcUART1() //#define putcUART(a) do{while(BusyUART()); WriteUART(a); while(BusyUART()); }while(0) //#define putrsUART(a) putrsUART1(a) // External SMSC LAN8720 PHY configuration #define PHY_RMII // external PHY runs in RMII mode #define PHY_CONFIG_DEFAULT // default configuration used #define PHY_ADDRESS 0x0 // 0 for LAN8720? Sorry for asking such a simple question. I have been stuck with this problem for a while now. |
|
相关推荐
7个回答
|
|
什么是“最新遗留应用程序”?你说“短”是什么意思?你用什么代码把它们设置得很高?你没有在你的帖子里展示它。
以上来自于百度翻译 以下为原文 What is this "latest legacy application" ? What do you mean you "have them short" ? Where is the code you use to set them high? You did not show it in your post. |
|
|
|
嗨,QHB,我已经更新了这个问题。我很抱歉早些时候没有包括这些细节。
以上来自于百度翻译 以下为原文 Hi qhb, I have updated the question. My apologies for not including these details earlier. |
|
|
|
是因为CN功能吗?此外,我的主体()具有如下初始化:静态dWord DWASTIP=0;双WDTR计数器;无符号int Var;Val=(未签名int)(*((无符号INT*)0xBFC02FF8));SYSTEMConfig(SysfFrq,SysfCFGWAITIGY状态ySysCFGLPCACHE);//StultCopyFieldSype(SysCLK);DDPCONbits.JTAGENTrISe1=1;/TrISe1=1;/TrISe0=1;TrISbBIT。TrISB3=1;TrISBBIT。TrISB5=1;TrISBBIT。TrISB8=1;TrISBBIT。TrISB9=1;TrISBBIT。TrISB10=1;TrISDBIT。TrISD11=1;三比特。= 0TrISG79=0;TISISG8=0;TISISG7=0;TISISC13=0;TISCcBIT。TrISC14=0;TrISBBIT。TrISB12=0;三重位元。TrISe5=0;TrISDBIT。TrISD0=γ;TrISBBIT。TrISe3=1;三重位元。TrISe2=1;三重位三。= 0;TrISDBIT。TrISD5=0;TrISDBIT。TrISD4=0;TrISD3=0;OCDCdO.OCDC5=1;ODCDOS.OCDC4=1;ODCD3=1;/TrISBBIT。SDISD2=0;TrISDBIT.TrISD1RC13=0;IF(ReaDaveDWDT()){//WDT事件确实发生DababeWdTh();CeleReaveWdTh();}//WDT超时周期在设备配置Enable WDT()中设置;//启用WDT CurrWdTh();/ /服务WDT
以上来自于百度翻译 以下为原文 Is it because of CN functionality ? Also my main() has initializations as follows : static DWORD t = 0; static DWORD dwLastIP = 0; double wdtcounter; unsigned int val; val = (unsigned int)(*((unsigned int*)0xBFC02FF8)); SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE); //SYSTEMConfigPerformance(SYSCLK); DDPCONbits.JTAGEN = 0; AD1PCFG = 0x1000; // set PORTB pin0 as digital TRISDbits.TRISD8 =1; // set RB0 to be an output TRISEbits.TRISE1=1; // set RB1 to be an input TRISEbits.TRISE0=1; TRISBbits.TRISB3=1; TRISBbits.TRISB5=1; TRISBbits.TRISB8=1; TRISBbits.TRISB9=1; TRISBbits.TRISB10=1; TRISDbits.TRISD11=1; TRISEbits.TRISE3=1; TRISEbits.TRISE2=1; TRISEbits.TRISE4=1; TRISBbits.TRISB1=1; TRISEbits.TRISE6=0; TRISEbits.TRISE7=0; TRISGbits.TRISG9=0; TRISGbits.TRISG8=0; TRISGbits.TRISG7=0; TRISCbits.TRISC13=0; TRISCbits.TRISC14=0; TRISBbits.TRISB12=0; TRISEbits.TRISE5=0; TRISDbits.TRISD0=0; TRISBbits.TRISB0=0; TRISDbits.TRISD2=0; TRISDbits.TRISD1=0; TRISBbits.TRISB15=0; TRISDbits.TRISD6=0; TRISDbits.TRISD5=0; TRISDbits.TRISD4=0; TRISDbits.TRISD3=0; ODCDbits.ODCD6=1; ODCDbits.ODCD5=1; ODCDbits.ODCD4=1; ODCDbits.ODCD3=1; //TRISBbits.TRISB14=0; PORTDbits.RD0=0; PORTDbits.RD2=0; PORTCbits.RC14=0; PORTCbits.RC13=0; if ( ReadEventWDT() ) { // A WDT event did occur DisableWDT(); ClearEventWDT(); } // WDT timeout period is set in the Device Configuration EnableWDT(); // enable the WDT ClearWDT(); // service the WDT |
|
|
|
清除所有看门狗计时器,看看你是否还有问题。
以上来自于百度翻译 以下为原文 Get rid of all the Watchdog timer stuff and see if you still have a problem. |
|
|
|
我已经尝试了不同的引脚组合,发现当我定义和使用PIN D3时它不起作用。例如:TrddBist.TrISD4=0;OdCDBo.OdCD4=1;LabdBist.LaDd4=1;//用于这个……当我给TrISdBist.TrISD3=0时不工作;请注意,我已经注释了定义UARTXXI的定义。三(TrISdBIT,TrISD3)
以上来自于百度翻译 以下为原文 I have tried with different combinations of pins and have found that it doesnt work when I define and use pin D3. Eg: TRISDbits.TRISD4 = 0; ODCDbits.ODCD4 = 1; LATDbits.LATD4 = 1; // works for this... Doesnt work when I give TRISDbits.TRISD3 = 0; Do note that I have commented out #define UARTTX_TRIS (TRISDbits.TRISD3) |
|
|
|
这不太可能。你还没有提到你正在使用哪一张照片。
以上来自于百度翻译 以下为原文 That's unlikely to do much. You've not yet mentioned WHICH PIC you are using. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5242 浏览 9 评论
2031 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3207 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2256 浏览 5 评论
778浏览 1评论
669浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
596浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
678浏览 0评论
577浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 15:50 , Processed in 1.348908 second(s), Total 91, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号