gnupic: Problems with '873 chip.


Previous by date: 9 Jun 2001 06:29:24 -0000 PIC and DRAM, daniel sheltraw
Next by date: 9 Jun 2001 06:29:24 -0000 Re: Problems with '873 chip., Byron A Jeff
Previous in thread:
Next in thread: 9 Jun 2001 06:29:24 -0000 Re: Problems with '873 chip., Byron A Jeff

Subject: Problems with '873 chip.
From: ####@####.#### (Rogier Wolff)
Date: 9 Jun 2001 06:29:24 -0000
Message-Id: <200106090629.IAA11822@cave.bitwizard.nl>

Hi,

I have a project with a pic16F873 chip. I can't get the chip to do
anything but sit there: We have a couple of leds, and turning the
pins into outputs, and making the leds go on, doesn't work. 

Here is the c2c source file: 

----------------------------------------------------

//Timing settings
#pragma CLOCK_FREQ 4000000

main()
{
    char i;
    char n = 250;

    disable_interrupt(GIE);
    set_bit(STATUS, RP0);
    set_tris_c(0xc0);
    clear_bit(STATUS, RP0);
    output_port_a(0x00);
    output_port_b(0x00);

    while(1) {
      delay_ms (n);
      output_port_c(0x80);
      delay_ms (n);
      output_port_c(0xc0);
      delay_ms (n);
      output_port_c(0x40);
      delay_ms (n);
      output_port_c(0x00);
    }  
}


--------------------------------------------------------

From there on, I tack on the header:


        LIST P=16F873           ;  tells which processor is used
        INCLUDE "p16f873.inc"   ;  defines various registers etc. Look
        ERRORLEVEL -224        ;  supress annoying message from tris
;        __CONFIG _PWRTE_ON & _XT_OSC & _WDT_OFF   ;  config. switches
	
	__CONFIG(_CP_OFF & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _LVP_OFF & _BODEN_ON & _PWRTE_ON & _WDT_OFF & _XT_OSC);

and use  "gpasm" to assemble it. 

Then I use picprg-2.2 to program it into the PIC. 


This toolset seems to work for the PIC16F84, but for the '873 it
doesn't: The chip doesn't come into action. 

We've verified the clock, and we've explicitly given it an extra
(manual) "MCLR". The 5V looks good. 

Does anybody have experience with the '873? Is there something stupid
that I'm doing wrong? Other stuff to check?

					Roger. 

-- 
** ####@####.#### ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 

Previous by date: 9 Jun 2001 06:29:24 -0000 PIC and DRAM, daniel sheltraw
Next by date: 9 Jun 2001 06:29:24 -0000 Re: Problems with '873 chip., Byron A Jeff
Previous in thread:
Next in thread: 9 Jun 2001 06:29:24 -0000 Re: Problems with '873 chip., Byron A Jeff


Powered by ezmlm-browse 0.20.