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.

urgent help

Status
Not open for further replies.
falleafd said:
I'm trying using CCS PCW C. However, it's an old version, and I cannot find 16f876a.h file. So how can I program for it?

It's very little different to the 16F876, if you look at https://www.electro-tech-online.com/custompdfs/2004/06/39591a.pdf it lists the differences. Basically the 876A has added comparators, but according to the migration datasheet above these are disabled on power up, so the code required is identical to the standard 876.

So just use it set to 876.
 
falleafd said:
Yes, I know that 876 and 876a is the same in coding. However, we have to configure the chip in programming. Therefore, I would like to ask if you can use the same coding and using programmer for 876a? May we do this?

The problem is that my CCS C is old version. I use MPASM but trying using CCS C

I'm not sure what you are asking?, do you mean the setting of the config fuses?.

The config fuses are slightly different, but simply setting it with a line like "__config 0x3BFF" rather than using the longer method would overcome that. Assuming the fuse settings are contained in the header file you mentioned, you could simply edit the existing header to make a new one, with the fuse settigns modified.

Also, you could simply set the fuses in your programmer software.
 
No, I talk about choosing the device.

Will the hex file complied contents the device selection?

For example, in MPLAB, we may write

Code:
processor	16f628
		include	<p16f628.inc>
		__CONFIG   _CP_OFF&_PWRTE_ON&_WDT_OFF&_HS_OSC

To select 16f628

And in CCS C we may write

#include <16f876.h>

to use 16f876 (because in 16f876.h, it contents device selection

as

#device PIC16F876

I cannot rename it in CCS C to #device PIC16f876A, because it doesn't understand.

So how can I program to 16f876a?

That is my question

I intend that:

Coding with 876, and compile to ASM file. Copy ASM file to MPLAB, and change the device selection!!!

Is this good?

Is there any solution?
 
The device selection doesn't matter, Like Nigel said before, there is almost no diffirence between 16f876 and 16f876a as far as code is concerned. Just use the 16F876 settings and compile it for that processor, the generated code will work on a 16f876a...

I don't know the config settings are the same for both processors, but you could always change them manually in the programmer software
 
I'm still struggling to understand your problem?.

There's no device information in a HEX file, simply compile your code for an 876, it's no different code wise to an 876A - the only difference is a slight change in the config fuses - and you can either alter this in the programmer, or in your C source code. Presumably C allows you to set config fuses?.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top