1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

[msp430] problem with digital input

Discussion in 'Microcontrollers' started by michal_w, Jan 5, 2012.

  1. michal_w

    michal_w New Member

    Joined:
    Aug 9, 2011
    Messages:
    22
    Likes:
    0
    Location:
    Poland
    Hello,
    I have to measure sine wave (voltage between 0 and 2.5 V) using analog-ditigal converter. The measurement should be synchronized with the transition by zero (square wave 0 and 3.3 V detected by digital input/output - more here).
    I'm using uC MSP430F149 - sine wave is connected to ADC input (P6.0) and square wave to Port 1 (P1.0).
    Every single circuit works perfectly well, but the proglem occurs when I connect both circuits in the same time - P1.0 input is always in high state.
    It seems the sine wave is added to square wave.
    Could anyone tell me what should be done to make my circuit working?

    Thanks in advance - Michal.
     
  2. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,246
    Likes:
    1,218
    Location:
    Cardiff, Wales
    Have you double-checked that the input pins are correctly configured for digital/analog as appropriate?
     
  3. michal_w

    michal_w New Member

    Joined:
    Aug 9, 2011
    Messages:
    22
    Likes:
    0
    Location:
    Poland
    Pin configuration:

    P1 (square wave input)
    P1DIR = 0 (input)
    P1SEL = 0 (digital i/o)

    P6 (ADC):
    P6DIR = 0 (input)
    P6SEL = 1 (peripheral module)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,246
    Likes:
    1,218
    Location:
    Cardiff, Wales

    That looks right. So maybe the impedance between the two inputs is low at the frequency being used. What is the frequency? Is the circuit built on a custom pcb, or a breadboard, or....?
     
  6. michal_w

    michal_w New Member

    Joined:
    Aug 9, 2011
    Messages:
    22
    Likes:
    0
    Location:
    Poland
    The frequency is 50Hz. PCB with MSP430 is a development board made by scientific group.
    Schemes are in attachements.
     

    Attached Files:

  7. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,246
    Likes:
    1,218
    Location:
    Cardiff, Wales
    Signal breakthrough at 50Hz is unlikely to be a problem, then, if the pcb has been properly designed and populated. I've run out of ideas. Perhaps someone else has some insight?
     
  8. michal_w

    michal_w New Member

    Joined:
    Aug 9, 2011
    Messages:
    22
    Likes:
    0
    Location:
    Poland
    Hello,
    it turns that I incorrect pins was connected to MSP. I've fixed thatbug and now it works.
    Thanks for trying to help and sorry for unnecessary thread.

    Michal
     

Share This Page