Connect with us

wierd problem with PIC18F, advice needed

Discussion in 'General Electronics' started by Alexandre Bezroutchko, Sep 12, 2004.

Scroll to continue with content
  1. Hello,

    I am facing a wierd problem and already spend two days
    trying to solve it. Please help.

    My curcuit is based on PIC18F458 MCU. Something went
    wrong when I started experimenting with driving a DC motor
    with PWM and since then the schematics works only if I
    physically touch some conductor, i.e. ground. When I touch it,
    the MCU resets and starts working, when I remove my finger
    it stops working immediately.

    Currently the schematics consists of following:

    MCU PIC18F458
    Quartz 20MHz and two capacitors
    RS232 tranceiver AD202EAN (with appropriate capacitors)
    Reset (pin 1) tied directly to Vdd
    4.5V from battery are feed to Vdd and Vss on both sides of the MCU

    Firmware: Tiny Bootloader 1.63, ex_admm.c (from CCS suite).

    In attempt to localize the problem I have changed virtually
    everything: MCU (tried 18F452), quartz (20, 8, 4.43MHz), a
    breadboard, battery instead of proper bench power suppy,
    disconnect a RS232 tranceiver... Same difference.

    Some observations:

    With a scope I can see all DC voltages reach the MCU at correctly.
    At MCU TX pin I see 50 Hz square wave (the MCU starts, but gets
    reset from 50 Hz noise???). If I ground the MCLR pin, TX pin goes down.
    If I touch any pin of the MCU, TX pin goes up and I can see proper
    RS232 activity.

    Any advice is highly appreciated. Please help.

  2. Bob Weiss

    Bob Weiss Guest

    Do you have any capacitors between ground and Vdd near the MCU?
    Possible noise on the power line? Is the Brown Out circuit enabled?
    Try disabling it..
  3. Hello Bob,

    Yes I tried to put a decoupling capacitor... Not sure about brown-out..

    Anyway the problem is solved. I have soldered everything on a PCB
    instead of using a breadboard and it works well now.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day