Beginner using an EB013 board

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Aidan_OSullivan
Posts: 13
Joined: Wed Jun 05, 2019 9:57 am
Has thanked: 7 times
Been thanked: 2 times
Contact:

Beginner using an EB013 board

Post by Aidan_OSullivan »

I have recently began trying to learn how to write to a DAC on the EB013 board from a BL0032 kit. Is it possible to produce an simple (say 1V) analogue signal using this component alone or does it have to be used with the DSP output component. If so could anybody provide instructions on this?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Beginner using an EB013 board

Post by Benj »

Hello,

The DAC can generate an output voltage by itself, no DSP boards or components are required.

The DAC output voltage might have a very limited current and so if you need to drive anything requiring current then you may need some sort of buffer, maybe using an OpAmp? The EB013 may have an amplifier built onto the board, it's been a while since I looked at this.

Aidan_OSullivan
Posts: 13
Joined: Wed Jun 05, 2019 9:57 am
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Beginner using an EB013 board

Post by Aidan_OSullivan »

Hi Ben,
thanks for your reply. The only example I have been able to find in relation to using a DAC is the DSP audio solution program 1. This exercise uses more complicated components such as buffers. As I am a beginner I just want to be able to write to a DAC from the MCU in the BL0032 kit and produce an output voltage but I am unsure how to do this (which component macros to use and what ports to assign), I have gathered that using channel 2 on EB013 makes it simpler to use. Is there any help for this to allow me to figure out the basics?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Beginner using an EB013 board

Post by Benj »

Here's an example to drive the DAC using the SPI Master component from the Hardware - E-blocks 1 component category. It has specific macros to drive the various features of the EB013 E-block.
EB013_DAC.fcfx
(8.26 KiB) Downloaded 183 times
You'll need to configure the Pin connection properties to match your hardware.

Let us know how you get on.

Aidan_OSullivan
Posts: 13
Joined: Wed Jun 05, 2019 9:57 am
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Beginner using an EB013 board

Post by Aidan_OSullivan »

That attachment was very helpful and made many of my questions clear. I added an LED screen to allow me to see the voltage, to ensure the program was working which can be seen in the attached file. It wasn't displaying the voltage however. I'm not sure is that a problem with the LED screen or is due to the connections from EB013 to the MCU. I connected it to channel 2 and the 'DAC EN' and 'NVM EN' are connected to port C. Is there an issue with those connections?
EB013_project.fcfx
(20.92 KiB) Downloaded 176 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Beginner using an EB013 board

Post by Benj »

Hello,

Try this one, the readback of the DAC voltage wasn't done correctly and I'm not sure this is possible so I just use the RAM value instead.
EB013_project.fcfx
(20.57 KiB) Downloaded 183 times

Aidan_OSullivan
Posts: 13
Joined: Wed Jun 05, 2019 9:57 am
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Beginner using an EB013 board

Post by Aidan_OSullivan »

That works, thanks very much for your assistance Ben!

Aidan_OSullivan
Posts: 13
Joined: Wed Jun 05, 2019 9:57 am
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Beginner using an EB013 board

Post by Aidan_OSullivan »

The program worked with the simulator and performed the desired function. When attempting to compile the program to the hardware (BL0011& EB013) I am experiencing problems.
Attachments
Working_DAC.fcfx
(19.72 KiB) Downloaded 168 times
Error list.jpg
Error list.jpg (110.54 KiB) Viewed 4497 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Beginner using an EB013 board

Post by Benj »

Thanks for letting us know.

I have now fixed the problem and uploaded the fix to the Flowcode 8 update system. Use the Help -> Check for updates menu to get the updated SPI_Legacy component.

Aidan_OSullivan
Posts: 13
Joined: Wed Jun 05, 2019 9:57 am
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Beginner using an EB013 board

Post by Aidan_OSullivan »

When I run my program and measure the voltage across the output of the DAC it is coming up as 0V. I think this may be due to the pins that the SPI is assigned to in properties. I have been following the schematic and trying to connect it to appropriate pins on port C. Can you see an issue with how it's connected?
Attachments
Working_DAC.fcfx
(20.1 KiB) Downloaded 163 times

Post Reply