完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我是菜鸟,我知道。所以在这里,我在MPLAB X IDE 3.30中创建了一个程序,并使用pickit 2和独立pickit 2程序版本2.61将十六进制文件下载到芯片中。当模拟器运行代码时,PIC没有响应。因此我创建了一个测试程序,它应该放在一个LED(RB15)上,并且我尝试了不同的配置设置。led RB15实际上没有打开,但是有些东西似乎正在运行芯片,因为OSCO或RA3使用t他设置了CK0。所有其他GPIO引脚读出大约0.2到0.5伏,有时根据杂散电容而稍微低或更高(比如在设备附近挥动我的手)。右边我有一个MCLR线到VDD(@3.3V),当我试图运行它,我还使用高压编程模式来编译MCLR,这给出了t同样的结果和另一个免费的(但是没有用的)GPIO引脚。这是我用于测试程序的源代码:我确实理解微芯片不想让我用这个pic24f04ka200的pickit 2,尽管我从一个朋友那里借用了这个来降低项目成本。我只是在太晚的时候才发现MPLAB使用pickit 3。有没有我忽略的设置或者一些特殊的要求来阻止像我这样的小伙子进来;)哈哈?我非常感谢任何帮助!问候,JP
以上来自于百度翻译 以下为原文 Hello all, I am the noob, I know right. So here is the thing, I created a program in MPLAB X IDE 3.30 and downloaded the hex file to the chip using pickit 2 and the standalone pickit 2 program version 2.61. The PIC doesn't respond while the simulator runs the code just fine. So I created a test program which is supposed to put on a led (RB15) and I tried different configuration settings. The led RB15 doesn't actually turn on, however something seems to run the chip since OSCO or RA3 does turn on using the CLK0 setting. All other GPIO pins read about 0.2 to 0.5 volts, sometimes slightly lower or higher depending on stray capacitance (like waving my hand near the device). O right I have the MCLR wired to VDD (@3.3V) when I try to run it, I have also used high voltage programmer mode to ommit the MCLR and this gave the same results and another free (yet useless) GPIO pin. Here is the source code I used for a test program: #include #include // PIC24F04KA200 Configuration Bit Settings // 'C' source line config statements #include // FBS // FGS #pragma config GWRP = OFF // General Segment Code Flash Write Protection bit (General segment may be written) #pragma config GCP = OFF // General Segment Code Flash Code Protection bit (No protection) // FOSCSEL #pragma config FNOSC = FRC // Oscillator Select (Fast RC oscillator (FRC)) #pragma config IESO = OFF // Internal External Switch Over bit (Internal External Switchover mode disabled (Two-Speed Start-up disabled)) // FOSC #pragma config POSCMOD = NONE // Primary Oscillator Configuration bits (Primary oscillator disabled) #pragma config OSCIOFNC = ON // CLKO Enable Configuration bit (CLKO output disabled) #pragma config POSCFREQ = HS // Primary Oscillator Frequency Range Configuration bits (Primary oscillator/external clock input frequency greater than 8 MHz) #pragma config SOSCSEL = SOSCHP // SOSC Power Selection Configuration bits (Secondary oscillator configured for high-power operation) #pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock switching is disabled, Fail-Safe Clock Monitor is disabled) // FWDT #pragma config WDTPS = PS32768 // Watchdog Timer Postscale Select bits (1:32,768) #pragma config FWPSA = PR128 // WDT Prescaler (WDT prescaler ratio of 1:128) #pragma config WINDIS = OFF // Windowed Watchdog Timer Disable bit (Standard WDT selected; windowed WDT disabled) #pragma config FWDTEN = OFF // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) // FPOR #pragma config BOREN = BOR0 // Brown-out Reset Enable bits (Brown-out Reset disabled in hardware; SBOREN bit disabled) #pragma config PWRTEN = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config BORV = LPBOR // Brown-out Reset Voltage bits (Low-Power Brown-out reset occurs around 2.0V) #pragma config MCLRE = ON // MCLR Pin Enable bit (MCLR pin enabled; RA5 input pin disabled) // FICD #pragma config ICS = PGx2 // Reserved (PGC2/PGD2 are used for programming the device) // FDS #pragma config DSWDTPS = DSWDTPSF // Deep Sleep Watchdog Timer Postscale Select bits (1:2,147,483,648 (25.7 Days)) #pragma config DSLPBOR = OFF // Deep Sleep Zero-Power BOR Enable bit (Deep Sleep BOR disabled in Deep Sleep) #pragma config DSWDTEN = OFF // Deep Sleep Watchdog Timer Enable bit (DSWDT disabled) /* */ int main(void) { TRISA = 0xFFFF; TRISB = 0x0000; AD1PCFG = 0xFFFF; while(1)//program loop { PORTBbits.RB15 = 1; } return (EXIT_SUCCESS); } I do understand that microchip does not want me to use the pickit 2 for this pic24f04ka200, although I borrowed this from a friend to reduce project costs. I only found out MPLAB uses pickit 3 when it was too late. Is there a setting which I have overlooked or some special requirements to keep noobs like me out ;) haha? I would very much appreciate any help! Regards, JP |
|
相关推荐
1个回答
|
|
嗨,伙计们,我明白了!所以我买了一些相同型号的新芯片,现在我的LED闪亮了。所以前一个芯片有问题。干杯!日本药典
以上来自于百度翻译 以下为原文 Hi guys, I figured it out! So I bought a few new chips of the same kind and now I do get the led to blink. So the previous chip was faulty. Cheers! JP |
|
|
|
只有小组成员才能发言,加入小组>>
5237 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
772浏览 1评论
660浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
590浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
672浏览 0评论
572浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 06:13 , Processed in 1.233984 second(s), Total 77, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号