Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

Configuration bit ERROR

:: EPE Chat Zone ≠:: ≠Radio Bygones Message Board :: » EPE Forum Archives 2010 - » Archive through 02 October, 2014 » Configuration bit ERROR « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

rollestonian
Valued Member
Username: rollestonian

Post Number: 19
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 30 September, 2014 - 02:50 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

In trying to run a program in MPLAB using a 16F1827 chip with the following configuration :-

__CONFIG1 _FOSC_XT & _WDTE_OFF & _PWRTE_ON & _CP_OFF

I receive this error message

Error[122] C:\MY_MPLAB_DOCS\VTAILMIXER.ASM 38 : Illegal opcode (_FOSC_XT)

I have checked with the .INC file for the 16F1827 and it appears to be correct. I would be grateful for any help or advice.

Regards
Ken.
Top of pagePrevious messageNext messageBottom of page Link to this message

mikehibbett
:::: Super User ::::
Username: mikehibbett

Post Number: 1634
Registered: 04-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 30 September, 2014 - 02:54 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Try taking _FOSC_XT & out. Do you still see a problem?

I wonder if you have the __CONFIG1 starting in the correct column? I forget where that is in assembler. It can be fussy if in the first column, or not in the first column. Can you upload the complete file?
-------------------
web: mjhdesigns.com twitter: mikehibbett YouTube Channel: http://goo.gl/6bzjov
-------------------
Top of pagePrevious messageNext messageBottom of page Link to this message

rollestonian
Valued Member
Username: rollestonian

Post Number: 20
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 30 September, 2014 - 04:39 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi. Mike.

Thanks for the reply. The error message now reads :-

_MPLAB_DOCS\VTAILMIXER.ASM 41 : Illegal opcode (_WDTE_OFF)

So perhaps it is the position on the line that counts. I'll give it a go and come back later.

Regards
Ken.
Top of pagePrevious messageNext messageBottom of page Link to this message

mikehibbett
:::: Super User ::::
Username: mikehibbett

Post Number: 1636
Registered: 04-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 30 September, 2014 - 04:42 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

If you go to this link

http://ww1.microchip.com/downloads/en/DeviceDoc/31027a.pdf

and page 6, "27.2.1 MPASMís CONFIG Directive"

It should make it clear for you.

Please let us all know what the solution was in the end.

Thanks,

Mike.
-------------------
web: mjhdesigns.com twitter: mikehibbett YouTube Channel: http://goo.gl/6bzjov
-------------------
Top of pagePrevious messageNext messageBottom of page Link to this message

bowden_p
Frequent Contributor
Username: bowden_p

Post Number: 362
Registered: 01-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 02 October, 2014 - 07:59 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi Ken,
For the Enhanced Mid-Range device 16F1509 I had a problem too with configuration, but found this format worked :-
__config _CONFIG1,0x09C2 ; Configuration bits.
__config _CONFIG2,0x3FFF

(The first character on each line is a 'tab', followed by 2 'underscores', then 'config', 'space', 'underscore', 'CONFIG1,0xhhhh'.)
This also worked for the 16F1789.

I didn't try it with the '&' type of format however. This is with MPLAB IDE v8.91.
With regards, Paul.
Top of pagePrevious messageNext messageBottom of page Link to this message

rollestonian
Regular Contributor
Username: rollestonian

Post Number: 22
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 02 October, 2014 - 08:25 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi Mike,

Thanks for the interesting "27.2.1 MPASMís CONFIG Directive" which I was just getting to grips with when Paul's solution arrived and it works like a charm. Many thanks Paul. In fact it is for an HS oscillator but I think I can calculate the correction to the code for the XT.

Thanks again to you both.
Ken.
Top of pagePrevious messageNext messageBottom of page Link to this message

bowden_p
Frequent Contributor
Username: bowden_p

Post Number: 363
Registered: 01-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 02 October, 2014 - 08:49 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi Ken,
It's worth checking the Errata sheet for this device. Silicon issues A6 and A7 look "reasonably" sorted, but earlier versions are not so good, and may affect your application!

The config codes I have used come from the "Configure" tab - "Configuration Bits..." window in MPLAB, after selecting the relevant chip from "Configure" - "Select Device...".
With regards, Paul.

(Message edited by bowden_p on 02 October, 2014)

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page