This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC430F5137:固定 GT FIFO 定时器 ISR 不工作

Guru**** 2387830 points
Other Parts Discussed in Thread: CC1101
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1049080/cc430f5137-fixed-gt-fifo-timer-isr-not-working

器件型号:CC430F5137
主题中讨论的其他器件:CC1101

你好

我在 Code Composer Studio 上使用 Fixed_GT_FIFO 代码、并且不熟悉微控制器编程。 我 使用了 EM-CC430F5137-900评估板和 MSP_FET 闪存仿真工具进行调试。 我尝试通过在 LPM0模式下操作电路板来运行 Fixed_GT_FIFO。 我已附上以下代码。 当我按下按钮(P1.7)时,代码进入 TransmitPacket()。 定时器 ISR 会按 预期调用 pktTxhandler()函数。 但是、一旦进入后一个函数、它就会在  CC430_State_TX 的情况下将总共100个字节的16个数据包从 TxBuffer 卸载到 TX FIFO。 代码从 pktTxhandler()中输出。  之后 、计时器 ISR 会再次调用它。 现在、代码 进入 CC430_State_TX_underflow 情况 、并退出函数和计时器。 它也不调用 CC1101 ISR。 我使用 Step into 来观察这些步骤。

我期望代码使用计时器 ISR 以更小的尺寸传输所有100字节。 它还应该在64字节或更多字节的 TXFIFO 中填充 CC1101之前调用它。 但是、我无法看到这些函数。 是否有人可以读取代码和射频设置、并告诉我是否有任何错误。 或者、使用 Step into 函数观察计时器运行是否有任何故障?

/******************************************************************************
* CC430 RF Code Example - TX and RX (fixed-size packet length > FIFO size)
*
* Simple RF Link to Toggle Receiver's LED by pressing Transmitter's Button    
* Warning: This RF code example is setup to operate at either 868 or 915 MHz, 
* which might be out of allowable range of operation in certain countries.
* The frequency of operation is selectable as an active build configuration
* in the project menu. 
* 
* Please refer to the appropriate legal sources before performing tests with 
* this code example. 
* 
* This code example can be loaded to 2 CC430 devices. Each device will transmit 
* a 100 byte packet upon a button pressed. Each device will also toggle its LED 
* upon receiving the packet(s). 
* 
* The RF packet engine settings specify variable-length-mode with CRC check 
* enabled. The RX packet also appends 2 status bytes regarding CRC check, RSSI 
* and LQI info. For specific register settings please refer to the comments for 
* each register in RfRegSettings.c, the CC430x613x User's Guide, and/or
* SmartRF Studio.
* 
* * M. Morales/D. Dang
* Texas Instruments Inc.
* June 2010
* Built with IAR v4.21 and CCS v4.1
******************************************************************************/

#include "RF_Toggle_LED_Demo.h"

extern RF_SETTINGS rfSettings;

unsigned char packetReceived;
unsigned char packetTransmit; 

unsigned char txBytesLeft = PACKET_LEN;           // +1 for length byte 
unsigned char txPosition = 0; 
unsigned char rxBytesLeft = PACKET_LEN+2;         // +2 for status bytes
unsigned char rxPosition = 0;
unsigned char lengthByteRead = 0; 

unsigned char RxBufferLength = 0;
unsigned char TxBufferLength = 0; 
unsigned char * _p_Buffer = 0; 
unsigned char buttonPressed = 0;
unsigned int i = 0;                 

unsigned char transmitting = 0; 
unsigned char receiving = 0; 

unsigned char RxBuffer[PACKET_LEN+2] = {0};
unsigned char TxBuffer[PACKET_LEN]= {
    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 
    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 
    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 
    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 
    0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 
    0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 
    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 
    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 
    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 
    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 
};

void main( void )
{  
  // Stop watchdog timer to prevent time out reset 
  WDTCTL = WDTPW + WDTHOLD; 
    
  // Increase PMMCOREV level to 2 for proper radio operation
  SetVCore(2);                               
  
  ResetRadioCore();
  InitButtonLeds();
  InitTimer(); 
    
  // Clean out the RX Buffer 
  rxPosition = PACKET_LEN+2;
  while(rxPosition--)
  {
    RxBuffer[rxPosition] = 0; 
  }

  InitRadio();  
  ReceiveOn(); 
    
  while (1)
  { 
    P1IE |= BIT7;                           // Enable button interrupt
    
    __bis_SR_register(LPM0_bits+GIE );
    __no_operation(); 
    
    if (buttonPressed)                      // Process a button press->transmit
    {
      ReceiveOff();                         // Button means TX, stop RX
      receiving = 0;                         
      
      TransmitPacket();                 

      buttonPressed = 0;                    // Re-enable button press                           
    }
    if(receiving)
    {
      ReceivePacket();
      __no_operation();
    }
    if(!transmitting)
    {
      ReceiveOn();
    }
  }
}

void ReceivePacket(void)
{
  rxBytesLeft = PACKET_LEN + 2;// Set maximum packet leng + 2 for appended bytes
  rxPosition = 0; 
  packetReceived = 0; 
  
  __delay_cycles(2800);                     // Wait for bytes to fill in RX FIFO

  TA0CCR1   = RX_TIMER_PERIOD;              // x cycles * 1/32768 = y us
  TA0CCTL1 |= CCIE;            
  TA0CTL   |= MC_2 + TACLR;                 // Start the timer- continuous mode

  __bis_SR_register(LPM0_bits+GIE);
  __no_operation(); 
  
  TA0CCR1 = RX_TIMER_PERIOD;             
  TA0CCTL1 &= ~(CCIE);
  TA0CTL &= ~(MC_3);                  // Turn off timer 
  
  __no_operation(); 
}

void TransmitPacket(void)
{  
  P3OUT |= BIT6;                        // Pulse LED during Transmit

  txBytesLeft = PACKET_LEN;   
  txPosition = 0; 
  packetTransmit = 0; 
  transmitting = 1;       
  
  Strobe( RF_STX );                         // Strobe STX   
  
  TA0CCR1   = TX_TIMER_PERIOD;              // x cycles * 1/32768 = y us
  TA0CCTL1 |= CCIE; 
  TA0CTL |= MC_2 + TACLR;                   // Start the timer- continuous mode   

  __bis_SR_register(LPM0_bits+GIE);
  __no_operation(); 
  
  TA0CCR1 = TX_TIMER_PERIOD;             // x cycles * 1/32768 = y us
  TA0CCTL1 &= ~(CCIE); 
  TA0CTL &= ~(MC_3);                  // Turn off timer         

  P3OUT &= ~BIT6;                     // Turn off LED after Transmit
}

void ReceiveOn(void)
{  
  RF1AIES &= ~BIT9; 
  RF1AIFG = 0;                              // Clear pending RFIFG interrupts
  RF1AIE  |= BIT9;                          // Enable the sync word received interrupt
  
  // Radio is in IDLE following a TX, so strobe SRX to enter Receive Mode
  Strobe( RF_SRX );        
  
  __no_operation(); 
}

void ReceiveOff(void)
{
  RF1AIE &= ~BIT9;                          // Disable RX interrupts
  RF1AIFG &= ~BIT9;                         // Clear pending IFG
  RF1AIES &= ~BIT9;                         // Switch back to to sync word

  // It is possible that ReceiveOff is called while radio is receiving a packet.
  // Therefore, it is necessary to flush the RX FIFO after issuing IDLE strobe 
  // such that the RXFIFO is empty prior to receiving a packet.
  Strobe(RF_SIDLE); 
  Strobe(RF_SFRX);                       
}

//------------------------------------------------------------------------------
//  void pktRxHandler(void)
//
//  DESCRIPTION:
//      This function is called every time a timer interrupt occurs. The 
//      function starts by retreiving the status byte. Every time the status 
//      byte indicates that there are available bytes in the RX FIFO, bytes are 
//      read from the RX FIFO and written to RxBuffer. This is done until the 
//      whole packet is received. If the status byte indicates that there has 
//      been an RX FIFO overflow the RX FIFO is flushed. Please see the 
//      EM430F6137RF900 RF Examples User Manual for a flow chart describing this
//      function.
//------------------------------------------------------------------------------
void pktRxHandler(void) {
  unsigned char RxStatus;
  unsigned char bytesInFifo;
  
  // Which state?
  RxStatus = Strobe(RF_SNOP);
  
  switch(RxStatus & CC430_STATE_MASK)
  {
    case CC430_STATE_RX:
      // If there's anything in the RX FIFO....
      if (bytesInFifo = MIN(rxBytesLeft, RxStatus & CC430_FIFO_BYTES_AVAILABLE_MASK))
      {         
        // Update how many bytes are left to be received
        rxBytesLeft -= bytesInFifo;
  
        // Read from RX FIFO and store the data in rxBuffer
        while (bytesInFifo--) {
          RxBuffer[rxPosition] = ReadSingleReg(RXFIFO);
          rxPosition++; 
        }  
        if (!rxBytesLeft){           
            packetReceived = 1; 
            receiving = 0;
            lengthByteRead = 0; 
            ReceiveOff();
            
            P1OUT ^= BIT0;                    // Toggle LED1
        }      
      } 
      break;
    default:
      if(!packetReceived)
      {
        packetReceived = 1; 
      }
      
      rxBytesLeft = 0;
      receiving = 0; 
      ReceiveOff();

      break;  
  }
} // pktRxHandler

//------------------------------------------------------------------------------
//  void pktTxHandler(void)
//
//  DESCRIPTION:
//      This function is called every time a timer interrupt occurs. The function starts
//      by getting the status byte. Every time the status byte indicates that there 
//      is free space in the TX FIFO, bytes are taken from txBuffer and written to 
//      the TX FIFO until the whole packet is written or the TXFIFO has underflowed. 
//      See the EM430F6137RF900 RF Examples User Manual for a flow chart describing
//      this function.
//------------------------------------------------------------------------------
void pktTxHandler(void) {
    unsigned char freeSpaceInFifo;
    unsigned char TxStatus;  
    
    // Which state?
    TxStatus = Strobe(RF_SNOP);

    switch (TxStatus & CC430_STATE_MASK) {
        case CC430_STATE_TX:
            // If there's anything to transfer..
            if (freeSpaceInFifo = MIN(txBytesLeft, TxStatus & CC430_FIFO_BYTES_AVAILABLE_MASK)) 
            {
              txBytesLeft -= freeSpaceInFifo;

              while(freeSpaceInFifo--)
              {
                WriteSingleReg(TXFIFO, TxBuffer[txPosition]);
                txPosition++; 
              }
              
              if(!txBytesLeft)
              {                
                RF1AIES |= BIT9;      // End-of-packet TX interrupt
                RF1AIFG &= ~BIT9;     // clear RFIFG9
                while(!(RF1AIFG & BIT9)); // poll RFIFG9 for TX end-of-packet  
                RF1AIES &= ~BIT9;      // End-of-packet TX interrupt
                RF1AIFG &= ~BIT9;     // clear RFIFG9
                transmitting = 0; 
                packetTransmit = 1; 
              }
            }
            break;

        case CC430_STATE_TX_UNDERFLOW:
            Strobe(RF_SFTX);  // Flush the TX FIFO
            
            __no_operation(); 
            // No break here!
        default:
            if(!packetTransmit) 
              packetTransmit = 1; 
            
            if (transmitting) {
                if ((TxStatus & CC430_STATE_MASK) == CC430_STATE_IDLE) {
                  transmitting = 0;
                }
            }
        break;
    }
} // pktTxHandler

void InitTimer(void)
{
  P5SEL |= 0x03;                            // Set xtal pins  
  LFXT_Start(XT1DRIVE_3); // changed from Drive 0 to Drive 3
  
  TA0CCR1  = RX_TIMER_PERIOD;               // x cycles * 1/32768 = y us
  TA0CCTL1 = CCIE;                          // Enable interrupts
  TA0CTL   = TASSEL__ACLK + TACLR;          // ACLK source
}

void InitButtonLeds(void)
{
  // Set up the button as interruptible 
  P1DIR &= ~BIT7;
  P1REN |= BIT7;
  P1IES &= BIT7;
  P1IFG = 0;
  P1OUT |= BIT7;
  P1IE  |= BIT7; 

  // Initialize Port J
  PJOUT = 0x00;
  PJDIR = 0xFF; 

  // Set up LEDs 
  P3OUT &= ~BIT6;
  P3DIR |= BIT6;
  P1OUT &= ~BIT0;
  P1DIR |= BIT0;
}

void InitRadio(void)
{
    //switch antenna ON
    //P2DIR |= BIT7;
    //P1REN |= BIT7;
    //P2OUT |= BIT7;
  // Set the High-Power Mode Request Enable bit so LPM0 can be entered
  // with active radio enabled 
  PMMCTL0_H = 0xA5;
  PMMCTL0_L |= PMMHPMRE_L; 
  PMMCTL0_H = 0x00; 
  
  WriteRfSettings(&rfSettings);
  
  WriteSinglePATable(PATABLE_VAL);
}

/**************************************
* Interrupt Service Routines
**************************************/

#pragma vector=TIMER0_A1_VECTOR
__interrupt void TIMER0_A1_ISR(void)
{
  switch(__even_in_range(TA0IV,14))
  {
    case 0:  break;                  
    case 2:  
      if(receiving)
      {
        TA0CCR1 += RX_TIMER_PERIOD;                  // 16 cycles * 1/32768 = ~500 us

        pktRxHandler();  
        
        if(packetReceived)
          __bic_SR_register_on_exit(LPM0_bits);
            __no_operation();
      }
      else if(transmitting)
      {
        TA0CCR1 += TX_TIMER_PERIOD;                  // 16 cycles * 1/32768 = ~500 us

        pktTxHandler(); 
        
        if(packetTransmit)
          __bic_SR_register_on_exit(LPM0_bits);
            __no_operation();
      }       
      break;
    case 4:  break;                         // CCR2 not used
    case 6:  break;                         // Reserved not used
    case 8:  break;                         // Reserved not used
    case 10: break;                         // Reserved not used
    case 12: break;                         // Reserved not used
    case 14: break;                         // Overflow not used
  }
}

#pragma vector=CC1101_VECTOR
__interrupt void CC1101_ISR(void)
{
  switch(__even_in_range(RF1AIV,32))        // Prioritizing Radio Core Interrupt 
  {
    case  0: break;                         // No RF core interrupt pending                                            
    case  2: break;                         // RFIFG0 
    case  4: break;                         // RFIFG1
    case  6: break;                         // RFIFG2
    case  8: break;                         // RFIFG3
    case 10: break;                         // RFIFG4
    case 12: break;                         // RFIFG5
    case 14: break;                         // RFIFG6          
    case 16: break;                         // RFIFG7
    case 18: break;                         // RFIFG8
    case 20:                                // RFIFG9
      if(!(RF1AIES & BIT9))                 // RX sync word received 
      {
        receiving = 1;         
        __bic_SR_register_on_exit(LPM0_bits); // Exit active
      }
      else while(1);                // trap
      break;
    case 22: break;                         // RFIFG10
    case 24: break;                         // RFIFG11
    case 26: break;                         // RFIFG12
    case 28: break;                         // RFIFG13
    case 30: break;                         // RFIFG14
    case 32: break;                         // RFIFG15
  }      
}

#pragma vector=PORT1_VECTOR
__interrupt void PORT1_ISR(void)
{
  switch(__even_in_range(P1IV, 16))
  {
    case  0: break;
    case  2: break;                         // P1.0 IFG
    case  4: break;                         // P1.1 IFG
    case  6: break;                         // P1.2 IFG
    case  8: break;                         // P1.3 IFG
    case 10: break;                         // P1.4 IFG
    case 12: break;                         // P1.5 IFG
    case 14: break;                         // P1.6 IFG
    case 16:                                // P1.7 IFG
      __delay_cycles(10);                 // debounce delay
      buttonPressed = 1;
      P1IE = 0;                             // Debounce by disabling buttons
      P1IFG = 0; 
     __bic_SR_register_on_exit(LPM0_bits); // Exit active
      break;
  }
}

rf_settings rfSettings ={
0x08、// FSCTRL1频率合成器控制。
0x00、// FSCTRL0频率合成器控制。
0x23、// FREQ2频率控制字、高字节。
0x31、// FREQ1频率控制字、中间字节。
0x3B、// FREQ0频率控制字、低字节。
0xf5、// MDMCFG4调制解调器配置。
0x83、// MDMCFG3调制解调器配置。
0x13、// MDMCFG2调制解调器配置。
0x22、// MDMCFG1调制解调器配置。
0xf8、// MDMCFG0调制解调器配置。
0x00、// CHANNR 通道编号。
0x15、// DEVIATN 调制解调器偏差设置(启用 FSK 调制时)。
0x56、// FREND1前端 RX 配置。
0x10、// FREND0前端 TX 配置。
0x07、// MCSM2主无线电控制状态机配置。
0x30、// MCSM1主无线电控制状态机配置。
0x10、// MCSM0主无线电控制状态机配置。
0x16、// FOCCFG 频率偏移补偿配置。
0x6C、// BSCFG 位同步配置。
0x03、// AGCCTRL2 AGC 控制。
0x40、// AGCCTRL1 AGC 控制。
0x91、// AGCCTRL0 AGC 控制。
0xE9、// FSCAL3频率合成器校准。
0x2A、// FSCAL2频率合成器校准。
0x00、// FSCAL1频率合成器校准。
0x1f、// FSCAL0频率合成器校准。
0x59、// FSTEST 频率合成器校准。
0x81、// TEST2各种测试设置。
0x35、// TEST1各种测试设置。
0x09、// TEST0各种测试设置。
0x47、// FIFOTHR RXFIFO 和 TXFIFO 阈值。
0x29、// IOCFG2 GDO2输出引脚配置。
0x2E、// IOCFG1 GDO1输出引脚配置。
0x06、// IOCFG0 GDO0输出引脚配置。 请参阅 SmartRF? Studio 用户手册、了解详细的伪寄存器说明。
0x04、// PKTCTRL1数据包自动化控制。
0x04、// PKTCTRL0数据包自动化控制。
0x00、// ADDR 设备地址。
0x64 // PKTLEN 数据包长度。
};

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Puneeth、

    我无法清楚地理解您的问题、您是否遇到有关430代码的问题? 这意味着该问题是针对430代码而不是 CC1101内部的某些配置问题。

    还是 CC1101的配置参数问题?

    您能帮助提供有关此问题的更多详细信息吗?

    谢谢!

    此致

    Johnson

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我认为在调试模式下运行时需要非常小心。 对讲机向该程序呈现实时方面、因为它将在您在断点处停止时运行。 在运行时、它依靠 CPU "及时"提供数据、以保持数据包位流动、如果 CPU 在调试器中停止、这种情况不会发生。

    如您所述、所有 Tx 工作都在后台进行、而 main 位于 LPM (第152行)中。 背景代码无法暂停、或(如您所见)对讲机将完成发送 FIFO 中的字节、并且必须停止。 这不是编码的东西--无线电必须为整个数据包提供连续的(调制的)位流。

    您可以执行的操作:

    1) 1)在第152行的 LPM 之前和/或之后设置断点(Rx 具有类似的结构和类似的危险)、然后让程序全速运行。

    2) 2)如果您需要在后台代码中暂停(在数据包中间),请接受该数据包丢失的事实,记下您的发现并继续-它将恢复并发送下一个数据包正常。

    [编辑:小澄清]

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你(们)好,约翰逊

     对于大于缓冲区大小(64字节)的数据包、我认为430代码存在一些问题。 Fixed_LT_FIFO 在同一个板上工作正常。  我认为 CC1101配置设置或 RF 寄存器值不应出现问题。  

    我所面临的问题是、当我使用 Fixed_GT_code 时、并且我使用 Step into 观察传输过程时、代码会在将16字节数据从 TxBuffer 推送到 TX FIFO 之后突然终止计时器。 我的问题是、"步骤是否会影响计时器流程?"

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好 Bruce

    我在我的代码中应用了您的第一个建议。 我 分别在第152行和第133行为发送器和接收器代码设置断点。 接收器确实接收到100个字节的数据。 但是、这是不正确的。 我 已附加以下 RxBuffer 值:

    索引|变量类型|字符|十六进制值|地址

    [0] unsigned char 0 '\x00' 0x001C00
    [1]无符号字符5 '\x05' 0x001C01
    [2] unsigned char 3 '\x03' 0x001C02
    [3]无符号字符3 '\x03' 0x001C03
    [4]无符号字符20 '\x14' 0x001C04
    [5]无符号字符133 '\x85' 0x001C05
    [6]无符号字符6 '\x06' 0x001C06
    [7]无符号字符7 '\x07' 0x001C07
    [8]无符号字符8 '\x08' 0x001C08
    [9]无符号字符9 '\x09' 0x001C09
    [10] unsigned char 16 '\x10' 0x001C0A
    [11]无符号字符17 '\x11' 0x001C0B
    [12]无符号字符18 '\x12' 0x001C0C
    [13]无符号字符19 '\X13' 0x001C0D
    [14]无符号字符20 '\x14' 0x001C0E
    [15]无符号字符21 '\x15' 0x001C0F
    [16]无符号字符22 '\X16' 0x001C10
    [17] unsigned char 23 '\X17' 0x001C11
    [18]无符号字符24 '\x18' 0x001C12
    [19]无符号字符25 '\x19' 0x001C13
    [20] unsigned char 32'' 0x001C14
    [21]无符号字符33 '!' 0x001C15
    [22] unsigned char 34 '' 0x001C16
    [23] unsigned char 35 '#' 0x001C17
    [24] unsigned char 36 '$' 0x001C18
    [25] unsigned char 37 '%' 0x001C19
    [26] unsigned char 38 '&' 0x001C1A
    [27] unsigned char 39 '' 0x001C1B
    [28] unsigned char 40 '(' 0x001C1C
    [29] unsigned char 41 ')' 0x001C1D
    [30]无符号字符48 '0' 0x001E
    [31]无符号字符49 "1" 0x001C1F
    [32]无符号字符50 '2' 0x001C20
    [33] unsigned char 51 '3' 0x001C21
    [34] unsigned char 52 '4' 0x001C22
    [35] unsigned char 53 '5' 0x001C23
    [36]无符号字符54 '6' 0x001C24
    [37] unsigned char 55 '7' 0x001C25
    [38] unsigned char 56 '8' 0x001C26
    [39]无符号字符57 '9' 0x001C27
    [40] unsigned char 64 '@' 0x001C28
    [41]无符号字符65 'A' 0x001C29
    [42]无符号字符66 "B" 0x001C2A
    [43]无符号字符67 "C" 0x001C2B
    [44]无符号字符68 "D" 0x001C2C
    [45]无符号字符69 'E' 0x001C2D
    [46]无符号字符70 "F" 0x001C2E
    [47] unsigned char 71 "G" 0x001C2F
    [48] unsigned char 72 'H' 0x001C30
    [49]无符号字符73 'I' 0x001C31
    [50] unsigned char 80 'P' 0x001C32
    [51]无符号字符81 'Q' 0x001C33
    [52]无符号字符82 "R" 0x001C34
    [53] unsigned char 243 '\xf3' 0x001C35
    [54]无符号字符86 "V" 0x001C36
    [55]无符号字符85 "U" 0x001C37
    [56]无符号字符86 "V" 0x001C38
    [57]无符号字符87 "W" 0x001C39
    [58]无符号字符88 "X" 0x001C3A
    [59]无符号字符89 "Y" 0x001C3B
    [60] unsigned char 96 '`' 0x001C3C
    [61]无符号字符97 'A' 0x001C3D
    [62] unsigned char 98 'b' 0x001C3E
    [63]无符号字符99 'c' 0x001C3F
    [64]无符号字符100 'd' 0x001C40
    [65]无符号字符0 '\x00' 0x001C41
    [66]无符号字符1 '\x01' 0x001C42
    [67] unsigned char 3 '\x03' 0x001C43
    [68]无符号字符20 '\x14' 0x001C44
    [69] unsigned char 133 '\x85' 0x001C45
    [70]无符号字符6 '\x06' 0x001C46
    [71]无符号字符7 '\x07' 0x001C47
    [72]无符号字符8 '\x08' 0x001C48
    [73]无符号字符9 '\x09' 0x001C49
    [74]无符号字符16 '\x10' 0x001C4A
    [75]无符号字符17 '\x11' 0x001C4B
    [76]无符号字符18 '\x12' 0x001C4C
    [77]无符号字符19 '\X13' 0x001C4D
    [78]无符号字符20 '\x14' 0x001C4E
    [79]无符号字符21 '\x15' 0x001C4F
    [80]无符号字符22 '\X16' 0x001C50
    [81]无符号字符23 '\X17' 0x001C51
    [82]无符号字符24 '\x18' 0x001C52
    [83]无符号字符25 '\x19' 0x001C53
    [84] unsigned char 32'' 0x001C54
    [85]无符号字符33 '!' 0x001C55
    [86]无符号字符34 '' 0x001C56
    [87] unsigned char 35 '#' 0x001C57
    [88]无符号字符36 '$' 0x001C58
    [89] unsigned char 37 '%' 0x001C59
    [90] unsigned char 38 '&' 0x001C5A
    [91]无符号字符39 '' 0x001C5B
    [92] unsigned char 40 '(' 0x001C5C
    [93] unsigned char 41 ')' 0x001C5D
    [94]无符号字符48 '0' 0x001C5E
    [95]无符号字符49 "1" 0x001C5F
    [96]无符号字符50 '2' 0x001C60
    [97] unsigned char 51 '3' 0x001C61
    [98]无符号字符52 '4' 0x001C62
    [99] unsigned char 53 '5' 0x001C63
    [100... 101]
    [100] unsigned char 54 '6' 0x001C64
    [101]无符号字符55 '7' 0x001C65
     

    发送器发送100个数据包、其值范围为0x00到0x99。 而且、在 RxBuffer 上、十六进制值(表中的第4列)与原始数据不匹配。 我还会看到一些数据字节重复、一些数据字节丢失。 您能否建议一些有助于解决同步问题的方法? 或者、在第133行中为 Rx 使用断点是否会出现问题?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您可能不应在 LPM 行上断点、因为当时已经在运行。 我建议使用第146行(Strobe ())或第159行(在定时器停止后)。  

    对于 Rx 端、您注意到 ReceivePacket 启动时 Rx 已在运行、因此您实际上只能在之后捕获它。 (我认为这就是你所做的。)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢你。  在计时器停止后使用断点会有所帮助。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好  我有点卡在代码的另一部分。 我观察到 RxBuffer 在其数组索引值达到64之前正确接收字节、并跳过0x65到0x98的字节、然后接收0x99和0x100。 我不知道为什么会发生这种情况。   

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    奇怪的现象、您可能需要运行单步 诊断来诊断此问题。