0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

I'm trying to use an attenuator with a PIC32 microcontroller. Basic idea is that;

1) I enter attenuation value through computer

2) Computer sends information to PIC

3) PIC gives 8-bit output from its pins

4) Those pins connected to attenuator

5) Attenuator take input and operate x dB attenuation

I have a problem between the steps 3&4. PIC succesfully gives output. However, for only a specific pin(P3), there is a voltage loss when PIC and attenuator pins are connected. Except for P3 pin, attenuator works fine.

P3 succesfully gives 3.3V. But when connected to attenuator, I measure 1V. And attenutor does not take that 1V as "high" obviously.

Should I put some buffer between PIC and attenutor? I have no idea what is the problem.

Thanks in advance

edit: PIC32 datasheet & Attenuator datasheet

\$\endgroup\$
  • \$\begingroup\$ schematic and part numbers, why even bother to expect an answer without them? \$\endgroup\$ – Neil_UK Apr 7 '17 at 8:36
  • \$\begingroup\$ Neil mentioned a schematic and I reiterate what he said. \$\endgroup\$ – Andy aka Apr 7 '17 at 9:12
  • \$\begingroup\$ Without the schematic, there is no hope of an answer. I have a speculation (you do have the attenuator powered, right?). \$\endgroup\$ – Neil_UK Apr 7 '17 at 9:27
  • \$\begingroup\$ Further speculation, have you set the pin to be an output? A weak pullup might read OK on a meter, but that IC may take 1uA load. \$\endgroup\$ – Neil_UK Apr 7 '17 at 10:52
  • \$\begingroup\$ @Neil_UK I connected the attenuator with 5.5V power. Actually, as I mentioned above the attenuator works for P0,P1,P2,P4 pins. But does not work for P3 pin. Those pins are refer to digital values. For example; P4 P3 P2 P1 P0 For the value 16(P4=1) attenuator works fine. For the value 8(P3=1) attenuator DOES NOT give correct value. For the value 4(P2=1) attenuator works fine. For the value 2(P1=1) attenuator works fine. For the value 1(P0=1) attenuator works fine. \$\endgroup\$ – melimeli Apr 7 '17 at 11:00
0
\$\begingroup\$

For reference and to protect from possible future edits, here is the circuit as you show it:

There are a number of obvious problems:

  1. You have to provide power to both the PIC and the attenuator.

  2. Just giving each power isn't enough. The grounds have to be connected.

  3. The power voltages must be the same, or you have to be really sure that a high output from the PIC is enough for the attenuator to interpret it as high, but to still be within its maximum operating spec.

    The easiest would be to connect both chips to the same power supply, if there is a common voltage both can operate at.

  4. Each power pin should have its own bypass cap to ground, as physically close to the chip as reasonably possible.

  5. There are no such pins as Pn on PICs that I remember seeing. I haven't used the PIC32 family much, so maybe there is some special "P" function available in them. However, it looks like all you want are regular digital outputs. Those are called R<port><bit>, like "RB3", "RC7", etc.

    If you are using some peripheral, as apposed to just programmed output pins, you should explain what it is and what it does for you that plain output pins can't.

Update

I see you have edited the schematic to show separate 5.5 V power and common ground to each IC. That only addresses problems 1-3 above, not the rest.

This also causes new problems. In the datasheet, see section 29.0 Electrical Characteristics, subsection Absolute Maximum Ratings, third line, on page 151:

I can't even guess by what hallucination 5.5 V could possibly be acceptable.

Then in section 29.1 DC Characteristics, Table 29-1 Operating MIPs Vs Voltage, parameters DC5 and DC5b on page 152, it clearly shows:

So not only are you attempting to run the PIC well above its operating voltage, but also well above the voltage that can damage it.

Naturally anything the PIC does at this point can no longer be considered a surprise. Once absolute maximums are violated, all other promised made in the datasheet are null and void.

\$\endgroup\$
  • \$\begingroup\$ Thanks for your feedback. 1&2) I updated the schematic and 1&2 are ok now. 3) I'm already considering the attenuator's operating spec. If 2V<input pin value<5V, then it takes that value as "high". Otherwise, "low". My main problem is that the 3rd output pin of PIC gives 3.3V. I'm expecting that attenuator will consider that as "high" when I connect. However, the voltage drops to 1V when I connect PIC output and attenuator input. Thus, attenuator consider that as "low". This is the porblem. \$\endgroup\$ – melimeli Apr 7 '17 at 12:54
  • \$\begingroup\$ The PIC is embedded to a PCB. And the specifications of that PCB says that one shoud run the board at 5.5V. I'm pretty sure that I set the power supply to 5.5V and PIC runs at that voltage level well. \$\endgroup\$ – melimeli Apr 7 '17 at 13:00
  • \$\begingroup\$ A pic32 has no pin called P3, so we need to know what actual pin you have connected to (Something like RB3), not what the terminal on an unnamed board is called. \$\endgroup\$ – Dan Mills Apr 7 '17 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.