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 support@ccsinfo.com

Problem with PLL clock setting

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



Joined: 27 Oct 2010
Posts: 2
Location: Australia

View user's profile Send private message

Problem with PLL clock setting
PostPosted: Wed Oct 27, 2010 8:15 pm     Reply with quote

Hi, I am new to Pic C language and am having trouble setting PLL x 4 clock settings. I am using PCWHD compiler V 4.109 and 18F8722. I am using the Flex_Lcd.c driver and have changed the settings to suit my dev. board.

This works.
Code:

#include <18F8722.H>
#fuses   HS,NOLVP,NOWDT,NOPROTECT,NOSTVREN
#define LED PIN_H0
#use delay(clock = 10000000)
#include "flex_lcd.c"
//==========================
void main() {
   while(1) {
lcd_init();  // Always call this first.
Delay_ms(1000);
lcd_putc("\fHello World\n");
lcd_putc("A new start");
output_high(LED);
Delay_ms(1000);
output_low(LED);
//Delay_ms(1000);
   }
}

but this does not.
Code:
#include <18F8722.H>
#fuses   H4,NOLVP,NOWDT,NOPROTECT,NOSTVREN
#define LED PIN_H0
#use delay(clock = 40000000)
#include "flex_lcd.c"
//==========================
void main() {
   while(1) {
lcd_init();  // Always call this first.
Delay_ms(1000);
lcd_putc("\fHello World\n");
lcd_putc("A new start");
output_high(LED);
Delay_ms(1000);
output_low(LED);
//Delay_ms(1000);
   }
}

I have tried a number of variations found on an earlier post but no luck. Any help would be great to get me started.
Thanks.
steveo



Joined: 27 Oct 2010
Posts: 2
Location: Australia

View user's profile Send private message

PostPosted: Wed Oct 27, 2010 11:07 pm     Reply with quote

I think I have it sorted out. Seems to be some timing issues with my LCD module a look at the data sheet and some changes has fixed it.
Regards
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