View previous topic :: View next topic |
Author |
Message |
kbaser
Joined: 26 Jul 2009 Posts: 5
|
pic 16f887 vs 18f4620 glcd problem |
Posted: Sun Jul 04, 2010 12:47 am |
|
|
Hi all,
I have a circuit to display on 128x64 glcd with HDM64GS12.c and graphics.c (ext osc 20Mhz).
When I insert 16F887 it draws prefect shapes, but when I replaced with 18F4620 I see some pixels randomly missing.
PS: When I try simple blink led with 1000ms interval (to compare 16f887 vs 18f4620), it seems 18F4620 blinks shorter interval (faster).
How can I solve that ?
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 04, 2010 1:06 am |
|
|
1. Post the LED blink program for the 18F4620.
Make sure you post the #fuses and #use delay() statements.
2. What is your compiler version ?
3. Are you testing this on a hardware board or in Proteus ? |
|
|
kbaser
Joined: 26 Jul 2009 Posts: 5
|
|
Posted: Sun Jul 04, 2010 1:47 am |
|
|
PCM programmer wrote: | 1. Post the LED blink program for the 18F4620.
Make sure you post the #fuses and #use delay() statements.
2. What is your compiler version ?
3. Are you testing this on a hardware board or in Proteus ? |
1. Here is the code :
Code: |
#include <18F4620.h>
#FUSES NOWDT
#FUSES INTRC_IO
#FUSES NOPROTECT
#FUSES NOPUT
#FUSES NOMCLR
#use delay(clock=32000000)
void main()
{
SETUP_OSCILLATOR(OSC_8MHz|OSC_PLL_ON);
set_tris_a(0x00);
output_a(0x00);
while(true) {
output_high(pin_a0);
delay_ms(500);
output_low(pin_a0);
delay_ms(500);
}
}
|
2. Compiler V: 4.068
3. I test LED and glcd both on hw boards. |
|
|
kbaser
Joined: 26 Jul 2009 Posts: 5
|
|
Posted: Sun Jul 04, 2010 2:45 am |
|
|
I temporarily fix by changing delay_cycles() parameters of readByte and writeByte functions in HDM64GS12.c file.
I multiplied the parameters by 5 for 20Mhz ext and multiplied by 10 32Mhz int_pll for 18F4620. But I'm not sure this is a good solution, at least it works anyway!
Thank you |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 04, 2010 12:41 pm |
|
|
I installed vs. 4.068, compiled your program, and programmed it into
an 18F4620. I jumpered pin A0 over to pin B0 where there is an LED
on my board. I ran the program and timed the flashes with a stopwatch.
It's accurate. It's not running slow or fast.
If that test program is running at the incorrect speed for you, then
you have a problem somewhere. |
|
|
|