完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
有人能推荐一个好的课程来开始PIC微控制器的安装和编程吗?从眨眼到滚动机器人的东西?如果可能的话,我想用C来编程。
以上来自于百度翻译 以下为原文 Can anyone recommend a good course on getting started with the pic microcontroller setup and programming? something that goes from blinking led to rolling robot? If possible I would like to use C to program. |
|
相关推荐
5个回答
|
|
HTTP://www. GooLuMun.com A/PIC-教程,最初的是免费的,它不属于机器人。
以上来自于百度翻译 以下为原文 http://www.gooligum.com.au/PIC-tutorials The initial ones are free. It does not go up to robots. |
|
|
|
好的,谢谢你,我买了15捆好像买了好几本书前的价格。我会试着告诉他们我是如何将pic12f683中的振荡器频率设置为89mhz的,我试着输入0b00111000,但是在将延迟从1000ms改变为10000ms之后,似乎看不出我的led闪烁有什么不同。资源线配置语句//CON.#pragma config FOSC=INTOSCIO//振荡器选择位(INTOSCIO振荡器:RA4/OSC2/CLKOUT管脚上的I/O函数,RA5/OSC1/CLKIN上的I/O函数)#pragma config WDTE=ON//Watchdog Timer Enable位(启用WDT)#pragma config PWRTE=OFF//上电定时器启用位(PWRT禁用)#pragma配置MCLRE=OFF//MCLR引脚功能选择位(MCLR引脚功能是数字输入,MCLR内部绑定到VDD)#pragma配置CP=OFF//代码保护位(程序存储器代码保护被禁用)#pragma配置CPD=OFF//数据代码保护位(数据代码保护位)内存代码保护被禁用)#pragma配置BOREN=OFF//Brown Out检测(BOR禁用)#pragma配置IESO=ON//内部外部切换位(内部外部切换模式被启用)#pragma配置FCMEN=ON//Fail-Safe时钟监视启用位(故障安全时钟监视器被激活)在项目文件include.//Use project enums而不是define for ON和OFF.include
以上来自于百度翻译 以下为原文 Ok thank you I bought the bundle for 15.00 seemed like a good deal bought worse books before for several time the price. I will give them a try can you tell be how i set the oscillator frequency in the pic12f683 to 89mhz I tried putting 0b00111000 but can't seem to see a difference in my led blinking after changing delay from 1000 ms to 10000. here is complete code so far // PIC12F683 Configuration Bit Settings // 'C' source line config statements // CONFIG #pragma config FOSC = INTOSCIO // Oscillator Selection bits (INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN) #pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled) #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config MCLRE = OFF // MCLR Pin Function Select bit (MCLR pin function is digital input, MCLR internally tied to VDD) #pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled) #pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled) #pragma config BOREN = OFF // Brown Out Detect (BOR disabled) #pragma config IESO = ON // Internal External Switchover bit (Internal External Switchover mode is enabled) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is enabled) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include #define _XTAL_FREQ 8000000 void main() { TRISIO=0b00000000; GPIO=0; //set GPIO outputs low OSCCON = 0b00111000; while (1) { GP2=0; __delay_ms(10000); GP2=1; __delay_ms(10000); } } |
|
|
|
我假定“89MHz”是打印错误,您指的是8MHz。您需要更仔细地查看OSCCON寄存器位的数据表。如果你想立即设置整个寄存器,那么你需要确保这些位在正确的位置。不过,我建议您参考您需要的特定位。在这种情况下,0B0111000的值将Irf比特设置为3,对应于500 kHz。它还试图设置只读的OSTS位-它将被忽略。苏珊
以上来自于百度翻译 以下为原文 I assume that the '89MHz' is a misprint and you meant 8MHz. You need to look more carefully at the data sheet for the OSCCON register bits. If you relaly want to set the whole register at once then you need to make sure that the bits are in the correct place. However I would recommend that you reference the specific bits you need to. In this case: OSCCONbits.IRCF = 7; // or 0x7 or 0b111 Your value of 0b00111000 sets the IRCF bits to 3 which corresponds to 500kHz. It also tries to set the OSTS bit which is read-only - it will be ignored. Susan |
|
|
|
|
|
|
|
这似乎是我一直说的1到8而不是0到7的比特。
以上来自于百度翻译 以下为原文 that seems to have been it I kept saying 1 through 8 instead of 0 through 7 on the bits |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
729浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
628浏览 0评论
526浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 14:04 , Processed in 1.477563 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号