??? 04/24/10 19:24 Modified: 04/24/10 19:36 Read: times |
#175351 - I think you need some more clarification Responding to: ???'s previous message |
here goes:
There are 2 things that you need: 1. You want know whether we can use one value of crystal for ISP programming and another value of crystal for the target board (product). 2. You want know, how and which timer to use for setting the baudrate, or if you need to change the baudrate when the product is working, then how to do it? Here are my answers to it: 1. You can use one value of crystal for ISP programming and another for the running of the target board (product). For example: you can use 12MHz crystal during ISP programming and use a 24MHz crystal for the running of the (target board) product. Fine, no problem. Explaination: When you use ISP programming software such as FlashMagic, you have to specify (in the software) the value of the crystal that you are using when you are programming the CPU using ISP. Complete the other formalities of FlashMagic, and your flash inside the CPU is programmed. Once the flash is programmed, it remains there irrespective of the value of the crystal that you use in your target board for running of the product. Of course, you have to stick to the limits of the crystal frequency specified in the datasheets. Edit: You can use any crystal frequency from 0Mhz to 40MHz for P89V51RD2 (in x12Mode) in your target board. 2. Normaly, for MCS51, you need a timer overflow flag that acts as a clock for the UART Hardware. This timer overflow flag can come from Timer1 or Timer2. Its your call, you decide it, depending upon your application. There are certain functions of Timer2 that might be needed in a product for different use. In this case you will have to use Timer 1 for Baudrate generation. Now it must be clear in your mind that you need timer overflows as a clock to the UART hardware (inside the CPU). The speed of this timer overflow, determines the baud rate. I am attaching an Excel File that does the baudrate calculation. http://www.8052.com/users/KiranVSutar/BaudRate.xls In this file, Enter the Baudrate you want to use, Select the Crystal Frequency you are using in the target board, and you will have the values for Timer1 and Timer2. Now it is upto you to decide which timer you want to use as BaudRate generator. Put that value in your timer and the BaudRate is set. If you are using Timer1 then use the value mentioned in the "C6" cell as Timer Overflow, and if you are using Timer2 for BaudRate, then set the value of RCAP (RCAP2H, RCAP2L) with a value from the cell "F6". Just to avoid those calculations everytime, I have already made a table in this file that acts as a ready reference for the standard crystal frequencies (that I use) and the usually used BaudRates(that I use) for using Timer2 as BaudRate Generator. If your product demands that during the working of the product, the BaudRate must be selectable; then you just have to write the Timer with the value that I have given in the Excel File, and it will work. |
Topic | Author | Date |
crystal oscillator | 01/01/70 00:00 | |
Research needed. | 01/01/70 00:00 | |
comments, answers | 01/01/70 00:00 | |
Datasheets sometimes not available | 01/01/70 00:00 | |
Why would anyone use a part with no datasheet? | 01/01/70 00:00 | |
I can quote you, Richard | 01/01/70 00:00 | |
People regularly ask for help with unknown components | 01/01/70 00:00 | |
Thanks | 01/01/70 00:00 | |
Good | 01/01/70 00:00 | |
b) is not correct | 01/01/70 00:00 | |
how do you manage the change of crystal?! | 01/01/70 00:00 | |
Not really | 01/01/70 00:00 | |
Re: Not really | 01/01/70 00:00 | |
That's right! | 01/01/70 00:00 | |
BAUD RATE SETTING | 01/01/70 00:00 | |
Start a new thread! | 01/01/70 00:00 | |
Well done! | 01/01/70 00:00 | |
My Suggestion | 01/01/70 00:00 | |
sum it up | 01/01/70 00:00 | |
No, they don't | 01/01/70 00:00 | |
I think you need some more clarification | 01/01/70 00:00 | |
There is NO need ...![]() | 01/01/70 00:00 |