ASR6505调试记录

问题1 驱动LCD 导致射频无法发送数据

LCD_SEG14 对应 stm8 的 SEG18 PD4

LCD_SEG15 对应 stm8 的 SEG18 PD5

ASR6505 ---> stm8L

NSS ---> PD7

虽然LCD_SEG14 和 LCD_SEG15 未使用,调试时全部初始化了

初始化 LCD时

LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x3F); //SEG16-21

导致影响了 NSS 脚使用,从而数据无法发送

修改为

LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x03); //SEG16-21

解决

问题2:

官方IO中断中 将  RtcRecoverMcuStatus( );  写在 

void HAL_GPIO_EXTI_IRQHandler(EXTI_IT_TypeDef EXTI_IT)
{

#if !defined( USE_NO_TIMER )
    RtcRecoverMcuStatus( );
#endif 
    if (EXTI_GetITStatus(EXTI_IT) != RESET) 
    {

      // printf("14-%d\r\n", EXTI_IT);
        //clear the it status first, otherwise when do call RadioIrqProcess when it enableinterrupts() it will re-enter into the interrupt handler
        EXTI_ClearITPendingBit(EXTI_IT);
        HAL_GPIO_EXTI_Callback(EXTI_IT);
    }
}

中断中 

stm8 IO中断存在一个问题,循环进入中断,即使及时清除中断仍会进入

导致 SPI多次初始化,但是又初始化失败

解决办法:将mcu唤醒提取到中断中

void HAL_GPIO4_EXTI_IRQHandler(EXTI_IT_TypeDef EXTI_IT)
{


    if (EXTI_GetITStatus(EXTI_IT) != RESET) 
    {

      // printf("14-%d\r\n", EXTI_IT);
        //clear the it status first, otherwise when do call RadioIrqProcess when it enableinterrupts() it will re-enter into the interrupt handler
        EXTI_ClearITPendingBit(EXTI_IT);
        HAL_GPIO_EXTI_Callback(EXTI_IT);
    }
}

中断回调:

 void GPIO4_exit()
{
#if !defined( USE_NO_TIMER )
    RtcRecoverMcuStatus( );
#endif 
  printf("GPIO4_exit\r\n");
  btn_wakeUp();
   GpioRemoveInterrupt(&Gpio4);
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值