之前,我不能使用3.45,参见其他线程)defineFa._SetPushPull()do{ODCONCbits.ODCC6=1;}而定义Fa._SetOpenDrain()do{ODCONCbits.ODCC6=0;}而mcc生成的代码似乎执行oppOSSIT.
2020-04-03 11:08
; //RC3->I2C1:SCL1; I2C1SCLPPSbits.I2C1SCLPPS = 0x13; //RC3->I2C1:SCL1;ODCONCbits.ODCC3 = 1
2018-09-27 15:01
; // SCL1 _LATB6 = 1; _ODCB6 = 1; // ASCL2 _LATB3 = 1; _ODCB3 = 1; // ASDA2 _LATC15 = 1; _ODCC15 = 1
2019-04-25 11:10
; PPSLOCKbits.PPSLOCKED = 0x01; // Configure the pins as Open-drain ODCONCbits.ODCC3 = 1
2019-01-07 14:57
;ODCC=0;LATC=0;T1CON=0; CNPD1=0;CNPD2=0;CNPD3=0;CNPU1=0;CNPU2=0;CNPU3=0; RCONbits.RETEN=1; //Also LPCFG
2019-01-28 11:50
你好,我感兴趣的是“自定义模块”在“PIN模块”中的意思。根据我在http://MyCHIPPravestDeave:West:GPIOORD中发现的描述,这就像是PIN的另一个给定名称,这将是在编写配置中未覆盖的任何附加代码时使用的名称。这个页面还说,如果EQ为PIN设置了自定义名称,下面的宏应该在Pin管理器中。在生成代码后,我检查了PixMault.h。我可以看到这些宏//GET/SET RC4过程,定义了RC4xSETHEE():{LATCITS.LATC4=1;}(0)定义了RC4SETWORLVER()DO LATCITS.LATC4=0;}(0)定义了RC4x ToGeLe[()的定义:{LaCTBIT.LATC4= ~LATCITS.LATC4;}(0)α定义。cRb4xStudioDigalIdPUTPUTE()DO TrigCalbId.TrISC4=1;}(0)*定义RC4xStudioDigalOutPututer()DO TrccBist.TrISC4=0;}(0)*定义RC4SeToPulCuffle()DO {WPUCITBES.WPUC4=1;}(0)*定义RC4SeReTePULPULL()DO {WPUCPITS.WPUC4= 0;}(0)RC4GETValuy()端口请让我知道,我是否误解了自定义名称的含义,或者只是做错了什么?MPALBX IDE:4.15xC8:1.45谢谢您的帮助,/ Robi 以上来自于百度翻译 以下为原文 hello,I was interested what the "custom name" means in the "Pin Module". According to the description I found in http://microchipdeveloper...ress:gpiointroduction, this is like a additional given name for the pin, and this will be the name used while writing any additional code not covered in configuration. Also this page says if eq I set the Custom Name for a PIN, the following macros should be in the pin_manager.h:_SetHigh() _SetLow() ...In my project I configured RA4 as digital output, and give the "PWR_STATUS" Custom Name. I checked the pin_manager.h after generated the code, and I can see these macros// get/set RC4 procedures #define RC4_SetHigh() do { LATCbits.LATC4 = 1; } while(0) #define RC4_SetLow() do { LATCbits.LATC4 = 0; } while(0) #define RC4_Toggle() do { LATCbits.LATC4 = ~LATCbits.LATC4; } while(0) #define RC4_GetValue() PORTCbits.RC4 #define RC4_SetDigitalInput() do { TRISCbits.TRISC4 = 1; } while(0) #define RC4_SetDigitalOutput() do { TRISCbits.TRISC4 = 0; } while(0) #define RC4_SetPullup() do { WPUCbits.WPUC4 = 1; } while(0) #define RC4_ResetPullup() do { WPUCbits.WPUC4 = 0; } while(0)Could you please let me know, did I misunderstand the meaning of Custom Name, or just did something wrong? MPALBX IDE: 4.15XC8: 1.45 Thanks for your help,/Robi
2018-10-24 16:52
)***************************************************************************/ ODCA = 0x0000; ODCB = 0x0000; ODCC
2018-12-29 16:07
你好朋友,我是新来的论坛,但我已经与PIC一起发展了6年。我有一个我无法解决的问题,这正是这个话题的主题。我使用的是PIC24FJ256GB106与Enc25J60,但它不以任何方式通信。有人担心吗?我已经在其他PIC中使用了Enc2J60而没有任何问题。现在用PIC24FJ我无法进行通信。有谁经历过这件事,谁能帮助我?如果你想,我会把这个项目和布局。拥抱每个人。 以上来自于百度翻译 以下为原文 Hello friends, I am new here in the forum but I have already developed with PIC for 6 years. I have a problem that I can not solve, which is precisely the topic of this topic. I'm using the PIC24FJ256GB106 with an ENC28J60 but it does not communicate in any way. Anyone have any concerns? I already use the ENC28J60 in other PIC's without any problem. Now with PIC24FJ I can not make the communication. Has anyone gone through this, who could help me? If you want, I'll put the project and layout. Hug to everyone.
2019-04-19 14:22
你好,我有一个DSPIC板,不能让PLL工作。我对水晶很怀疑,所以我需要澄清我的代码没有任何问题。我的代码有问题吗?? 以上来自于百度翻译 以下为原文 Hello, I have a board with that dspic and could not make pll work. I am suspicious about the crystal so i need to clarify that my code has not any problem. Is there any problem with my code?? #pragma config ICS = PGD2 // ICD Communication Channel Select bits (Communicate on PGEC2 and PGED2)#pragma config JTAGEN = OFF // JTAG Enable bit (JTAG is disabled)// FPOR#pragma config ALTI2C1 = ON // Alternate I2C1 pins (I2C1 mapped to ASDA1/ASCL1 pins)#pragma config ALTI2C2 = ON // Alternate I2C2 pins (I2C2 mapped to ASDA2/ASCL2 pins)#pragma config WDTWIN = WIN75 // Watchdog Window Select bits (WDT Window is 75% of WDT period)// FWDT#pragma config WDTPOST = PS32768 // Watchdog Timer Postscaler bits (1:32,768)#pragma config WDTPRE = PR128 // Watchdog Timer Prescaler bit (1:128)#pragma config PLLKEN = OFF // PLL Lock Enable bit (Clock switch will not wait for the PLL lock signal.)#pragma config WINDIS = OFF // Watchdog Timer Window Enable bit (Watchdog Timer in Non-Window mode)#pragma config FWDTEN = OFF // Watchdog Timer Enable bit (Watchdog timer enabled/disabled by user software)// FOSC#pragma config POSCMD = NONE // Primary Oscillator Mode Select bits (Primary Oscillator disabled)#pragma config OSCIOFNC = OFF // OSC2 Pin Function bit (OSC2 is clock output)#pragma config IOL1WAY = OFF // Peripheral pin select configuration (Allow multiple reconfigurations)#pragma config FCKSM = CSDCMD // Clock Switching Mode bits (Both Clock switching and Fail-safe Clock Monitor are disabled)// FOSCSEL#pragma config FNOSC = FRC // Oscillator Source Selection (Internal Fast RC (FRC))#pragma config PWMLOCK = ON // PWM Lock Enable bit (Certain PWM registers may only be written after key sequence)#pragma config IESO = ON // Two-speed Oscillator Start-up Enable bit (Start up device with FRC, then switch to user-selected oscillator source)// FGS#pragma config GWRP = OFF // General Segment Write-Protect bit (General Segment may be written)#pragma config GCP = OFF // General Segment Code-Protect bit (General Segment Code protect is Disabled)#include #include "common.h"/* Main application */int main(void){ // Configure PLL prescaler, PLL postscaler, PLL divisor PLLFBD=46; // M=48 CLKDIVbits.PLLPOST=0; // N2=2 CLKDIVbits.PLLPRE=0; // N1=2 // Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011) __builtin_write_OSCCONH(0x03); __builtin_write_OSCCONL(OSCCON | 0x01); // Wait for Clock switch to occur while (OSCCONbits.COSC!= 0b011); // Wait for PLL to lock while (OSCCONbits.LOCK!= 1); TRISAbits.TRISA7 = OUTPUT; TRISAbits.TRISA10 = OUTPUT; while (1) {__delay_ms(500);LATAbits.LATA10 = 1;LATAbits.LATA7 = 1;__delay_ms(500);LATAbits.LATA10 = 0;LATAbits.LATA7 = 0;// Add your application code }}/*common.h*/ #define FCY 60000000UL#define OUTPUT 1#define INPUT 0 #define MapLock() __builtin_write_OSCCONL(OSCCON | (1
2019-03-27 14:56
大家好,因为我是嵌入式时代的新手,所以在尝试用PIC24FJ256GB110(使用浏览器16开发板)实现UART通信时,遇到了一些小问题。然后生成代码。在生成代码之后,我得在文件“uart2.c”和“main.c”中获取uart例程,在这里我必须实现这些代码。我的main.c文件代码如下所示:我能够闪存和运行代码。我将rs232端口与电缆连接,并将其转换为u***并检查该端口。在串行模拟器中。由于我运气不好,我没有得到输出。我试图调试,但没有运气。任何人可以帮我。预先感谢。 以上来自于百度翻译 以下为原文 Hello everyone as I am new in embedded era,So I am facing little bit problem while trying to implement code to achieve uart communication with PIC24FJ256GB110 (using explorer 16 development board). I am using MPLAB X IDE v.3.35.I am opening MCC(MPLAB CODE configurator) and selecting UART2 module and then generating code.After generating code I am getting uart routines in file "uart2.c" and "main.c" where I have to implement that code.My main.c file code is as shown below: #include "mcc_generated_files/mcc.h"#define MY_BUFFER_SIZE 10/* Main application */ main(void){ // initialize the device SYSTEM_Initialize();const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;unsigned int numBytes = 0;int writebufferLen = 26; // UART2_Initialize(); // It is already initialised inside SYSTEM_Initialize() method. while(numBytes < writebufferLen){ int bytesToWrite = UART2_TransmitBufferSizeGet();numBytes += UART2_WriteBuffer ( writeBuffer+numBytes, bytesToWrite) ;}} I am able to flash and run the code.I am connecting rs232 port with cable which converts it into u*** and checking that port in an serial emulator.As my hard luck I am not getting output.I tried to debug but no luck. Can anyone assist me please.Thanks in advance.
2019-07-24 08:44