完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我用MLA类库在PICK24FJ256DA210中写笔数据,当我独自运行I2C代码时,它工作得很好,但是当我把它与MLA库合并时,我的控制器得到手或工作太慢。
以上来自于百度翻译 以下为原文 I am using MLA library for PIC24FJ256DA210 to write data in pen drive, when I run I2C code alone it's working fine but when I merge it with MLA library my controller get hand or work too slowly |
|
相关推荐
8个回答
|
|
我的USB代码今天我检查I2C数据每5分钟或10分钟后
以上来自于百度翻译 以下为原文 int main(void) { #if defined(__dsPIC33EP512MU810__)||defined(__PIC24EP512GU810__) // Configure the device PLL to obtain 60 MIPS operation. The crystal // frequency is 8MHz. Divide 8MHz by 2, multiply by 60 and divide by // 2. This results in Fosc of 120MHz. The CPU clock frequency is // Fcy = Fosc/2 = 60MHz. Wait for the Primary PLL to lock and then // configure the auxilliary PLL to provide 48MHz needed for USB // Operation. PLLFBD = 38; /* M = 60 */ CLKDIVbits.PLLPOST = 0; /* N1 = 2 */ CLKDIVbits.PLLPRE = 0; /* N2 = 2 */ OSCTUN = 0; /* Initiate Clock Switch to Primary * Oscillator with PLL (NOSC= 0x3)*/ __builtin_write_OSCCONH(0x03); __builtin_write_OSCCONL(0x01); while (OSCCONbits.COSC != 0x3); // Configuring the auxiliary PLL, since the primary // oscillator provides the source clock to the auxiliary // PLL, the auxiliary oscillator is disabled. Note that // the AUX PLL is enabled. The input 8MHz clock is divided // by 2, multiplied by 24 and then divided by 2. Wait till // the AUX PLL locks. ACLKCON3 = 0x24C1; ACLKDIV3 = 0x7; ACLKCON3bits.ENAPLL = 1; while(ACLKCON3bits.APLLCK != 1); /* Set RB5 as Digital port and enable the VBUS switch*/ ANSELBbits.ANSB5 = 0; TRISBbits.TRISB5 = 0; LATBbits.LATB5 = 1; #endif #if defined(__PIC32MX__) { int value; value = SYSTEMConfigWaitStatesAndPB( GetSystemClock() ); // Enable the cache for the best performance CheKseg0CacheOn(); INTEnableSystemMultiVectoredInt(); value = OSCCON; while (!(value & 0x00000020)) { value = OSCCON; // Wait for PLL lock to stabilize } } #endif #if defined(__PIC24FJ64GB004__) || defined(__PIC24FJ256DA210__) //On the PIC24FJ64GB004 Family of USB microcontrollers, the PLL will not power up and be enabled //by default, even if a PLL enabled oscillator configuration is selected (such as HS+PLL). //This allows the device to power up at a lower initial operating frequency, which can be //advantageous when powered from a source which is not gauranteed to be adequate for 32MHz //operation. On these devices, user firmware needs to manually set the CLKDIV //power up the PLL. { unsigned int pll_startup_counter = 600; CLKDIVbits.PLLEN = 1; while(pll_startup_counter--); } //Device switches over automatically to PLL output after PLL is locked and ready. #endif deviceAttached = FALSE; //Initialize the stack USBInitialize(0); #if defined(DEBUG_MODE) // PPS - Configure U2RX - put on pin 49 (RP10) RPINR19bits.U2RXR = 10; // PPS - Configure U2TX - put on pin 50 (RP17) RPOR8bits.RP17R = 5; UART2Init(); #endif while(1) { //USB stack process function USBTasks(); //if thumbdrive is plugged in if(USBHostMSDSCSIMediaDetect()) { deviceAttached = TRUE; //now a device is attached //See if the device is attached and in the right format if(FSInit()) { //Opening a file in mode "w" will create the file if it doesn't // exist. If the file does exist it will delete the old file // and create a new one that is blank. myFile = FSfopen("test.txt","w"); //Write some data to the new file. FSfwrite("This is a test.",1,15,myFile); //Always make sure to close the file so that the data gets // written to the drive. FSfclose(myFile); //Just sit here until the device is removed. while(deviceAttached == TRUE) { USBTasks(); } } } } return 0; } MY USB code Today I check I2C data comes after each 5 min or 10 min |
|
|
|
工作在48 MHz的100KHZUSB上的I2C
以上来自于百度翻译 以下为原文 I2C working on 100KHz USB working on 48 MHz |
|
|
|
哪种版本的MLA用于中断驱动USB。
以上来自于百度翻译 以下为原文 Which version of MLA do you use for interrupt driven USB. |
|
|
|
没有用于USB HID中断传输的MLA版本。它只适用于中断连接和分离。你使用的是哪个USB类。
以上来自于百度翻译 以下为原文 There is no version of MLA for USB HID interrupt transfer. It only available for interrupt attach and detach. which u*** class you are using. |
|
|
|
对不起,Savvv,我对USB类一无所知,你能告诉我如何检查它吗?我指的是这类08h的DoCHTPTP//www. UB.Org/Dealss/DealdEd类。
以上来自于百度翻译 以下为原文 Sorry swatvv, I do't have any idea about USB class, can you tell me how to check it. I am referring this doc http://www.u***.org/developers/defined_class According to this Class 08h |
|
|
|
这不是我们在这里讨论的。有两种方式,USB堆栈可以与主机程序交互:轮询和中断-这与您使用的类无关。苏珊
以上来自于百度翻译 以下为原文 That is not what we are talking about here. There are two ways that the USB stack can interact with the host program: polling and interrupt - this has nothing to do with the class you are using. Susan |
|
|
|
但是,你如何决定是用MLA 2017版本进行HID的中断或轮询。所以我只问班级和MLA版本,我知道这与这个帖子无关。他可以根据MLA.thanks和他一起使用的班级检查图书馆。
以上来自于百度翻译 以下为原文 yes.but how will you decide it is interrupt or polling for hid with MLA 2017 version. so that only i ask the class and mla version. i know this is not related with this post. he can check the library according to class what he using with MLA. thanks. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5234 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
670浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 15:42 , Processed in 1.645051 second(s), Total 91, Slave 75 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号