problem RB4-7 on a 18F876A


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The problem is certainely the internal pull-ups. too weak to be good. try lower value let's say 1K.

    BTW it's always agood practice to pca something betwen a PIC and the exterior world if you plan to use long distance cables. Opto coupler are still a good choice.

    RB6:rB7 are still programming pins... look at the programming sequence of your pic... it make me think it could be something around it or not.

    How about your MCLR pin?

    How about the whole setup.

    Bad ground screening, bad proto-board may give you some serious headache... worst @20MHZ. You may try to remove (for testing purpose only) those capacitor around your crystal.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Knowing your entire setup would help

    Hi,

    Internal pull ups are weak as stated and Steve is again damn right. Optocontrollers do help but then you need an additional power line light the LEDs. PCB layout is equally important. If you post your whole code then we can find out if it is an interrupt issue. Normally a PIC would reset if it freezes, (WDT) so an improper code may put your PIC in endless loop especially interrupts. If you do not have an ICD then it is possible to dump some values of the SFRs related to PIC power, stack etc,. This would ease diagonisis what went wrong and where.
    Regards

    Sougata

  3. #3
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    hello steve and sougata

    thanks for your hints.

    i plan to change this three inputs (b5,b6,b7) to change to a2,a3,a5 and renew to code from the interrupt handler to a subroutine.
    on the build in board which makes some troubles, the long connection is on b5. b6 and b7 are in the device so about 10cm long.
    i will make a separate regulator from 12v to 5v from the same power supply to source a relais. sink them with the long cable outside to ground. this ground is also the internal gnd from the circuit. did you think this is a problem? the relais contact then switch in the device the input a5.

    the mclr pin is set with 1k to 5v.

    the setup is on a proto-board...

    in the actual test circuit i also add a debug_off, with no success.
    interesting is that when the pic seems frozen and i read back the codes with melabs serial programmer, the code starts again normal when it is finished...

    cheers
    i know it's only microcontrolling, but i like it!

  4. #4
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Then you loose interrupts too

    Hi,

    If you change from PORTB to PORTA you will be loosing interrupts. So might limit the functionality of your system. Why not revise the pull-ups have a clean PS proper freewheeling diodes for the relays and so on
    Regards

    Sougata

  5. #5
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default sorry, don't unterstand...

    Why not revise the pull-ups have a clean PS proper freewheeling diodes for the relays and so on
    what means this? external pull ups and then ... power supply something...?

    sorry, my english is not so fine ;-)
    i know it's only microcontrolling, but i like it!

Similar Threads

  1. Thermo 7 segments - little problem
    By fratello in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 27th July 2013, 07:31
  2. Windows 7 64 bit problem..can anyone help???
    By ljc4141 in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 18th July 2011, 15:29
  3. problem with sending data using RF module
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 51
    Last Post: - 10th April 2008, 17:08
  4. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  5. 7 segment digit problem (using Mister E's code)
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2005, 20:25

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts