Nigels Tutorials / K8048 / PIC15F627

Status
Not open for further replies.

jaymz

New Member
First - thanks for the Tutorials, Nigel! (I'm only getting through the first page right now)
Second - Since I bought a k8048 without knowing anything about PICs or microcontrollers, I'm trying to keep notes on changes i needed to do to accomodate the k8048 here > **broken link removed**
My question is, why did changing the config to "3F61" help, I got that config value when i wrote one of the demo programs to the pic.
Any other tips or notes would be appreciated. thanks
 
I only set the required bits, in most PIC's there are a number of unused bits - so I mask out the unused ones. My programmer software WinPicProg does the same, so this ensures verification works correctly.

If your software requires unused bits to be set high (which might not always be true?), you will need to alter the config value accordingly.
 
jaymz said:
My question is, why did changing the config to "3F61" help, I got that config value when i wrote one of the demo programs to the pic.
Any other tips or notes would be appreciated. thanks

The "3F61" is a configuration word in HEX notation. You need to break it down into individual bits (spaces added for clarity only) "11 1111 0110 0001". Why the user wants a certain bit "1" or "0" depends on how one wants to use the PIC for and these bits can only be changed after the PIC is erased and reprogrammed.

For example, one of above bits determine whether the PIC can be programmed by low voltage(+5V) only and others determine features like watch-dog timer etc.....

You can look up the meaning of each bit in the datasheet, section "Special Features of CPU".
 
Hi Nigel,

Is there a reason you're not using a '__config' line in your example programs? It might help newcomers with that tricky config' stuff... I remember it took me a week to get my very first program running a couple years ago because I didn't have a handle on the config' fuses...

Kind regards, Mike
 

ALL my tutorials include it, here's the first few lines from my first tutorial:

Code:
      	;Tutorial 1.1 - Nigel Goodwin 2002
	LIST	p=16F628		   ;tell assembler what chip we are using
	include "P16F628.inc"	;include the defaults for the chip
	__config 0x3D18			;sets the configuration settings 
					            ;(oscillator type etc.)
.
 
Forgive me, I wasn't clear... What I meant to say is why wouldn't you use the config fuse labels in the operand? Wouldn't they be a more intuitive operand compared to that 14-bit hex value?

Code:
	#include	<p16f628A.inc>

	__config	_PWRTE_ON & _LVP_OFF & _WDT_OFF & _HS_OSC & _MCLRE_OFF

Kind regards, Mike
 

I didn't use them because it's too prone to typing errors, and looks rather confusing and intimidating. Personally I never use them, it's easier to type in the HEX number - and WinPicProg (by some strange coincidence?) displays the value for you when you select the fuses. 8)
 

Thank you for the explanation, but, are you suggesting that newcomers should actually bring up programming software of some kind and fiddle with the fuse settings in order to copy the resulting 14-bit hex value into the config' line in their source file?

Kind regards, Mike
 

No, I'm suggesting that they leave them alone! - they are set as they need to be for my tutorials.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…