Digital clock code for SDCC and Using DS89C450 as Replacement for AT89C52
Discussion in "Project Addition or Changes" started by Arun Kumar V Feb 2, 2007.
Sun Feb 04 2007, 06:35 pm
So first try changing the header files. and change the definations.. of variables and functions.
in variables wherever you find CODE keyword..
eg.. int code a;
change it to » cont int a;
this will automatically store it in the code space. then compile it.. see the errors and paste them here. we will see them.
in variables wherever you find CODE keyword..
eg.. int code a;
change it to » cont int a;
this will automatically store it in the code space. then compile it.. see the errors and paste them here. we will see them.
Sun Feb 04 2007, 07:40 pm
Wait on a second !
thats toooooo many Instructions for a novice like me to handle,
i'll go step by step,
First, i have downloaded SDCC Win32 version,
in the SDCC Folder ,i can seen Bin, Include, Lib, Etc sub folders, but not the Main Application which i should run in windows.
is there a error in my setup or does SDCC operate in DOS mode.
i have uC51 also, but when i tried Compiling your Code it shows Sytax Error, TARGET NOT FOUND
iam missing something here ?
one more thing in "include" folder there is a definition file (.def) and header File(.h)
how do i convert DS89C4xx SFR file into .h file
Help needed !
arun
thats toooooo many Instructions for a novice like me to handle,
i'll go step by step,
First, i have downloaded SDCC Win32 version,
in the SDCC Folder ,i can seen Bin, Include, Lib, Etc sub folders, but not the Main Application which i should run in windows.
is there a error in my setup or does SDCC operate in DOS mode.
i have uC51 also, but when i tried Compiling your Code it shows Sytax Error, TARGET NOT FOUND
iam missing something here ?
one more thing in "include" folder there is a definition file (.def) and header File(.h)
how do i convert DS89C4xx SFR file into .h file
Help needed !
arun
Sun Feb 04 2007, 07:47 pm
use the basic 8051 header file.. for now. as you are not using any main feature of this microcontroller.
psstt... I have to go for a marriage party sorry! lol! c ya later..
psstt... I have to go for a marriage party sorry! lol! c ya later..
Mon Feb 05 2007, 03:53 pm
hey Ricky,
just go to maxim website and order the samples.they are very fast at shipping the samples.
and regarding Arun's problem.. u should make sure that the EA(pin-31) pin is high and should not be left floating.
just go to maxim website and order the samples.they are very fast at shipping the samples.
and regarding Arun's problem.. u should make sure that the EA(pin-31) pin is high and should not be left floating.
Mon Feb 05 2007, 04:11 pm
Yes i ordered already thank you!
and Arun is using high speed crystal. as the code is running is typical software implementation of I2C protocol. so timing is important. So i recommended him to change the crystal to 11.0592 and there any many other changes to be made inside.. if there is any default registers.. which configure the clocks to be use.. that need to be changed.
and Arun is using high speed crystal. as the code is running is typical software implementation of I2C protocol. so timing is important. So i recommended him to change the crystal to 11.0592 and there any many other changes to be made inside.. if there is any default registers.. which configure the clocks to be use.. that need to be changed.
Mon Feb 05 2007, 07:49 pm
Hello Rickey
I have connected External Access Pin 31 to VCC. Bcoz iam not using external Memory.
rickey in the note from Maxim, for timers there is some thing to be done with SFR CKCON TXM bit, this toggles between divide by 12 and divide by 4 mode
i have seen this in DS89C450 header file:
sfr CKCON = 0x8E
don't get it , what does this value mean (is the timer set to div by 12 or div by 4)
LOL
arun
I have connected External Access Pin 31 to VCC. Bcoz iam not using external Memory.
rickey in the note from Maxim, for timers there is some thing to be done with SFR CKCON TXM bit, this toggles between divide by 12 and divide by 4 mode
i have seen this in DS89C450 header file:
sfr CKCON = 0x8E
don't get it , what does this value mean (is the timer set to div by 12 or div by 4)
LOL
arun
Mon Feb 05 2007, 08:22 pm
Hello Rickey
This is what i found at 8052.com tutorial for RTC:
"Step 2: The Crystal Frequency
The next thing we need to take into account is the speed of the crystal being used. Keep in mind that with a crystal of 11.0592Mhz, Timer 1 will increment 11,059,200/12=921,600 times per second.
NOTE: The standard 8051 Timer increments every 12 crystal cycles. However, some derivative chips increment their timers after a different number of crystal cycles: For example, Dallas microcontrollers can be programmed to increment every 4 cycles. If you are using a derivative that uses some value other than 12, you will have to make the appropriate changes to this code.
Let's establish some more equates to make our code more portable:
CRYSTAL EQU 11059200 ;The crystal speed
TMRCYCLE EQU 12 ;The number of crystal cycles per timer increment
TMR_SEC EQU CRYSTAL/TMRCYCLE ;The # of timer increments per second
Thus, should our crystal frequency change or should we move our code to a derivative microcontroller that uses some other value than 12, we simply need to modify our constants."
Tue Feb 06 2007, 11:21 am
Hello Rickey
My SDCC inlcude Folder doen't have INTRINS.h File which is in your Program.
can you Upload this INTRINS.h file here
thank you
arun
My SDCC inlcude Folder doen't have INTRINS.h File which is in your Program.
can you Upload this INTRINS.h file here
thank you
arun
Tue Feb 06 2007, 05:17 pm
dont use intrins.h
i use this header file for _nop_() function. you can use this function by adding nops with inline assembly.
eg
asm{
nop;
nop;
nop;
}
i use this header file for _nop_() function. you can use this function by adding nops with inline assembly.
eg
asm{
nop;
nop;
nop;
}
Tue Feb 06 2007, 07:06 pm
Hello rickey
when i tried compiling your original Clock.c file with SDCC, it gave too many errors and could not generate the output.
take a look at this attachement
arun
when i tried compiling your original Clock.c file with SDCC, it gave too many errors and could not generate the output.
take a look at this attachement
arun
Powered by e107 Forum System