16f877a porta.5 resets chip


Results 1 to 7 of 7

Threaded View

  1. #3


    Did you find this post helpful? Yes | No

    Default

    interupt jump into a none interupt routine?
    Are you using interupts?
    Have you tried disabling all interupts?

    RA5 is used for...
    Digital I/O.
    Analog input 4.
    SPI slave select input.
    Comparator 2 output

    ok, are you using SPI?
    are you doing anything with comparator 2?
    do you have RA5 set to digital?

    Have you tried moving the RA5 input to another pin?

    This is my chunk of code to setup analogue ports and disable interupts, Perhaps it will help...

    Code:
    ' Setup chip
    ADCON0.6 = 1					' ADC clock set to Fosc/64
    ADCON0.7 = 1					' ADC clock set to Fosc/64
    ADCON1.6 = 0					' ADC clock set to Fosc/64
    INTCON = 0						' Disable all interupts
    TRISE = %00000111				' Set PortE to all inputs
    TRISD = %00000000				' Set PortD to all outputs
    TRISC = %00000000				' Set PortC to all outputs
    TRISB = %00000000				' Set PortB to all outputs
    TRISA = %11111111	 			' Set PORTA to all input
    ADCON1 = 0 					' PORTA is analog
    Consulting 877A's idiots guide now...
    Code:
    Address Name     Bit 7    Bit 6    Bit 5  Bit 4  Bit 3    Bit 2       Bit 1    Bit 0 
    1Fh       ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0   GO/DONE —       ADON 
    9Fh       ADCON1 ADFM  ADCS2  —     —      PCFG3 PCFG2     PCFG1 PCFG0
    so ADCON1 = 7 means...
    PCFG0 = 1
    PCFG1 = 1
    PCFG2 = 1
    PCFG3 = 0

    Acording to the datasheet, the value your sending ADCON1 00000111 is sortof invalid...
    The closest match to it is 0000011x where x is "unknown". The purpose of this value is to set port A to all digital...

    Try adding
    Code:
    TRISA = %00000000
    After your ADCON's. This will make port A all digital outputs and will correct any possible miss-configurations...

    Info found on search
    Note: When using the SSP module in SPI Slave mode and SS enabled, the A/D converter must be set to one of
    the following modes, where PCFG3:PCFG0 = 0100, 0101, 011x, 1101, 1110, 1111.
    Found a 'conflict' with PSP port and PCFG0:PCFG2 registers
    Last edited by comwarrior; - 30th September 2009 at 01:31.

Similar Threads

  1. servo motor resets 16f877a
    By burak450 in forum mel PIC BASIC Pro
    Replies: 85
    Last Post: - 19th October 2008, 22:25
  2. TV Display Chip
    By zadok in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 17th April 2008, 22:17
  3. Replies: 32
    Last Post: - 23rd March 2007, 04:01
  4. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  5. chip selection aid
    By PICMAN in forum General
    Replies: 4
    Last Post: - 21st February 2005, 18:33

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