Difference between revisions of "CH32V307"

From Stm32World Wiki
Jump to navigation Jump to search
Line 8: Line 8:
 
* [http://wch-ic.com/downloads/file/262.html?time=2022-06-08%2000:02:47&code=WzZMnejfNpLPWjULTKIJgnHgBBt3toKKi1ZTdFxZ CH549 Datasheet]
 
* [http://wch-ic.com/downloads/file/262.html?time=2022-06-08%2000:02:47&code=WzZMnejfNpLPWjULTKIJgnHgBBt3toKKi1ZTdFxZ CH549 Datasheet]
 
* [https://github.com/openwch?tab=repositories OpenWCH]
 
* [https://github.com/openwch?tab=repositories OpenWCH]
 +
 +
== Notes ==
 +
=== DAC ===
 +
 +
* The output impedance is a concern. Without the Output Buffer enabled, >100kohm impedance for the load is recommended. Even WITH Output Buffer enabled, a 1kohm load is not really possible, both high and low end of range is not reached, which is a bit strange. 10kohm hasn't been tested yet.
 +
 +
* For fastest write to DAC output, this is used;
 +
<nowiki>
 +
DAC->RD12BDHR = dac_value1 + (dac_value2 << 16);
 +
</nowiki>
 +
 +
* Simple initialization is;
 +
<nowiki>
 +
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE );
 +
 +
    DAC_InitTypeDef DAC_InitType={0};
 +
    DAC_InitType.DAC_Trigger=DAC_Trigger_None;
 +
    DAC_InitType.DAC_WaveGeneration=DAC_WaveGeneration_None;
 +
    DAC_InitType.DAC_OutputBuffer=DAC_OutputBuffer_Enable;
 +
    DAC_Init(DAC_Channel_1,&DAC_InitType);
 +
    DAC_Init(DAC_Channel_2,&DAC_InitType);
 +
 +
    DAC_Cmd(DAC_Channel_1, ENABLE);
 +
    DAC_Cmd(DAC_Channel_2, ENABLE);
 +
</nowiki>

Revision as of 20:24, 2 July 2022


Miscellaneous Links

Notes

DAC

  • The output impedance is a concern. Without the Output Buffer enabled, >100kohm impedance for the load is recommended. Even WITH Output Buffer enabled, a 1kohm load is not really possible, both high and low end of range is not reached, which is a bit strange. 10kohm hasn't been tested yet.
  • For fastest write to DAC output, this is used;
DAC->RD12BDHR = dac_value1 + (dac_value2 << 16);

  • Simple initialization is;
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE );

    DAC_InitTypeDef DAC_InitType={0};
    DAC_InitType.DAC_Trigger=DAC_Trigger_None;
    DAC_InitType.DAC_WaveGeneration=DAC_WaveGeneration_None;
    DAC_InitType.DAC_OutputBuffer=DAC_OutputBuffer_Enable;
    DAC_Init(DAC_Channel_1,&DAC_InitType);
    DAC_Init(DAC_Channel_2,&DAC_InitType);

    DAC_Cmd(DAC_Channel_1, ENABLE);
    DAC_Cmd(DAC_Channel_2, ENABLE);