请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
部件号:DAC8563 你好! 我在 STM32H743上测试了 DAC8563,但它不起作用(在 A 和 B 通道上为0V)...
所以我尝试了 Arduino UNO,结果还可以。
以前,我使用了不同的 STM MCU,没有问题(F4,F7)。
这是 STM SPI 初始化代码:
void MX_SPI1_Init(void) { hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_2LINES; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_2EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_128; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 0x0; hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; hspi1.Init.NSSPolarity = SPI_NSS_POLARITY_LOW; hspi1.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA; hspi1.Init.TxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN; hspi1.Init.RxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN; hspi1.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_01CYCLE; hspi1.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_02CYCLE; hspi1.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_ENABLE; hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_DISABLE; hspi1.Init.IOSwap = SPI_IO_SWAP_DISABLE; if (HAL_SPI_Init(&hspi1) != HAL_OK) { Error_Handler(); } }
将信号分析仪连接到 H7并发送 init 命令后,我曾:
//... HAL_GPIO_WritePin(SYNC_DAC8563_GPIO_Port, SYNC_DAC8563_Pin, GPIO_PIN_SET); dac_reg_write(0x28, 0x0001); //reset DAC dac_reg_write(0x20, 0x0003); //power_up DAC dac_reg_write(0x38, 0x0001); //internal ref dac_reg_write(0x02, 0x0000);//gain a x 2, b x 2 dac_reg_write(0x30, 0x0003); //deactivate load trigger //...
我检查了电源电压水平,一切似乎都正常...
有人可以帮帮我吗?
非常感谢,致以诚挚的问候,
马里奥