CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

pic 16f887 vs 18f4620 glcd problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kbaser



Joined: 26 Jul 2009
Posts: 5

View user's profile Send private message

pic 16f887 vs 18f4620 glcd problem
PostPosted: Sun Jul 04, 2010 12:47 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 04, 2010 1:06 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 04, 2010 1:47 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 04, 2010 2:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 04, 2010 12:41 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group