你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

查看: 2733|回复: 3

STM32对AD9854的操作【悬赏问答】

[复制链接]

2

主题

8

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2012-8-13 23:11:53 | 显示全部楼层 |阅读模式
想通过STM32控制AD9854,产生一路正弦波和一路余弦波的程序。谢谢!
回复

使用道具 举报

5

主题

77

回帖

0

蝴蝶豆

新手上路

最后登录
2018-5-24
发表于 2012-8-14 18:24:38 | 显示全部楼层

回复:STM32对AD9854的操作【悬赏问答】

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
const uint16_t Sine12bit[32] = {2047, 2447, 2831, 3185, 3498, 3750, 3939, 4056, 4095, 4056,
                      3939, 3750, 3495, 3185, 2831, 2447, 2047, 1647, 1263, 909,
                      599, 344, 155, 38, 0, 38, 155, 344, 599, 909, 1263, 1647};
uint32_t DualSine12bit[32];
uint8_t Idx = 0;
/* Private function prototypes -----------------------------------------------*/
void RCC_Configuration(void);
void GPIO_Configuration(void);
void Delay(__IO uint32_t nCount);
/* Private functions ---------------------------------------------------------*/
/**
  * @brief  Main program.
  * @param  None
  * @retval : None
  */
int main(void)
{
  /* System Clocks Configuration */
  RCC_Configuration();  
  /* Once the DAC channel is enabled, the corresponding GPIO pin is automatically
     connected to the DAC converter. In order to avoid parasitic consumption,
     the GPIO pin should be configured in analog */
  GPIO_Configuration();
  /* TIM8 Configuration */
  /* Time base configuration */
  TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
  TIM_TimeBaseStructure.TIM_Period = 0x19;         
  TIM_TimeBaseStructure.TIM_Prescaler = 0x0;      
  TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;   
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; 
  TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure);
  /* TIM8 TRGO selection */
  TIM_SelectOutputTrigger(TIM8, TIM_TRGOSource_Update);
  /* DAC channel1 Configuration */
  DAC_InitStructure.DAC_Trigger = DAC_Trigger_T8_TRGO;
  DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;
  DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Disable;
  DAC_Init(DAC_Channel_1, &DAC_InitStructure);
  /* DAC channel2 Configuration */
  DAC_Init(DAC_Channel_2, &DAC_InitStructure);

  /* Fill Sine32bit table */
  for (Idx= 0; Idx
回复 支持 反对

使用道具 举报

24

主题

591

回帖

0

蝴蝶豆

中级会员

最后登录
2020-12-2
发表于 2012-8-14 20:23:20 | 显示全部楼层

RE:STM32对AD9854的操作【悬赏问答】

这个例程很多的啊。找找
回复 支持 反对

使用道具 举报

2

主题

8

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
 楼主| 发表于 2012-8-15 22:39:28 | 显示全部楼层

RE:STM32对AD9854的操作【悬赏问答】

谢谢
回复 支持 反对

使用道具 举报

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版