gnupic: Problems with '873 chip.
Subject:
Re: Problems with '873 chip.
From:
####@####.#### (Rogier Wolff)
Date:
11 Jun 2001 16:22:25 -0000
Message-Id: <200106111622.SAA21394@cave.bitwizard.nl>
Hi,
Update: It seems that it's not getting the stuff into the chip: I can
turn the power off, and load the program form the chip, and it's
bit-for-bit identical to what we programmed into it.
Is there someone who can write/compile/assemble me a program
that just turns on a few outputs in port B or C? Something like:
main()
{
disable_interrupt(GIE);
set_bit(STATUS, RP0);
set_tris_c(0x00);
clear_bit(STATUS, RP0);
output_port_c(255);
while (1);
}
Thanks,
Roger.
Rogier Wolff wrote:
>
> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
>
--
** ####@####.#### ** 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.