View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19655
|
|
Posted: Mon Jun 06, 2022 10:58 pm |
|
|
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
|
|
Posted: Tue Jun 07, 2022 7:09 am |
|
|
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: 9377 Location: Greensville,Ontario
|
|
Posted: Tue Jun 07, 2022 7:19 am |
|
|
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
|
|
Posted: Tue Jun 07, 2022 7:22 am |
|
|
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: 9377 Location: Greensville,Ontario
|
|
Posted: Tue Jun 07, 2022 9:26 am |
|
|
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
|
|
Posted: Tue Jun 07, 2022 9:29 am |
|
|
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. |
|
|
|