This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM uVision3

Hi,
i need to know how come 97 is use in VODLL and why
is 15 Mhz instead of 12Mhz...

void init_serial (void){/*Initialize Serial Interface*/
  PINSEL0 = 0x00000005;/* Enable RxD0 and TxD0    */
  U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit  */
  U0DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */
  U0LCR = 0x03;/* DLAB = 0                        */

Parents Reply Children
  • "ya.. we are in the same class"

    So why aren't you asking your teacher about this?

    It has nothing specifically to do with the Keil tools - it all depends on the specifics of your particular hardware and your particular application.

    "why is 97 use instead of other num"

    Because 97 achieves the desired effect wich, according to the comment, is "9600 Baud Rate @ 15MHz VPB Clock"

    You need to read the Datasheet for the particular chip that you are using; that will contain the detailed description of what the U0DLL register does - from that, you will understand what effect writing a value of 97 to that register will have!

    Similarly for all the other registers.

    "How can i find out and about the 12Mhz"

    Refer to your course notes and other Documentation that you have been given - that will describe whatever target hardware it is that you have.

    You haven't given any indformation whatsoever about your target hardware - not even what microcontroller chip it uses - so it is completely impossible for anyone to help you without that essential basic information!

    "Izit possible that i can change 15Mhz to 12Mhz..."

    See above - this depends entirely on your particular target hardware!

    You question is like saying, "can I fit 15-inch tyres onto my car" - without knowing what particular make & model of car you're talking about, it is impossible to say.

  • U0DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */
    

    It is, of course, possible that the comment is wrong - is that what you think?

    The comment could be wrong because it's just a straightforward mistake - the author accidentally typed "15" instead of "12" - or it could be that it was once 15MHz, but has been updated for 12MHz - and the author forgot to update the comment to match.

    If you suspect this, you should ask your teacher!

    OR is this a "spot the deliberate errors" exercise?
    If so, you should check it against the other documentation that you have, and look at the physical hardware to see what components are actually fitted!