RA6M4 Group Scan Mode ADC issue

请教下,Group Scan Mode的ADC,配置Group A为Sotfware 触发,Group B为IRQ0 ELC或Timer overflow ELC触发,结果Group A触发了,但Group B无论是配置成IRQ还是Timer overflow都没触发。这个配置是否有问题?或者Group Scan Mode的初始化还需要调用哪个API?

  • 你好,可以直接把调试的Project贴上来吗?我在本地复现一下,谢谢

  • RA6M4_test.zip请参考ADC1和IRQ0部分,该测试程序是基于RA6M4 promotion board上的

  • 尝试在RA6M4_test.zip调试时,irq_callback()函数中增加断点,按下板上的S1按钮时,代码并没有停在callback中,代码运行状态不对,停下来时ICU相关寄存器配置不对,而且代码停在时钟检查上,硬件并没有焊接X1 (24MHz晶振)

    请按照附件的操作说明和BSP进行更新,改为下图所示

     FSP310_Import_Guide.zip

  • 我这边代码可以正常进入irq_callback,callback里面可以正常操作LED亮灭。我手上的板子是promotion board(YCB20RA144LQFPTGB0621),板上的X1有24MHz的晶振

  • adc_gpt_periodic_sampling_ek_ra6m4_ep.zip

    你好,请参考附件的例子中的配置,如果把g_adc1 > Interrupts > Normal/Group A Trigger选择为GPT0 Counter Overflow,则在adc1_callback() --> case ADC_EVENT_SCAN_COMPLETE_GROUP_B增加断点可以停下来

    之前的代码是否因为ADC1尚未启动呢?

  • 代码一直可以进入ADC_EVENT_SCAN_COMPLETE,ADC1应该是启动了,但是进不了ADC_EVENT_SCAN_COMPLETE_GROUP_B

  • RA6M4_Demo_OK.zip

    试着改了一下之前的代码,附件可以停在ADC_EVENT_SCAN_COMPLETE_GROUP_B对应的断点上,你可以试一下这个代码吗?

  • 手册中有如下描述,对于Group Scan Mode,触发源不能选择Software

    40.3.4.1 Basic operation
    In group scan mode, A/D conversion is performed once on the analog input of all the specified channels in group A and B after scanning is started by a synchronous trigger (ELC). The scan operation of each group is similar to the scan operation in single scan mode.
    The synchronous triggers can be selected in the ADSTRGR.TRSA[5:0] bits for group A and in the ADSTRGR.TRSB[5:0] bits for group B. Use different triggers for group A and B to prevent simultaneous A/D conversion of the two groups. Do not use a software trigger.