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

Serial baud rate is some times problem
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Wed Oct 05, 2022 2:15 am     Reply with quote

To me, that it doesn't work on the internal oscillator, but does on the
external, says that the calibration value has probably been lost.

You have not answered my question about whether different chips are
involved.

A lot of the unofficial 'knock off' chips have faulty calibration values, and
as the post I gave the link to earlier shows, some real ones do as well.
The amount of the error is too large to be explained any other way.
PrinceNai



Joined: 31 Oct 2016
Posts: 452
Location: Montenegro

View user's profile Send private message

PostPosted: Wed Oct 05, 2022 6:41 pm     Reply with quote

Have you tried with another kind of PIC? Are yours original? I use internal oscillator at max. possible speed of 32MHz in like 90% of my projects, almost all of them with serial comm higher than 9600. It is true that everything so far is running at close to room temperature (18 - maybe 30 deg Celsius). I've never experienced any problems, on three different chips. On my test board with 18f46k22 (now version 8) nothing ever changed if I went from 20MHz crystal to 32MHz internal clock. Software serial works too. On 5V and 3.3V.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 06, 2022 6:18 am     Reply with quote

Like the Prince... I've used the 46k22 for years,top speed and never had the serial ports miss a bit at 1Mbaud.
I'm wondering what value the 'OSCTUNE' register has. It should be '0' according to the datasheet. If not, then some code has changed it, and it should be coded to zero.
If that doesn't make it work right, determine whether the clock is fast or slow, then change 'OSCTUNE' slow or fast.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Oct 06, 2022 6:23 am     Reply with quote

If you look though he is using the 886, which was one of the first chips
to have a reasonably accurate internal oscillator. Limited to just 8MHz
(no PLL).
Almost an antique product now. Nearly 20 years old.
The K22 family is a much later product.
I suspect he is using old chips, and has managed to erase the cal value
on some of them, hence the speed error.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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