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

Clock on PIC18F46K80

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



Joined: 12 Jul 2007
Posts: 43

View user's profile Send private message

Clock on PIC18F46K80
PostPosted: Mon Nov 07, 2011 8:12 pm     Reply with quote

I don't know why setting up the clock on the PIC gives me such a headache, but I just can't get a simple "Hello World" going on my RS232 port.

so far:
Code:

#INCLUDE <18F46K80.h>
#NODEBUG,NOWDT //Have tried HSH,HSM,many combinations
#USE DELAY (CLOCK=20000000)
#USE RS232(XMIT=PIN_C7,RCV=PIN_C6,BAUD=9600)

void main()
{
  printf("Hello, World\n\r");
  while(1);
}


I have tried a number of combinations of PLL stuff, HSH, HSM, different clock speeds (my oscillator is 20 MHz).

I am on a brand new board, but I can print out to my onboard LCD without any issue, and I get some "noise" on my serial port monitor (cursor moves, characters appear with some settings).

Advice/direction/solutions/explanation would be greatly appreciated!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 07, 2011 10:24 pm     Reply with quote

Here is a program that uses the internal oscillator and outputs text on
RS-232:
http://www.ccsinfo.com/forum/viewtopic.php?t=46255&start=5
javick82



Joined: 12 Jul 2007
Posts: 43

View user's profile Send private message

PostPosted: Tue Nov 08, 2011 9:16 am     Reply with quote

So with the added confidence of getting it to work with the internal oscillator, I played around with the code a bit more to get it to work with my external (I think???) oscillator.

I think this was probably due to my use of streams and not using fprintf over printf.

Fuses and clock speed settings work exactly as I would expect now Rolling Eyes
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