CyHalt

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
mlaliwala
Level 1
Level 1
First question asked Welcome!

I am using internal DAC in my program.  I have set my DAC to 12 bit value.  However, when I send DAC value over decimal 1038.  My code goes to CyHalt reason 0.  I am not sure why.  Can someone help me how to resolve this issue.

mlaliwala_0-1631298277020.png

mlaliwala_1-1631298308854.png

Here is my DAC.  I needed output to double, so I place a gain of 2 amplifier.  Below is the set up for my DAC.

 

mlaliwala_2-1631298373180.png

 

 

 

 

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

mlalwala,

The issue with the CyHalt is that you were pushing 1038 into DVDAC_2 which is configured as 10-bit with a maximum of 1020 for 10 bits. 

A CYASSERT at line 213 in the DVDAC_2_SetValue() occurs because 1038 > 1020.   This throws the CyHalt().

    CYASSERT(value <= DVDAC_2_DVDAC_MAX_VALUE);

DVDAC_1 is 12-bit.  But it can be seen in the "Call Stack" that DVDAC_2_SetValue is called just before the CyHalt.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
1 Reply
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

mlalwala,

The issue with the CyHalt is that you were pushing 1038 into DVDAC_2 which is configured as 10-bit with a maximum of 1020 for 10 bits. 

A CYASSERT at line 213 in the DVDAC_2_SetValue() occurs because 1038 > 1020.   This throws the CyHalt().

    CYASSERT(value <= DVDAC_2_DVDAC_MAX_VALUE);

DVDAC_1 is 12-bit.  But it can be seen in the "Call Stack" that DVDAC_2_SetValue is called just before the CyHalt.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes