]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Fixed clock settings for h8eurobot.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 28 Mar 2007 14:11:00 +0000 (14:11 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 28 Mar 2007 14:11:00 +0000 (14:11 +0000)
darcs-hash:20070328141136-f2ef6-44148d857efc8a81113fe1d73aa5d68835fb9cf2.gz

board/h8eurobot/config/config.h8eurobot
board/h8eurobot/defines/system_def_h8eurobot.h
board/h8eurobot/libs/bspbase/bsp0hwinit.c

index c2685bdfc6d84eceae2205c372dbe1d69513a2af..b8d02772e5005fecae49c0f13e4717a10696c0ec 100644 (file)
@@ -18,7 +18,7 @@ OPTIMIZE ?= -O2
 
 -include $(MAKERULES_DIR)/config.tohit
 HIT_BAUD ?= 57600
-HIT_DEV ?= /dev/ttyS0
+HIT_DEV ?= /dev/ttyUSB0
 TOHIT = $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/bin-utils/tohit --baud $(HIT_BAUD) --sdev $(HIT_DEV)
 LOAD_CMD-boot = \
        $(TOHIT) --erase --start 0x000000 --length 0x1600; \
index 5838f9e52f319e0da4ee3d5427adba5af72354c7..28cabbb559e751e5aa7870e425e294965ecd0c9f 100644 (file)
@@ -15,8 +15,8 @@
 //#define CPU_REF_HZ 20000000l         /* reference clock for H8CANUSB   */
 //#define CPU_SYS_HZ 20000000l /* default system  for H8CANUSB   */
 
-#define CPU_REF_HZ 11059200l   /* reference clock for H8CANUSB   */
-#define CPU_SYS_HZ 11059200l   /* default system  for H8CANUSB   */
+#define CPU_REF_HZ  4000000l   /* reference clock for H8CANUSB   */
+#define CPU_SYS_HZ 16000000l   /* default system  for H8CANUSB   */
 
 
 unsigned long cpu_ref_hz;      /* actual external XTAL reference */
index 8163124fecc0b1c304817e1906b6e36f20d9412c..4d111af7103155c8202fa646f66d926842a42063 100644 (file)
@@ -69,6 +69,12 @@ void _setup_board()
   /* PLL mode x2, */
   /* *SYS_LPWRCR=1&LPWRCR_STCxm; */
   {
+#if (CPU_SYS_HZ != CPU_REF_HZ) && (CPU_SYS_HZ/2 != CPU_REF_HZ) && (CPU_SYS_HZ/4 != CPU_REF_HZ)
+#error Wrong clock settings: CPU_SYS_HZ must be 1, 2 or 4 multiple of CPU_REF_HZ
+#endif
+#if CPU_SYS_HZ > 20000000
+#error Wrong clock settings: CPU_SYS_HZ must be less or equal to 20000000
+#endif
     const char clkrat2stc[]={0,0/*1*/,1/*2*/,1,2/*4*/,2,2,2,3/*8*/};
     *SYS_LPWRCR=LPWRCR_STCxm&(LPWRCR_STC0m*
                               clkrat2stc[(CPU_SYS_HZ+CPU_REF_HZ/2)/CPU_REF_HZ]);