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

16F15344 serial port not waiting on key entry during getc()
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: Mon Jun 06, 2022 10:58 pm     Reply with quote

The other thing is choosing oscillator frequencies that divide nicely to
UART baud rates
If you have (say) a 4MHz oscillator, then on most PIC's, even with a
crystal, you will have problems at 115200. Problem is that the available
divisions will give 125000 and 111111baud. Way out of spec.
Instead use a crystal of 3.6864MHz, and 115200 can be done exactly.
In fact all the standard baud rates can be done exactly from this frequency.
The reason is that this was the crystal used years ago for baud rate
generation, and the 'standard' rates are exact divisions of this. Why this
was chosen, is historic. It is the NTSC colour burst frequency.
The other thing is if you are talking only to your own kit, go away from
the 'standard' rates. I'll quite frequently use 125000 baud, for things that
only talk to other PIC's.
robleso7473



Joined: 25 Mar 2009
Posts: 47

View user's profile Send private message

PostPosted: Tue Jun 07, 2022 7:09 am     Reply with quote

Thanks for the detailed explanation on this. I do recall seeing those odd 3.68MHz crystals back in the old computer systems and TV sets. I always wondered why such a weird frequency would be used. I will keep this in mind for future projects.
temtronic



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

View user's profile Send private message

PostPosted: Tue Jun 07, 2022 7:19 am     Reply with quote

2.4576MHz is another crystal that is perfect for UARTs....
I needed it to generate a 24 BAUD clock back in the 'dinodays'.....prePIC..
robleso7473



Joined: 25 Mar 2009
Posts: 47

View user's profile Send private message

PostPosted: Tue Jun 07, 2022 7:22 am     Reply with quote

wow! 24 bps?? I hope you weren't transmitting lots of data.

Maybe I should stick to the tried and true 9600 bps for my development. It takes an extra few 100 miliseconds to display the menu table which is not a big deal.

thanks again,
Oscar
temtronic



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

View user's profile Send private message

PostPosted: Tue Jun 07, 2022 9:26 am     Reply with quote

Not a lot of data, 2 start bits, 4 adrs bits, 8 ctrl bits(send data), 8 alrm bits(rcvd data) done over solid wire(think Bell wires), to about 12 miles on way.
Super reliable(hacker proof),unless someone took out a BellTell pole. even then had the ability to isolate that panel and communicate with the others in that 'loop'. MSC had patents for it back in 1980ish,long expired. NOTHING today has similar 'specs'.nothing.
The original 'transponders'(ULC AA listed) had RC clocks, so on very,very long lines, you could lose the last 1-2 bits. My small PCB of 4060 chip, 2.4576MHz xtal, 2 dividers made for a very stable clock....so NO missing bits, NO lost data.
originally designed/built for high end security systems, I designed my 'remote energy control boards' to use the 'main frame'(6800 based).
robleso7473



Joined: 25 Mar 2009
Posts: 47

View user's profile Send private message

PostPosted: Tue Jun 07, 2022 9:29 am     Reply with quote

That sounds like it's robust, reliable and hack-proof.
Nowadays with people wanting to upload their entire life on the cloud they are sacrificing all kinds of personal security just for the sake of convenience and getting high speed downloads.

I do miss the old days.
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