Searching \ for 'Printf in HI-Tech C' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/language/index.htm?key=c
Search entire site for: 'Printf in HI-Tech C'.

Truncated match.
PICList Thread
'Printf in HI-Tech C'
1999\07\18@185921 by Les

flavicon
picon face
Hi
       Could anyone tell me what printf does in the Hi-Tech C compiler
where does the serial data come from i.e (is it software generated on the
84's and hardware on the UART pics) and are there any #defines for this
command. The manual is written as if it were for a PC compiler not pic. And
how do I set the config bits I know it is _CONFIG but what do I place after
it to make it xt_osc and wdt_off on a 16F877. The makers of the compiler
should have a section for learners of C. I believe that if you wish to learn
a language you must have the best tools and I thought the HI-Tech was the
one, but I think I was sadly mistaken.

                           Thankyou
                                           Les

1999\07\18@213507 by Clyde Smith-Stubbs

flavicon
face
On Mon, Jul 19, 1999 at 12:04:29AM +0100, Les wrote:
>         Could anyone tell me what printf does in the Hi-Tech C compiler
> where does the serial data come from i.e (is it software generated on the

See section 4.29 in the manual "Standard I/O functions and serial I/O". PAge
96 in my copy.

> how do I set the config bits I know it is _CONFIG but what do I place after
> it to make it xt_osc and wdt_off on a 16F877. The makers of the compiler

You need to read the chip documentation for this. Look up the CONFIG register
bits in the Microchip data sheet, and put these in. For example,

__CONFIG(0x3FB1);

would set code protection off, ICD off, flash memory write enabled,
data EEPROM write enabled, low voltage programming enabled, brown out
reset disabled, power up timer enabled, watchdog disabled, and XT oscillator.

> should have a section for learners of C. I believe that if you wish to learn
> a language you must have the best tools and I thought the HI-Tech was the
> one, but I think I was sadly mistaken.

To learn a language, you need to remove as many difficulties as possible. You
are far better to learn C programming before you try to program a PIC in C.
You need to be able to walk before you can run.

Regards, Clyde

--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: spam_OUTclydeTakeThisOuTspamhtsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger .....clydeKILLspamspam@spam@htsoft.com   | AUS: +61 7 3355 8333 +61 7 3355 8334
---------------------------------------------------------------------------
HI-TECH C: compiling the real world.

1999\07\18@231556 by Bob Blick

face
flavicon
face
Hi Les,

I can certainly understand your frustration, it's probably something
they've heard many times. The manual is not a guide to C or to the PIC. It
is a manual for HiTech C for the pic, and it's pretty dry and aimed at
someone who already knows C and already knows PICs.

It is a very professional product, so you should not give up. The code it
generates is superior to the cheaper alternative. Far superior.

I don't think they should change the manual, but it'd be great if they
made a second manual, like "HiTech PIC C for Dummies" that used examples
for beginners to get started. hint hint :-)

There are examples for doing exactly what you want, they should have
installed when you set up the compiler. Bit-banging serial output is
there, and Clyde already pointed you how to alert printf where you want
the data to go.

I'd tell you, except I avoid printf because of the amount of codespace it
uses.

Friendly regards,
Bob

1999\07\19@015343 by Dennis Plunkett

flavicon
face
At 20:13 18/07/99 -0700, you wrote:
>Hi Les,
>
>I can certainly understand your frustration, it's probably something
>they've heard many times. The manual is not a guide to C or to the PIC. It
>is a manual for HiTech C for the pic, and it's pretty dry and aimed at
>someone who already knows C and already knows PICs.
>

Yes they have, it is an older style set-up (Sorrya about that Clyde), but
the manual has not changed it's form since the early days much (It has
gotten better, you should have seen some of the very early ones)

>It is a very professional product, so you should not give up. The code it
>generates is superior to the cheaper alternative. Far superior.
>
Agreed, I think that this person has been misinformed, but not mislead as
Hi-Tech is by far the better product (Just ask Andy!)


>I don't think they should change the manual, but it'd be great if they
>made a second manual, like "HiTech PIC C for Dummies" that used examples
>for beginners to get started. hint hint :-)
>
I have requested this several times, but I have found that there is more
than enough when you search through the code that is supplied. And one of
the good things is that ALL Hi-Tech compilers look and feel the same!
Some getting started stuff would be good, but just look at the number of
possible target variations that may have to be incured, nightmare on PCB!
I think that there may be some room for someone to sell a development board
with some C-for dummies


>There are examples for doing exactly what you want, they should have
>installed when you set up the compiler. Bit-banging serial output is
>there, and Clyde already pointed you how to alert printf where you want
>the data to go.
>
Yep, just direct the I/O the user will have to search for the puts and gets
thingo which is in the manual on customisation and serial ports etc. Also
have a look at the source code.

>I'd tell you, except I avoid printf because of the amount of codespace it
>uses.
>
Always when you see printf and floating point in a simple embbeded
processor one can assume that the programmer hasnot delbt with such before
(Not being nasty, just a general comment)


>Friendly regards,
>Bob
>
>

Dennis

1999\07\19@024201 by Andrew Kalman

picon face
Bob Blick wrote:

>It is a very professional product, so you should not give up. The code it
>generates is superior to the cheaper alternative. Far superior.

I'll second that.  It's an _excellent_ product, and I continue to be
pleasantly surprised at how powerful it really is. But it's a bit daunting
for beginners.

I learned C through Mix Software's Power C compiler (it's for the PC),
which costs only $29 and has an excellent 660-page printed manual.  Check
it out at http://www.mixsoftware.com

BTW, I gave up on trying to integrate a fairly large project (many source
files) in Hi-Tech PIC-C with the MPLAB IDE.  Instead,  I run the HPDPIC
IDE, MPLAB and CodeWarrior concurrently, with a project in HPDPIC and an
"empty" project open in MPLAB which simply points to the object file HPDPIC
is generating. I edit in CodeWarrior, compile in HPDPIC, and download and
debug with a PICMASTER in MPLAB.  I find this to be a very fast way to
work, because it draws on the strengths of the individual products (CW's
editor, HPDPIC's project management environment, MPLAB's debugging windows).



___________________________________________
| Andrew E. Kalman, Ph.D.   aekspamKILLspamnetcom.com  |
|        standard disclaimers apply         |
|___________________________________________|

1999\07\19@055208 by Clyde Smith-Stubbs

flavicon
face
On Sun, Jul 18, 1999 at 08:13:57PM -0700, Bob Blick wrote:

> I don't think they should change the manual, but it'd be great if they
> made a second manual, like "HiTech PIC C for Dummies" that used examples

Actually, as we speak (figuratively speaking) there is a tutorial
chapter being added to the manual. It will be gradually expanded.


--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: .....clydeKILLspamspam.....htsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger EraseMEclydespam_OUTspamTakeThisOuThtsoft.com   | AUS: +61 7 3355 8333 +61 7 3355 8334
---------------------------------------------------------------------------
HI-TECH C: compiling the real world.

1999\07\19@061322 by Michael Rigby-Jones

flavicon
face
> Hi
>         Could anyone tell me what printf does in the Hi-Tech C compiler
> where does the serial data come from i.e (is it software generated on the
> 84's and hardware on the UART pics) and are there any #defines for this
> command. The manual is written as if it were for a PC compiler not pic.
> And
> how do I set the config bits I know it is _CONFIG but what do I place
> after
> it to make it xt_osc and wdt_off on a 16F877. The makers of the compiler
> should have a section for learners of C. I believe that if you wish to
> learn
> a language you must have the best tools and I thought the HI-Tech was the
> one, but I think I was sadly mistaken.
>
>                             Thankyou
>                                             Les
>
Les, I think you are mistaken.  The HiTech complier is one of the best C
compilers for the PIC.  It is a proffesional tool, designed for proffesional
users.  That isn't to say a hobbiest couldn't use it, but starting with this
compiler as your first ever C experience will be frustrating.  Learn C, by
getting a decent reference book and by using a DOS compiler and then start
on the PIC's.  Then you will appreciate what a powerfull tool PIC C really
is.

Regards

Mike Rigby-Jones

1999\07\19@080037 by Dan Creagan

flavicon
face
On Sun, Jul 18, 1999 at 08:13:57PM -0700, Bob Blick wrote:
>
>> I don't think they should change the manual, but it'd be
great if they
>> made a second manual, like "HiTech PIC C for Dummies"
that used examples
>

And then, Clyde Smith-Stubbs said:
>
>Actually, as we speak (figuratively speaking) there is a
tutorial
>chapter being added to the manual. It will be gradually
expanded.
>


Now that is good news.

I think this is what I was thinking of when I loosely said
'no examples' in Hi-Tech.  Examples would include the very
basic information as well as the more advanced solutions to
difficult problems.  The simple examples are good for people
just picking up the compiler.  Since the PIC C compilers are
very closely tied to the PIC architecture, even if someone
knows C, there is a learning curve. Simple examples get them
started on the learning curve.

With PIC enthusiasm increasing like it is, this could be a
super-attractive marketing aspect of the compiler.

Dan

1999\07\19@104245 by Jim Ham

flavicon
face
I find the HiTech manual organized nicely. It is _not_ a C tutorial.
Perhaps I'm in the minority, but I wouldn't change it. Another manual or
another section of the manual for beginners would be a good idea.

Code generation is really quite good. Many times when I debugging I find
code that I couldn't improve on. It's certainly the best compiler I've
worked with in terms of generated code.

I work with two development environments. When I'm doing heavy editing and
writing I use a DOS window, Brief (does that date me?), and Borland make.
My current project has 13 source files excluding include files. Once I'm
happy with an edit, I move to MPLAB to do the debugging. Since I added the
paths for the include files MPLAB make works OK. Since I'm using a
PicMaster, I don't have much choice about using MPLAB. This is a 17C756
project.

The lastest version of the HiTech compiler merges well with the latest
MPLAB. It is a great improvement over previous versions. I don't know if
this is Clyde's work or Microchip's work, but Good Job!.

Regard, Jim Ham

At 11:46 PM 7/18/99 -0800, you wrote:
{Quote hidden}

Jim Ham, Porcine Associates
(650)326-2669 fax(650)326-1071
"http://www.porcine.com"

1999\07\20@095153 by kfinney

picon face
I concur with those who hold the Hi-Tech product in high regard. The single
most
valuable feature it has, I think, is its dependability, both the manual and
the compiler.

When I need to find something in the manual, it is organized in a fashion
similar
to many compiler manuals in the past that I have dealt with, so I never feel
that
I'm going to waste time looking in it for something. (rummage, rummage,
anyone wanna see
my AT&T C manual, - how about the 'yellow' book ? What's this here ? Unix
BSD 4.2 cc man pages !
compared to some of these, the Hi-Tech manual is golden).

The compiler is dependable, as well: few, if any, surprises in the code it
generates or what it accepts in the way of constructs (side-effect
philosophies not-withstanding....8^).

In some ways, it is amazing that a compiler for an embedded controller can
be more ANSI conforming (or compliant, or compatible, or whateverthehell it
is that I mean) than some
recent 'big-time' compilers for multi-user systems.

We use C because it saves time and still allows us to do whatever we need
to, quickly and efficiently, to manipulate a chip. Compilers like CCS with
their 'ever-so-tempting' handy features, like built-in serial routines or
I2C, can end up taking more time debugging; one never knows quite what the
compiler is doing behind the scenes unless one dives into the asm code
to check it out - well, what happens to the time-savings then ?

-----------------------------------------
Kenneth C. Finney
=========================================
Wilkes Associates, Inc.
Software Engineering - Embedded Systems
Design & Development - Project Management
=========================================
Office:  (416) 445-9224
Mobile:  (416) 453-6400
-----------------------------------------

>
>
> I find the HiTech manual organized nicely. It is _not_ a C tutorial.
> Perhaps I'm in the minority, but I wouldn't change it.
> Another manual or
> another section of the manual for beginners would be a good idea.
>
> Code generation is really quite good. Many times when I
> debugging I find
> code that I couldn't improve on. It's certainly the best
> compiler I've
> worked with in terms of generated code.
[snip]
>
> The lastest version of the HiTech compiler merges well with
> the latest
> MPLAB. It is a great improvement over previous versions. I
> don't know if
> this is Clyde's work or Microchip's work, but Good Job!.
>
> Regard, Jim Ham

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...