Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/25/06 14:01
Read: times


 
#128501 - Not yet
Responding to: ???'s previous message
But why we need to set it to 48Mhz clock.??

???
I can see signal on RXD0OUT in 12 and 24 MHz CLKOUT.

// test_uart0.c
//  test for UART0 mode 0
//
// command line to build this file
//      c51 test_uart0.c db oe code small moddp2
//      bl51 test_uart0.obj TO test_uart0 RAMSIZE(256) XDATA(1900h)
//      oh51 test_uart0 HEXFILE(test_uart0.hex)

#define ALLOCATE_EXTERN
#include "fx2.h"
#include "fx2regs.h"

void main(void)
{
//  CPUCS = ((CPUCS & ~bmCLKSPD) & ~bmCLKSPD1); // set the CPU clock to 12MHz (default)
    CPUCS = ((CPUCS |  bmCLKSPD) & ~bmCLKSPD1); // set the CPU clock to 24MHz
//  CPUCS = ((CPUCS & ~bmCLKSPD) |  bmCLKSPD1); // set the CPU clock to 48MHz

    PORTECFG  =  0x08;  // enable RXD0OUT
    SCON0     =  0x13;  // mode 0, receive enabled, baud CLKOUT/12, TI = 1, RI = 1

    while(1){
        if ( TI ){
            TI = 0;
            SBUF0 = 0x55;
        }
    }
}

Tsuneo

List of 44 messages in thread
TopicAuthorDate
fx2 serial port mode0            01/01/70 00:00      
   How to post legible code            01/01/70 00:00      
      I dunno            01/01/70 00:00      
      thanks            01/01/70 00:00      
         who is is this microresistor expert?            01/01/70 00:00      
         You, too, can be expert!            01/01/70 00:00      
            well, I did            01/01/70 00:00      
               But of course, you prefer to be obtuse            01/01/70 00:00      
                  no, I am not 'obtuse', just trying to get to the s            01/01/70 00:00      
   Legible code posted,please continue the discussion            01/01/70 00:00      
      That's better            01/01/70 00:00      
         rxd0out            01/01/70 00:00      
            REN_0            01/01/70 00:00      
         I'm puzzled            01/01/70 00:00      
            Bible Time!            01/01/70 00:00      
               Separate RXD0OUT pin            01/01/70 00:00      
                  Now I'm confused, too!            01/01/70 00:00      
                  data is not transmitting            01/01/70 00:00      
               OUCH!            01/01/70 00:00      
                  1Mhz clock            01/01/70 00:00      
                     reply            01/01/70 00:00      
   why no body is replying            01/01/70 00:00      
      Richard, where are you, he is using mode 0!            01/01/70 00:00      
         I didn't have anything to contribute ...            01/01/70 00:00      
      Because no particular error            01/01/70 00:00      
         RxD0out            01/01/70 00:00      
            Debug monitor?            01/01/70 00:00      
               connected to SI0-0            01/01/70 00:00      
                  Debug monitor!!            01/01/70 00:00      
                     mode1            01/01/70 00:00      
                        monitor switches the UART mode            01/01/70 00:00      
                           Tested with SIO-1            01/01/70 00:00      
                              Monitor comes from EEPROM?            01/01/70 00:00      
                                 problem solved            01/01/70 00:00      
                                    Not yet            01/01/70 00:00      
                                       12Mhz            01/01/70 00:00      
                                          Then what was the cause, after all?            01/01/70 00:00      
                                             Don't leave it unsolved            01/01/70 00:00      
                                                ALLOCATE_EXTERN??            01/01/70 00:00      
                                                   ALLOCATE_EXTERN fixes FX2 xdata registers addr            01/01/70 00:00      
                                                      EXTERN ALLOCATE            01/01/70 00:00      
                                                         ALLOCATE_EXTERN fixes PORTECFG address            01/01/70 00:00      
                                                            EXTERN_ALLOCATE            01/01/70 00:00      
                                                               Its ALLOCATE_EXTERN .not EXTERN_ALLOCATE            01/01/70 00:00      

Back to Subject List