Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F does not like me today

Status
Not open for further replies.

Dr_Doggy

Well-Known Member
I started with 16f526, which i now realize has no eeprom, i thought it had a small flash memory though(?) , but i am thinking of upgrading anyway to the 16F630,

because in GreatCowBasic:
my old chip also is starting to give me non-common banked ram error when i add this line:
VccBat = ReadAD(AN1)
VccSolar = ReadAD(AN2)

but when i try to complie for 16f630 i get 3 of these errors from the same 2 lines
error in library a-d.h incorect parameters

so wat thought, its time i switched up anyway, dragging objects like that get tedious after while, so i switched to hi-tec C ,, but i think i am having problem with h filessome of<includes>, and those lang change challenges we run in to , for adc and eeprom(flash)
researching on this i noted that there were ver issues, especially with things like name of ADRESL, which turned out to be something like ADRES,

also do i add my includes like in MPLAB for 18f?

im testing vb.net and i think they import framework that uses h's , do these work similar, and could i use vb.net as compiler?

also while ripping up these h files i noticed the correlations between my c++ instructions and the blocks on the datasheets, is this how all h files work, maybe i should do myown?

also i want to learn about instruction family such as #ifdef #config #include...ect?,,, what am i looking for?

is there better compiler other than posted above?
 
I don't think the original HiTech is maintained anymore.... XC8 from microchip is HiTech, but includes for all the newer chips..

Have a look at the tutorials I have done.... They are in the article section.... Sometimes its easier to write your own stuff..
 
Thnx Ian,

found it, i always forget that changing include is not enough when swapping chips, i always forget to configure.select device!

i notice now that it was also strange that i don't include things the same, only the pic.h and htc.h files?


and there is a rebuild button which always returns errors,
the main reason i couldn't figure this all out thou, is cause the build button returns errors on the first press , but then compiles ok on second press!?!

also what is the library called if i want to learn about these objects such as #ifdef #config #include...ect?
 
If the OP wants to use a high level language he should stay with the 18F or enhanced 16F chips.
ASM is best for the earlier generation small PICs
 
Oooh..... You'll start WWIII with a statement like that..

Not really :D - he's essentially correct, as is proved by all the application notes and datasheets using assembler.

It's only on the later and higher spec devices that C appears in the application notes and datasheets. It's been suggested that the enhanced 14 bit devices were developed to improve the use of C on those devices.

Incidentally, I'm currently playing with XC8 - and dabbled with a few of your C tutorials - thanks for that :D
 
There is truth in the ASM better than C.. I know ASM is far better but only if you know what you are doing...

The story is... There are people who are experienced enough to write a compiler with full optimization, producing code that comes out as tight as the assembled version, well then there are some with little experience and they can produce less code in C than they would using an assembler.....

I have seen that you can produce pretty tight code.. I checked tutorial 6.6 ( the largest one you did for the pic16f628a ) and I have compiled with full optimization in C and assembled yours.. the code isn't much bigger on the C version..

Of course it helps if you can write tight code in C as well....

In the tutorials I had to use the pic16f648a as it had twice the code space as I was using lite mode so others could use it..
 
got it!, and coded everything ok, with the chip almost full, now in hi-tec!
I'm sorry to have started a war, and actually gave a though to learning asm enough to go to youtube and see what it was like, it would be handy to learn to get in to the "core" of my processor
but decided against because iv already dedicated my next learning curve towards higher levels, ie AI & 3D,
Plus i already broke a promise to myself to never use a 16f chip for more than a 555 replacement or another discrete
so going forward I now promise OUTLOUD that from now on i will spend the extra dollar and buy the 18f, minimum.
As i am truly lost when i need to flash a LED instead of ICSP debugging with breakpoints and watches

but thnx for the fix!
 
The story is... There are people who are experienced enough to write a compiler with full optimization, producing code that comes out as tight as the assembled version.....

I wish some of those programmers had written XC8. ;)

Mike.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top