Analog switching by hardware (Section 4.10 of AN72382)

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

cross mob
dari_292216
Level 2
Level 2
First like received First like given

Section 4.10 of AN72382, Using PSoC® 3 and PSoC 5LP GPIO Pins" discusses how to use an external signal to gate the analog output on a GPIO pin.

I am trying to implement this following the same exact instructions (except that the gating signal is generated internally), but I can't seem to get this to work. 

I get a square wave of an appropriate frequency (dictated by my gating signal) but (a) when the gate is off the voltage is not 0V but something like 2V, and (b) changing the VDAC output does not change the signal at all. 

The discussion in the application note reads:

The signal from the DSI (red) is routed to the analog switches because the port bidirectional bit and the analog global select bit are set

(yellow). The VDAC output (blue) is switched on or off depending on the logic state of the Ext_Gate signal.

I did include:

// Set P0[0] to bidirectional mode

CY_SET_REG8(CYDEV_IO_PRT_PRT0_BIE, 0x01);

But is there anything else required to set the analog global select bit?

Anything else I may be doing wrong?

Thank you!

--

Dario

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Dario,

Attached is demo project showing VDAC output modulation by PWM. The Pin must be configured both for analog and digital output.

/odissey1

VDAC_modulator_1a.png

VDAC_modulator_1b.png

View solution in original post

2 Replies
dari_292216
Level 2
Level 2
First like received First like given

Actually, changing the DAC level changes the mean DC of the signal.

For DAC=128

IMG_3415.jpg

while for DAC = 255

IMG_3416.jpg

..but in none of them the signal is 0V when the gate=0.

--

Dario

0 Likes
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Dario,

Attached is demo project showing VDAC output modulation by PWM. The Pin must be configured both for analog and digital output.

/odissey1

VDAC_modulator_1a.png

VDAC_modulator_1b.png