Skip to main content
MDeva.1
Associate III
October 23, 2021
Question

How implemented the code where user can provide the file in csv format to DAC for different output waveforms

  • October 23, 2021
  • 2 replies
  • 1083 views

Hello,

I am working on Nucleo-h745ziq board, I interface the AD9106 sensor. I have to generate the different output waveforms for this I have to use the CSV file. How the CSV file is import in stm32cubeide.How I can read the CSV file. Can you help me?

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
October 23, 2021

Write a small C application (Python script, or whatever kids use these days to quickly code a solution) on your host PC to read and parse the .CSV file, and have it output a .C file or .H file with the numeric content expressed as a C array variable. Say uint16_t DacData[] = { .... , ... };

Add this file to your project , and have the code use DacData and sizeof(DacData) / sizeof(uint16_t) to reference the data you've imported.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
MM..1
Chief III
October 24, 2021

You need define if CSV is used in runtime or buildtime. Buildtime explain Tesla

Runtime is on your board Ethernet ,USB or other way to load CSV..., but here you need write something about CSV, because here can be samples, but for examplke too

SINE,10k,2sec

RECT,2k,3sec

... is too CSV