RISC,对不起,我的问题更多的是关于数据和数据解释。但是,在这里……PIC18F4680C18MPLAB IDV863i AM设置ECP1作为捕获,在我的中断期间,在我的CAN TxMy可以监视正在读取;can MexGe 0x4fByb顺序:Moto LoalStand(BIT):16STARTBIT:8.我希望这能帮助你回答我关于MSB和LSB的问题吗?我的抓捕工作很好,但似乎并不稳定(我想)杰森
以上来自于百度翻译
以下为原文
RISC,
Sorry, my question was more about the data and the data interpretation.
but, here you go...
PIC18F4680
C18
MPLAB IDE v8.63
I am setting up the ECCP1 as a capture,
During my interrupt
// Overflow on Tmr1
if (PIR1bits.TMR1IF)
{
Tmr1OrFlw++;
PIR1bits.TMR1IF = 0;
}
// Capture on pin RD4
if (PIR2bits.ECCP1IF)
{
TMR1H = 0x00;
TMR1L = 0X00;
Tmr1OrFlwResult = Tmr1OrFlw;
Tmr1OrFlw = 0x00;
PIR2bits.ECCP1IF = 0; // clear in sw
PIR2 = 0x00; // Above line doesn't seem to work on it own?
}
}
Then during my CAN Tx
if (tTimer_MPH_Data >= Timer_25mS)
{
tTimer_MPH_Data=0;
iTXAttempts= 1; // Try to send once before calling it a day
ID = 0x4F;
// Clear down the CAN buffers-------------//
data[0] = Tmr1OrFlwResult;
data[1] = ECCPR1H;
data[2] = ECCPR1L;
data[3] = Tmr1OrFlw;
while ((!ECANSendMessage(ID,data,4,ECAN_TX_STD_FRAME))&& iTXAttempts!=0) // If failed...
iTXAttempts--;
}
My CAN monitoring is reading the;
CAN Messgae 0x4F
Byte Order : Motorola
Length (bit) : 16
Startbit : 8
I hope this helps you answer my question about is the MSB and LSB in the correct order? My Capture is working fine but just doesn't seem to be stable (I think)
Jason
RISC,对不起,我的问题更多的是关于数据和数据解释。但是,在这里……PIC18F4680C18MPLAB IDV863i AM设置ECP1作为捕获,在我的中断期间,在我的CAN TxMy可以监视正在读取;can MexGe 0x4fByb顺序:Moto LoalStand(BIT):16STARTBIT:8.我希望这能帮助你回答我关于MSB和LSB的问题吗?我的抓捕工作很好,但似乎并不稳定(我想)杰森
以上来自于百度翻译
以下为原文
RISC,
Sorry, my question was more about the data and the data interpretation.
but, here you go...
PIC18F4680
C18
MPLAB IDE v8.63
I am setting up the ECCP1 as a capture,
During my interrupt
// Overflow on Tmr1
if (PIR1bits.TMR1IF)
{
Tmr1OrFlw++;
PIR1bits.TMR1IF = 0;
}
// Capture on pin RD4
if (PIR2bits.ECCP1IF)
{
TMR1H = 0x00;
TMR1L = 0X00;
Tmr1OrFlwResult = Tmr1OrFlw;
Tmr1OrFlw = 0x00;
PIR2bits.ECCP1IF = 0; // clear in sw
PIR2 = 0x00; // Above line doesn't seem to work on it own?
}
}
Then during my CAN Tx
if (tTimer_MPH_Data >= Timer_25mS)
{
tTimer_MPH_Data=0;
iTXAttempts= 1; // Try to send once before calling it a day
ID = 0x4F;
// Clear down the CAN buffers-------------//
data[0] = Tmr1OrFlwResult;
data[1] = ECCPR1H;
data[2] = ECCPR1L;
data[3] = Tmr1OrFlw;
while ((!ECANSendMessage(ID,data,4,ECAN_TX_STD_FRAME))&& iTXAttempts!=0) // If failed...
iTXAttempts--;
}
My CAN monitoring is reading the;
CAN Messgae 0x4F
Byte Order : Motorola
Length (bit) : 16
Startbit : 8
I hope this helps you answer my question about is the MSB and LSB in the correct order? My Capture is working fine but just doesn't seem to be stable (I think)
Jason
举报