Let's Make Robots!

From PIC 16F628 and PIC16F876 to PIC16F876A


I where using a PIC16F628 when i where making som experiment with PWM, but i need 2 PWM output. So i deciede to get a PIC16F876, but by mistake i got a PIC16F876A, now i got some very big problems, cant figure out how to set _config.

My other problem, is that i also have some tutorials with A/D converting for a PIC16F876, can i also use that code for a PIC16F876A, or is the _config different?

So all in all, my problem is that i cant figure out how to set _config for the PIC16F876A, so that i can use it for both 2 PWM output, and 3 input for A/D converting. (1 input, where it have to be able to measure diferent length, and the 2 others just need to be either high or low)

I am writing the code in assembler kode, in microlab. If you need more info about it, please let me know. Thanks :0)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Ok, thanks. will try and look trough the datasheet again, just last time i did it, i couldent find any info about Config setup. Even tryede searching for it via ddatasheet in pdf format. Maybe i overlokked it, as the word config is written many times in the datasheet.

Do you know what page it is on, where i can see info just about config setup?

Tried to get a PIC16F876, but couldent find any in the stores where i live :0(

So think i will have to deal with the 16F876A, just not so good with writing software.

The 876A is the more recent version anyway, it replaces the 876. Page 142 in the 16F876A datasheet has the configuration word info.

All the info you need is in the datasheets available from Microchip.

The configuration word options are slightly different for the 16F876 and the 16F876A, as the code protection bits are altered. You could use the same code and it would work, but it'd be better to actually look at the config word options and make sure they're set up correctly.

Similarly the A/D converter modules are slightly different, so the code will need some tweaking to make sure it runs perfectly, although it will once again work with the original code too. The config word doesn't really have anything to do with the A/D module directly.

The PWM module outputs (CCPx) and analog inputs (ANx) do not share any pins, so you can run both at the same time with no interference. The config word doesn't affect these pins either.