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

PSoC™ 5, 3 & 1 Forum Discussions

KrJo_1049446
Level 2
Level 2
First like received First like given
        I've been messing around with the ScanComp component, and it works great except I can't figure out how to connect a single analog input pin to the input mux. (I know I could just use a regular Comp and Mux, but then my main.c will be more than a single line). I tried just jumpering all the inputs together in the schematic, but that didn't work. I tried using an Analog Hardware Mux set to switch mode with a digital constant attached to connect all the outputs, but that didn't work, either. I tried putting a "net tie" between the muxes, but still no bueno. I ended up using a separate GPIO for each input and just jumpering them all together externally, and it worked like a charm. (I'm using the internal VDAC as the reference, but setting a different value for each input [via the component GUI]). It doesn't seem like there is any physical reason the input mux can't use a single pin as input, but it just doesn't recognize a connection to an analog mux as valid. Is there a way to do this so I don't have to waste a bunch of GPIOs just to keep the schematic design simple? Thanks!   
0 Likes
1 Solution
KrJo_1049446
Level 2
Level 2
First like received First like given



Of course after all this I find basically the same project for PSoC4 in the 100 days thing at element14:

   

http://www.element14.com/community/message/88850/l/psoc-4-pioneer-kit-community-project093-4-channel...

Since PSoC4 doesn't have a VDAC they run the IDAC output to external resistors that generate the reference voltage for the Scan_Comp. I'm not sure why they used 4 different resistors and a mux instead of using just 1 and changing the IDAC value.
(Probably because it's cooler to do it all in hardware).
I'll probably change mine to use this method, since I was planning on modifying it for PSoC4 at a later time, anyway.
I'll only be saving 1 pin on the PSoC4 version, but I can add more steps to the reference voltage without adding any pins.
(The PSoC5LP will only need 1 external input!)
 

View solution in original post

0 Likes
4 Replies
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

You mean this, it compiled fine w/o error.

   

 

   

Regards, Dana.

0 Likes

Nope, I mean all the pins on the positive input mux going to a single GPIO.

   

This is what I have that works:

   

0 Likes
KrJo_1049446
Level 2
Level 2
First like received First like given

Here's some stuff I tried that *didn't* work.

   

1. I tried just using wire ties to jumper the other inputs to the first GPIO. I got this error:

   

"The digital input of pin "Pin_1(0)" is occupied. This pin is connected to an AMuxHW component, which indicates its digital input is expected to be controlled by the only matching hardware control signal on the AMuxHW component."

   

2. I tried using a hardware analog switch with a digital constant attached so all 4 lines connect to the GPIO. I got these two errors for each of the 4 lines:

   


Signal "Net_###" is expected to connect to only one GPIO analog pin but instead it connects to "\ScanComp_1:ScanCompAMuxSingle\". Please fix the connection.
Signal "Net_###" is expected to connect to only one GPIO analog pin but instead it connects to "AMuxHw_1". Please fix the connection.

0 Likes
KrJo_1049446
Level 2
Level 2
First like received First like given



Of course after all this I find basically the same project for PSoC4 in the 100 days thing at element14:

   

http://www.element14.com/community/message/88850/l/psoc-4-pioneer-kit-community-project093-4-channel...

Since PSoC4 doesn't have a VDAC they run the IDAC output to external resistors that generate the reference voltage for the Scan_Comp. I'm not sure why they used 4 different resistors and a mux instead of using just 1 and changing the IDAC value.
(Probably because it's cooler to do it all in hardware).
I'll probably change mine to use this method, since I was planning on modifying it for PSoC4 at a later time, anyway.
I'll only be saving 1 pin on the PSoC4 version, but I can add more steps to the reference voltage without adding any pins.
(The PSoC5LP will only need 1 external input!)
 

0 Likes