EmbeddedRelated.com
Forums

Program Format

Started by Ravi Haksar June 19, 2006
Hi

i managed to find a free C compiler (Dev-c++) and now i am trying to program my chip (m68hc11). However, i dont know how to transfer my program.
my compiler just creates a .C file; i dont think its in the right format for my chip(i think the format is .s19, im not sure).

do i need to convert the file then dowload the program onto the chip?
or can i just download the program as it is?

also, when i make a program do i have to do it in embedded C, or will regular C work?

thanks

---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.



I can offered some limited suggestions. I made a google search on Dev-c++
and came up with a wide variety of hits. It would be helpful if you would
provide a link to where you obtained the program, so that somebody else
could comment about the same particular Dev-c++.

With that said, I can make some general observations: file that is a .C
file is generally just your source code file, which you've typed into your
compiler environment (which could also mean you've typed using Microsoft
Notepad). The extension will be different for the file that comes out of
your compiler. Some compilers for the 68HC11 will have a default output
file of out.s19, which one might assume to be an s19 file. You also have
to use a compiler that is written for the 68HC11 to be the target, or you
won't get a 68HC11 program. Finally, I suspect that you didn't tell your
compiler to "compile". If you did, the compiler would have generated files
in addition to the .c file that you mention.

Steve

At 05:02 PM 6/19/2006, you wrote:

>Hi
>
>i managed to find a free C compiler (Dev-c++) and now i am trying to
>program my chip (m68hc11). However, i dont know how to transfer my program.
>my compiler just creates a .C file; i dont think its in the right format
>for my chip(i think the format is .s19, im not sure).
>
>do i need to convert the file then dowload the program onto the chip?
>or can i just download the program as it is?
>
>also, when i make a program do i have to do it in embedded C, or will
>regular C work?
>
>thanks

--- In m..., Ravi Haksar wrote:
>
> Hi
>
> i managed to find a free C compiler (Dev-c++) and now i am trying to program my chip
> (m68hc11). However, i dont know how to transfer my program.
> my compiler just creates a .C file; i dont think its in the right format for my chip(i think
> the format is .s19, im not sure).
>
> do i need to convert the file then dowload the program onto the chip?
> or can i just download the program as it is?

No, you need a compiler. Dev-C++ is an Integrated Development Environment. Thats
fancy talk for GUI Wrapper. Usually includes an editor. That's why its output was a .c file.

http://www.bloodshed.net/download.html says:
> Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the
> C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as
> it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC
> based compiler.

> also, when i make a program do i have to do it in embedded C, or will regular C work?

You have to use a compiler which writes code for the 68HC11. On top of that it ought to
know something about the particulars of the specific 68HC11 you are using.

The difference between "embedded C" and "regular C" has more to do with the design of
the code and the programmer's mindset. As long as the compiler writes code for the CPU
that you are using, it can be used to generate embedded code. The difference between
compilers is in how much work you have to do to get the code into the CPU. I once used
ThinkC on Mac to generate code for an MC68302. Didn't do much, but got the CPU and a
couple serial ports running enough to demonstrate it worked.

Some have made gcc for HC11 work but its far from ideal. C++ is a bad idea for HC11
class of CPU.

Many years ago I purchased Introl C11. It has proven to be an excellent compiler over the
years but currently out of business and Rich Pennington hasn't been heard from of late.

--- In m..., "n4hhe" wrote:

> Many years ago I purchased Introl C11. It has proven to be an excellent compiler over the
> years but currently out of business and Rich Pennington hasn't been heard from of late.

A bit of digging found ftp://ftp.pennware.com/introl/demos/

Last I tried the demos were fully operational. Then again I preferred a Unix command line, or
MPW (which was supported under 3.x versions of Introl compilers).

I use the Imagecraft HC11 compiler (still!) and the only quibble I have ever had with it is I was unable to allocate variables to the direct addressed area of ram. It has a free eval period. Maybe that will be good enough!

________________________________________________________________________
Check out AOL.com today. Breaking news, video search, pictures, email and IM. All on demand. Always Free.


the website for dev-c++ is www.bloodshed.net/devcpp.html

i did compile the program and it only generated a .c file and an execute file (.exe)

Steve Tabler wrote: I can offered some limited suggestions. I made a google search on Dev-c++
and came up with a wide variety of hits. It would be helpful if you would
provide a link to where you obtained the program, so that somebody else
could comment about the same particular Dev-c++.

With that said, I can make some general observations: file that is a .C
file is generally just your source code file, which you've typed into your
compiler environment (which could also mean you've typed using Microsoft
Notepad). The extension will be different for the file that comes out of
your compiler. Some compilers for the 68HC11 will have a default output
file of out.s19, which one might assume to be an s19 file. You also have
to use a compiler that is written for the 68HC11 to be the target, or you
won't get a 68HC11 program. Finally, I suspect that you didn't tell your
compiler to "compile". If you did, the compiler would have generated files
in addition to the .c file that you mention.

Steve

At 05:02 PM 6/19/2006, you wrote:

>Hi
>
>i managed to find a free C compiler (Dev-c++) and now i am trying to
>program my chip (m68hc11). However, i dont know how to transfer my program.
>my compiler just creates a .C file; i dont think its in the right format
>for my chip(i think the format is .s19, im not sure).
>
>do i need to convert the file then dowload the program onto the chip?
>or can i just download the program as it is?
>
>also, when i make a program do i have to do it in embedded C, or will
>regular C work?
>
>thanks

---------------------------------
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta.



the m68ch11 can be programmed in C; dev-c++ can do both C and C++

n4hhe wrote: --- In m..., Ravi Haksar wrote:
>
> Hi
>
> i managed to find a free C compiler (Dev-c++) and now i am trying to program my chip
> (m68hc11). However, i dont know how to transfer my program.
> my compiler just creates a .C file; i dont think its in the right format for my chip(i think
> the format is .s19, im not sure).
>
> do i need to convert the file then dowload the program onto the chip?
> or can i just download the program as it is?

No, you need a compiler. Dev-C++ is an Integrated Development Environment. Thats
fancy talk for GUI Wrapper. Usually includes an editor. That's why its output was a .c file.

http://www.bloodshed.net/download.html says:
> Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the
> C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as
> it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC
> based compiler.

> also, when i make a program do i have to do it in embedded C, or will regular C work?

You have to use a compiler which writes code for the 68HC11. On top of that it ought to
know something about the particulars of the specific 68HC11 you are using.

The difference between "embedded C" and "regular C" has more to do with the design of
the code and the programmer's mindset. As long as the compiler writes code for the CPU
that you are using, it can be used to generate embedded code. The difference between
compilers is in how much work you have to do to get the code into the CPU. I once used
ThinkC on Mac to generate code for an MC68302. Didn't do much, but got the CPU and a
couple serial ports running enough to demonstrate it worked.

Some have made gcc for HC11 work but its far from ideal. C++ is a bad idea for HC11
class of CPU.

Many years ago I purchased Introl C11. It has proven to be an excellent compiler over the
years but currently out of business and Rich Pennington hasn't been heard from of late.

---------------------------------
Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.



if dev-c++ needs a GCC, can you recommend one that is pretty good?

if dev-c++ is used in combination with a GCC can it generate files that can be directly downloaded onto the chip?

thanks

n4hhe wrote: --- In m..., Ravi Haksar wrote:
>
> Hi
>
> i managed to find a free C compiler (Dev-c++) and now i am trying to program my chip
> (m68hc11). However, i dont know how to transfer my program.
> my compiler just creates a .C file; i dont think its in the right format for my chip(i think
> the format is .s19, im not sure).
>
> do i need to convert the file then dowload the program onto the chip?
> or can i just download the program as it is?

No, you need a compiler. Dev-C++ is an Integrated Development Environment. Thats
fancy talk for GUI Wrapper. Usually includes an editor. That's why its output was a .c file.

http://www.bloodshed.net/download.html says:
> Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the
> C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as
> it's compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC
> based compiler.

> also, when i make a program do i have to do it in embedded C, or will regular C work?

You have to use a compiler which writes code for the 68HC11. On top of that it ought to
know something about the particulars of the specific 68HC11 you are using.

The difference between "embedded C" and "regular C" has more to do with the design of
the code and the programmer's mindset. As long as the compiler writes code for the CPU
that you are using, it can be used to generate embedded code. The difference between
compilers is in how much work you have to do to get the code into the CPU. I once used
ThinkC on Mac to generate code for an MC68302. Didn't do much, but got the CPU and a
couple serial ports running enough to demonstrate it worked.

Some have made gcc for HC11 work but its far from ideal. C++ is a bad idea for HC11
class of CPU.

Many years ago I purchased Introl C11. It has proven to be an excellent compiler over the
years but currently out of business and Rich Pennington hasn't been heard from of late.

---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.



Ravi Haksar wrote:

I'd prefer that you not top post.

> if dev-c++ needs a GCC, can you recommend one that is pretty good?

You might look into Stephane Carre's port.

> if dev-c++ is used in combination with a GCC can it generate files that can be directly downloaded onto the chip?

I know nothing about your package, but judging from what I've seen
here, it's just a graphical front end for whatever toolset you
choose to use. So it will do whatever the underlying tools can
do. Stephane's port generates S19 records. Whether you can load
them depends on what you use to communicate with your machine.

The port I'm recommending is not easy to install or use, however.
You might look into getting the freeware ICC11. It's rather old,
and runs only with an MSDOS emulator, but it is free and easy to
install. The GCC port does not have much in the way of support
library, like sprintf() etc. It's a non-hosted environment.

If you get desperate, I've done a back end of Small C which
works well. It's easy to install and use, but it is only a
subset of C. No struct, no union, no float (though I do have
a float package I wrote, it would be clumsy and need some
assembly language glue), and no pointer-to-pointer or array-of-
pointer. If you can live with that, then I could build you a
version to run on your machine. It uses ASXXXX as the assembler.

> thanks

Well, HTH

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!
I have gone to effort to reformat this entire message the way it
should have been in the archives. Be sure to read the whole thing
because the quoted sections were retained because I don't think you
read them the first couple of times.

On Jun 20, 2006, at 10:44 PM, Ravi Haksar top-posted:

> if dev-c++ needs a GCC, can you recommend one that is pretty good?
>
> if dev-c++ is used in combination with a GCC can it generate files
> that can be directly downloaded onto the chip?
>
> thanks
>
> n4hhe wrote:
>> You have to use a compiler which writes code for the 68HC11. On
>> top of that it ought to know something about the particulars of
>> the specific 68HC11 you are using.
>>
>> The difference between "embedded C" and "regular C" has more to do
>> with the design of the code and the programmer's mindset. As long
>> as the compiler writes code for the CPU that you are using, it can
>> be used to generate embedded code.

[...]

>> Some have made gcc for HC11 work but its far from ideal. C++ is a
>> bad idea for HC11 class of CPU.

You are in the wrong Yahoo! Group for that answer. Try
http://groups.yahoo.com/group/gnu-m68hc11/messages/

>> Many years ago I purchased Introl C11. It has proven to be an
>> excellent compiler over the years but currently out of business
>> and Rich Pennington hasn't been heard from of late.

Guessing you missed my followup:
http://groups.yahoo.com/group/m68HC11/message/2803?l=1 where I said:
>
> A bit of digging found ftp://ftp.pennware.com/introl/demos/

The Introl C-11 compiler (which can be downloaded from the above URL
which is hosted by the owner of the code, but has uncertain license)
generates excellent code and is purpose-made for embedded use. In
Introl terms "CODE" was their GUI IDE written in TCL/TK. "CODE" was
also the name used to collectively describe the whole "Introl CODE"
product. The tools also work from DOS or Unix command lines without
the fool GUI.

GCC-6811 writes code which works, but the code is inefficient, slow,
and larger than it should be. If you must use gcc then you are using
the wrong CPU. Gcc for the AVR works very very well. As you are
Windows-limited see
http://winavr.sourceforge.net/

Freescale now owns Metrowerks, lock stock and barrel. Typically
offers free versions with limited generated code size. Know the HC12
version was good for 32k but don't know if any HC11 version was ever
offered. Otherwise its easy to get an unlimited "trial" 30 day
license, just ask for it, one is usually included in the download.

--
David Kelly N4HHE, d...@HiWAAY.net
=======================================================================Whom computers would destroy, they must first drive mad.