问答

汇集网友智慧,解决技术难题

4c1l

TA的家园币:941  

  • 求教CAN的字节序问题

    CAN的扩展帧ID和数据帧都要进行大小端的转换吗?如帧ID是0x12345678是不是要转成0x78563412那么8位帧数据呢?如0123456789ABCDEF是不是要转成EFCDAB8967452301求指教?

    ID CAN AN 国产芯片 ST 单片机

    2024-07-08 9
  • GD32303CEVAL的SD卡驱动无法再Freertos中正常使用

    在粿机中使用sd_block_read/sd_block_write读写正常下图是进入rtos前的粿机程序进入rtos后读写时产生错误,产生两种错误1是SD_CMD_RESP_TIMEOUT,这个错误在写的时候产生,二是SD_COM_CRC_ERROR,这个错误在读的时候产生,rtos中也不是完全无法读写,有小概率可以正常读写在手册中我找到下面内容这是程序检测错误时的依据,是sd卡响应相关的寄存器r1。检测到使用CMD16时产生命令响应超时错误

  • GD32F305VG timer0输入捕获无反应

    各位大佬好!我按照GD32F30x的标准库配置了GD32F305VG的timer0定时器并开启了输入捕获功能,配置代码如下:voidtimer_config(void){/*-----------------------------------------------------------------------timer_parameter_structtimer_initpara;timer_ic_parameter_structtimer_icinitpara;rcu_periph_clock_enable(RCU_TIMER0);timer_deinit(TIMER0);/*NVICconfig*/nvic_irq_enable(TIMER0_UP_TIMER9_IRQn,1,1);nvic_irq_enable(TIMER0_Channel_IRQn,1,0);/*TIMER0configuration*/timer_initpara.prescaler=119;timer_initpara.alignedmode=TIMER_COUNTER_EDGE;timer_initpara.counterdirection=TIMER_COUNTER_UP;timer_initpara.period=999;timer_initpara.clockdivision=TIMER_CKDIV_DIV1;timer_initpara.repetitioncounter=0;timer_init(TIMER0,&timer_initpara);timer_icinitpara.icpolarity=TIMER_IC_POLARITY_RISING;timer_icinitpara.icselection=TIMER_IC_SELECTION_DIRECTTI;timer_icinitpara.icprescaler=TIMER_IC_PSC_DIV1;timer_icinitpara.icfilter=0x0;timer_input_capture_config(TIMER0,TIMER_CH_0,&timer_icinitpara);timer_input_capture_config(TIMER0,TIMER_CH_3,&timer_icinitpara);/*auto-reloadpreloadenable*/timer_auto_reload_shadow_enable(TIMER0);timer_interrupt_flag_clear(TIMER0,TIMER_INT_FLAG_CH0);timer_interrupt_flag_clear(TIMER0,TIMER_INT_FLAG_CH3);timer_interrupt_enable(TIMER0,TIMER_INT_CH0);timer_interrupt_enable(TIMER0,TIMER_INT_CH3);timer_interrupt_enable(TIMER0,TIMER_INT_UP);timer_enable(TIMER0);}/*中断服务程序*/voidTIMER0_UP_TIMER9_IRQHandler(void){if(timer_interrupt_flag_get(TIMER0,TIMER_INT_FLAG_UP)!=RESET){timer_interrupt_flag_clear(TIMER0,TIMER_INT_FLAG_UP);timer0tick++;}}voidTIMER0_Channel_IRQHandler(){if(timer_interrupt