Hey guy, Do you recall about an issue I had concerning the LCD slowing down when I changed to internal osc.
Guess what I found.
I needed two more pins for the VA meter project and that is why I went for internal osc. Since it slowed and you guys said it WILL wotk, I thought of starting fresh coding.
I selected the 16F88 int osc with I/O on RA6 and 7.
wrote the code for first display point scrolling and programmed.
To my surprise it was still slow. The easypic jumpers were properly set, that is the crystal jumpers were set as I/O.
This thing was like turtle. Checked everything and still slow.
So put back the HS XTAL (8MHz) changed the setting to HS and programed and it was fast as it can be.
I thought what gives ?
So changed to int osc at 8Mhz and and tried and it was crawling again.
changed the PIC and still the same.
And it hit me after checking the F88 data.
I added to first line of my code the following;
OSCCON = 0x7E;
Hit program and Viola it was fast.
Why is this happening.? I do not understand. May be one of you could.
Still I need some advice for the OSCON regsitor bits.
************************
REGISTER 4-2: OSCCON: OSCILLATOR CONTROL REGISTER (ADDRESS 8Fh)
Note: The OST is only used when switching to
XT, HS, and LP Oscillator modes.
bit 7 bit 0
bit 7 Unimplemented: Read as ‘0’
bit 6-4 IRCF<2:0>: Internal RC Oscillator Frequency Select bits
000 = 31.25 kHz
001 = 125 kHz
010 = 250 kHz
011 = 500 kHz
100 = 1 MHz
101 = 2 MHz
110 = 4 MHz
111 = 8 MHz
bit 3 OSTS: Oscillator Start-up Time-out Status bit(1)
1 = Device is running from the primary system clock
0 = Device is running from T1OSC or INTRC as a secondary system clock
Note 1: Bit resets to ‘0’ with Two-Speed Start-up mode, and LP, XT, or HS selected as the
oscillator mode.
bit 2 IOFS: INTOSC Frequency Stable bit
1 = Frequency is stable
0 = Frequency is not stable
bit 1-0 SCS<1:0>: Oscillator Mode Select bits
00 = Oscillator mode defined by FOSC<2:0>
01 = T1OSC is used for system clock
10 = Internal RC is used for system clock
11 = Reserved
******************
Above is the 16F88 Osccon register.
I understand form bit7 to bit4.
The rest I need some explanation.
I wanna use the 8Mhz internal osc with OSC pins both as I/O.
Is the 0x7E, which is binary "01111110" OK for my app.
Guess what I found.
I needed two more pins for the VA meter project and that is why I went for internal osc. Since it slowed and you guys said it WILL wotk, I thought of starting fresh coding.
I selected the 16F88 int osc with I/O on RA6 and 7.
wrote the code for first display point scrolling and programmed.
To my surprise it was still slow. The easypic jumpers were properly set, that is the crystal jumpers were set as I/O.
This thing was like turtle. Checked everything and still slow.
So put back the HS XTAL (8MHz) changed the setting to HS and programed and it was fast as it can be.
I thought what gives ?
So changed to int osc at 8Mhz and and tried and it was crawling again.
changed the PIC and still the same.
And it hit me after checking the F88 data.
I added to first line of my code the following;
OSCCON = 0x7E;
Hit program and Viola it was fast.
Why is this happening.? I do not understand. May be one of you could.
Still I need some advice for the OSCON regsitor bits.
************************
REGISTER 4-2: OSCCON: OSCILLATOR CONTROL REGISTER (ADDRESS 8Fh)
Note: The OST is only used when switching to
XT, HS, and LP Oscillator modes.
bit 7 bit 0
bit 7 Unimplemented: Read as ‘0’
bit 6-4 IRCF<2:0>: Internal RC Oscillator Frequency Select bits
000 = 31.25 kHz
001 = 125 kHz
010 = 250 kHz
011 = 500 kHz
100 = 1 MHz
101 = 2 MHz
110 = 4 MHz
111 = 8 MHz
bit 3 OSTS: Oscillator Start-up Time-out Status bit(1)
1 = Device is running from the primary system clock
0 = Device is running from T1OSC or INTRC as a secondary system clock
Note 1: Bit resets to ‘0’ with Two-Speed Start-up mode, and LP, XT, or HS selected as the
oscillator mode.
bit 2 IOFS: INTOSC Frequency Stable bit
1 = Frequency is stable
0 = Frequency is not stable
bit 1-0 SCS<1:0>: Oscillator Mode Select bits
00 = Oscillator mode defined by FOSC<2:0>
01 = T1OSC is used for system clock
10 = Internal RC is used for system clock
11 = Reserved
******************
Above is the 16F88 Osccon register.
I understand form bit7 to bit4.
The rest I need some explanation.
I wanna use the 8Mhz internal osc with OSC pins both as I/O.
Is the 0x7E, which is binary "01111110" OK for my app.