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.

Suddenly plagued by Error [126]

Status
Not open for further replies.

AGCB

Member
In the last few days I've been getting an error when compilling MPLAB. I'm using a 16F628A.

No matter how I write the config word, hex or spelled out according to .inc file, I get a
Error[126] argument out of range (not a valid config register address)

Here is one example that doesn't work
_XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BOREN_OFF & _LVP_OFF

But I have tried many

Do you see anything obviously wrong or is there some setting that I have wrong in the IDE program? I've never seen this error before. Aaron
 
It should be this

Code:
	__CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BOREN_OFF & _LVP_OFF

I would use this one myself but that's just me it makes sure code protect is off

Code:
__CONFIG   _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _XT_OSC
 
Last edited:
Sorry, I didn't write the __CONFIG part but it is in my code, so it looks just like yours.I.E
__CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _BOREN_OFF & _LVP_OFF
 
I agree, but it doesn't. This has been near constant with every program try lately. There must be something set wrong somewhere but I have searched and tried many things to no avail
 
I FOUND THE PROBLEM!

And yes there were 2 underscores.

Up untill now I had been using F84A exclusivly and it was the selected device in the configuration tab. I never had to even look at that because it just stays selected untill changed. But now that I am trying different pics, I failed to reallize that with each different pic the device must be selected correctly. Creaturly habits sometimes nab us.

Thanks for the replies (they confirmed that my config wording was correct) and your interest.

Aaron
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top