From: Casiano C. B. <ccb...@fi...> - 2006-02-25 00:38:23
|
Hi. I'm having problems when I compile for a 68HC908GP32, and I'm not = sure if what happens, is a bug.=20 I would be grateful if someone can help me on my first steps with SDCC, = although not on C programming. I wrote a simple program to see some leds to blink, to test the SDCC, = and I'm working on Windows 2000. The program named prueba.c is: =20 #include"mc68hc908gp32.h" void main(void) { =20 int h; =20 DDRD =3D 0xFF; PTD =3D 0x00; =20 PTD =3D 0xFF; for(h =3D 0; h <=3D 800; h++){} PTD =3D 0x00; for(h =3D 0; h <=3D 800; h++){} =20 } and I compiled it with a "dojob.bat" file with the command lines as = follows: =20 sdcc -mhc08 -c prueba.c sdcc --model-small -c prueba.c sdcc --code-loc 0x8000 --data-loc 0x0040 --stack-loc 0x023F prueba.c sdcc --out-fmt-s19 prueba.c =20 I can see the content of the prueba.s19 output file, but after I upload = it with PROG08SZ - Flash Programmer, the uC does nothing. Probably I'm doing something wrong. Is it? On other way I tried the program prueba.c with only void main(void){ } and without any header file, and got the prueba.s19 = file with SDCC. I did the same with the ImageCraft compiler and got a different content = on the prueba.s19 file. Both with the same code and data locations. I don't know what I'm doing wrong, Can someone help me please?. Regards=20 Casiano Charles Budden |
From: Ernst B. <e.b...@xe...> - 2006-02-25 15:54:43
|
On Saturday 25 February 2006 06:32, Casiano Carlos Budden wrote: > Hi. I'm having problems when I compile for a 68HC908GP32, and I'm not sure > if what happens, is a bug. ... > > The program named prueba.c is: > > > > #include"mc68hc908gp32.h" > > void main(void) > > { > > int h; > > > > DDRD = 0xFF; > > PTD = 0x00; > > > > PTD = 0xFF; > > for(h = 0; h <= 800; h++){} > > PTD = 0x00; > > for(h = 0; h <= 800; h++){} > > > > } > > and I compiled it with a "dojob.bat" file with the command lines as > follows: > > > > sdcc -mhc08 -c prueba.c > > sdcc --model-small -c prueba.c > > sdcc --code-loc 0x8000 --data-loc 0x0040 --stack-loc 0x023F prueba.c > > sdcc --out-fmt-s19 prueba.c > > > > I can see the content of the prueba.s19 output file, but after I upload it > with > > PROG08SZ - Flash Programmer, the uC does nothing. > > Probably I'm doing something wrong. Is it? > > On other way I tried the program prueba.c with only > > void main(void){ } and without any header file, and got the prueba.s19 file > with SDCC. > > I did the same with the ImageCraft compiler and got a different content on > the > > prueba.s19 file. Both with the same code and data locations. > > I don't know what I'm doing wrong, Well, even if your program works, it won't do anything you'd be able to notice. I don't know the Freq your uC runs at, but, you turn the LEDS on, wait for a very short period of time, then turn them off again, and finish the program (return from main) after which nothing will happen any more. add a "while (1)" loop arround the last 4 lines of your code, so it actually does blink and not just generate a single pulse. Maybe also run your delay loops to like 30.000 for a first try, should be easier to notice then. /Ernst |
From: Manuel B. <ma...@ma...> - 2006-02-25 17:17:07
|
Hi, Am Freitag, den 24.02.2006, 21:32 -0800 schrieb Casiano Carlos Budden: > sdcc -mhc08 -c prueba.c > sdcc --model-small -c prueba.c > sdcc --code-loc 0x8000 --data-loc 0x0040 --stack-loc 0x023F prueba.c > sdcc --out-fmt-s19 prueba.c Are your really running all those commands one by one in your script?? I think what you want to compile is something like: sdcc -mhc08 --model-small --code-loc 0x800 --data-loc 0x0040 --stack-loc 0x023f --out-fmt-s19 prueba.c Otherwise each of your commands will generate the same file over and over again with different options enabled... Cheers, Manuel -- ma...@ma... http://www.malteser-berlin.de http://www.matronix.de - http://www.elektronik-kompendium.de/public/borchers |
From: Raphael N. <RN...@we...> - 2006-02-25 18:07:32
|
Hi Casiano Carlos Budden, > and I compiled it with a “*dojob.bat*” file with the command lines as > follows: > sdcc -mhc08 -c prueba.c > sdcc --model-small -c prueba.c > sdcc --code-loc 0x8000 --data-loc 0x0040 --stack-loc 0x023F prueba.c > sdcc --out-fmt-s19 prueba.c This sequence compiles the source 4 times, each time with different options. Try to compile your source using sdcc -mhc08 --model-small --code-loc 0x8000 \ --data-loc 0x0040 --stack-loc 0x023F --out-fmt-s19 -c prueba.c (as a single line in your .bat file), thus compiling prueba.c only once using all options provided. I don't know the hc08-port, but maybe this already helps. Regards, Raphael Neider |