gnupic: Thread: PIC16F628


[<<] [<] Page 1 of 1 [>] [>>]
Subject: PIC16F628
From: Stefano ####@####.####
Date: 10 Nov 2001 19:33:36 -0000
Message-Id: <Pine.LNX.4.21.0111101429380.10070-100000@nietzsche.mit.edu>

I found that the PIC16F628 has the same problem when writing and reading
EECON1,WR.
I found a workaround for the F874 and F877 and I assume that the harware
EEPROM core is similar with the F627/F628 processors.
Please read the F874/7 erratas and apply to the F628 too.
The result is simply adding a couple of nops jafter the EEPROM write
instruction:

before:
	.....
	movlw   0xAA		;
	movwf   EECON2		; write AAh
        bsf     EECON1,WR	; set WE bit enable write, start writing
EEWRcon btfsc   EECON1,WR       ; wait until WRITE is over
        goto    EEWRcon         ; wait until WRITE is over
        bcf     EECON1,WREN	; disable write EEPROM capability
	bcf	STATUS,RP0	; bank0
	bcf	STATUS,RP1	; bank0
	return			;

after:
        .....
        movlw   0xAA            ;
        movwf   EECON2          ; write AAh
        bsf     EECON1,WR       ; set WE bit enable write, start writing
        nop     ; DO NOT REMOVE ; STEFANO workaround for 16F628
        nop     ; DO NOT REMOVE ; STEFANO workaround for 16F628
EEWRcon btfsc   EECON1,WR       ; wait until WRITE is over
        goto    EEWRcon         ; wait until WRITE is over
        bcf     EECON1,WREN     ; disable write EEPROM capability
        bcf     STATUS,RP0      ; bank0
        bcf     STATUS,RP1      ; bank0
        return                  ;


I have the feeling that the F628 at 20MHZ need more then 2 nops !!

Stefano


Subject: PIC16F628
From: "Ronald Mundell" ####@####.####
Date: 24 Jun 2002 19:03:13 -0000
Message-Id: <000001c21bb0$2e0d1ac0$02a410ac@mundell>

Hi

Have any one used this chip before. I am experiancing a problem on port b. I
have configured PB.6 as an input but the software does not seem to be
working.

Ronald

Subject: PIC16F628
From: "Ronald Mundell" ####@####.####
Date: 25 Jun 2002 07:06:46 -0000
Message-Id: <000901c21c15$4763d0d0$02a410ac@mundell>

Hi

Have any one used this chip before. I am experiancing a problem on port b. I
have configured PB.6 as an input but the software does not seem to be
working.

I have setup T1 to fire a laser via an interrupt on timer over flow and
configuresed pin PB6 and PB7 as inputs. If I manualy take this pins low then
my software does not detect it. the problem lies someware in the
configuration of the timer, but where I do not know

Here are a copy of the code.

void SetupTMR1 ( void )
{
	// initialize timer 1;
	T1CKPS1 = 0;
	T1CKPS0 = 0;        // set T1 prescaler to 1:1
	TMR1CS = 0;         // internal OSC/4
  TMR1H = PRELOAD_HI; // Preload timer
  TMR1L = PRELOAD_LO; // Preload timer
	T1OSCEN = 1;        // enable T1
	TMR1IE = 1;         // enable timer 1 Interupts
	PEIE = 1;           // enable all unmasked peripheral interupts
  GIE = 1;            // enable global interupts
	TMR1ON = 0;         // Make Sure T1 is OFF
}

I only fire the timer up when needed. If there are someone out there that
can help, please help.

Ronald

Subject: Re: PIC16F628
From: Scott Dattalo ####@####.####
Date: 25 Jun 2002 13:59:15 -0000
Message-Id: <Pine.LNX.4.44.0206250645080.12812-100000@ruckus.brouhaha.com>

On Tue, 25 Jun 2002, Ronald Mundell wrote:

> Hi
> 
> Have any one used this chip before. I am experiancing a problem on port b. I
> have configured PB.6 as an input but the software does not seem to be
> working.

Are you using SDCC?

Scott

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.