Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 16, 2024, 09:15:53 09:15


Login with username, password and session length


Pages: [1]
Print
Author Topic: configoration word in picbasicpro  (Read 10684 times)
0 Members and 1 Guest are viewing this topic.
hamid9543
Active Member
***
Offline Offline

Posts: 124

Thank You
-Given: 80
-Receive: 7


« on: January 16, 2008, 09:40:27 09:40 »

hi
i write below code in picbasicpro for configoration word(MEMORYADDRESS $2007) but error
code1)
@device hs_osc
and code2)
@  __CONFIG  HS_OSC&_WDT_ON

CAN YOU HELP ME?
Logged
mississippi1
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 26
-Receive: 7


« Reply #1 on: January 16, 2008, 06:04:50 18:04 »

here an example how it can.

      @ DEVICE PIC16F628,INTRC_OSC_NOCLKOUT
      @ DEVICE PIC16F628,MCLR_OFF
      @ DEVICE PIC16F628,BOD_ON
      @ DEVICE PIC16F628,LVP_OFF
      @ DEVICE PIC16F628,CPD_OFF
      @ DEVICE PIC16F628,PROTECT_OFF

This will fill the configuration word propperly when using PicBasic Pro from Melabs.

Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #2 on: January 16, 2008, 06:19:41 18:19 »

These 2 link's should answer all your question's
http://www.picbasic.co.uk/forum/showthread.php?t=543&highlight=configuration+fuse
http://www.melabs.com/support/config_defaults.htm
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
ArySoft
Inactive

Offline Offline

Posts: 5

Thank You
-Given: 4
-Receive: 1


« Reply #3 on: January 16, 2008, 07:49:54 19:49 »

Example: Typical Settings for a 16F628…

@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
' System Clock Options
@ DEVICE pic16F628, WDT_ON
' Watchdog Timer
@ DEVICE pic16F628, PWRT_ON
' Power-On Timer
@ DEVICE pic16F628, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic16F628, BOD_ON
' Brown-Out Detect
@ DEVICE pic16F628, LVP_OFF
' Low-Voltage Programming
@ DEVICE pic16F628, CPD_ON
' Data Memory Code Protect
' Set to CPD_OFF for Development Copy
' Set to CPD_ON for Release Copy
@ DEVICE pic16F628, PROTECT_ON
' Program Code Protection
' Set to PROTECT_OFF for Development Copy
' Set to PROTECT_ON for Release Copy

Logged
jorge7458
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 7
-Receive: 14


« Reply #4 on: January 16, 2008, 10:49:10 22:49 »

Hello 
This is been worth when it is assembled with the characteristic of PBP and not with that of microchip.- 
Jorge
Logged
hamid9543
Active Member
***
Offline Offline

Posts: 124

Thank You
-Given: 80
-Receive: 7


« Reply #5 on: January 17, 2008, 09:07:47 09:07 »

hi and thx for quick replay.i write code:
Code:
'*  Date    : 2008/01/17                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
@ DEVICE PIC16F877A,HS_OSC
define osc 20
trisb=$00
while 1
portb=0
pause 1000
portb=1
pause 1000
wend
end
and result:
WARNING[207]:found label after colum 1.(DEVICE)
Error[122]:Illegal opcode(PIC16F877A)

THIS IS MY PROBLEM!!!
Logged
picbasic4
Newbie
*
Offline Offline

Posts: 23

Thank You
-Given: 24
-Receive: 30


« Reply #6 on: January 17, 2008, 09:39:32 09:39 »

I compiled it.
The error didn't come out if I set a target processor in 16F877A in MCP.
Logged

picbasic user  Smiley
omsk
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 8
-Receive: 9


« Reply #7 on: January 17, 2008, 12:44:53 12:44 »

I compiled it.
The error didn't come out if I set a target processor in 16F877A in MCP.
when you indicate a compiler MCHIP - you must change a file 16f877a.inc. It is located in same file where PBPW.exe. Example for 16f628a.inc:       
   NOLIST
    ifdef PM_USED
        LIST
        include 'M16F62xA.INC'  ; PM header
        device  pic16F628A, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
        XALL
        NOLIST
    else
        LIST
        LIST p = 16F628A, r = dec, w = -302
        INCLUDE "P16F628A.INC"  ; MPASM  Header
        ;__config _XT_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
        __config _BODEN_OFF & _CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_OFF & _INTRC_OSC_NOCLKOUT
        ;__config _BODEN_OFF & _CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_ON & _INTRC_OSC_NOCLKOUT
        ;__config _BODEN_OFF & _CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_OFF & _XT_OSC
        NOLIST
    endif
        LIST
Logged
hamid9543
Active Member
***
Offline Offline

Posts: 124

Thank You
-Given: 80
-Receive: 7


« Reply #8 on: January 18, 2008, 06:02:53 06:02 »

when:
microcode studio pluse>view>compile and program option>Assembeler>useMPASM
1)if MPASM is enable then compailer find  error for CONFIGURATION WORD
2)if MPASM is disable then compailer  no find error for CONFIGURATION WORD
what difrent between 1 and 2?and which is correct ?(enable USEMPASM  or disable)
Logged
omsk
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 8
-Receive: 9


« Reply #9 on: January 18, 2008, 10:10:46 10:10 »

Configuration word written in the file 16f877a.inc. There needed its change as in the example.
2)if MPASM is disable then:  include 'M16F62xA.INC'  ; PM header
        device  pic16F628A, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
1)if MPASM is enable then:  INCLUDE "P16F628A.INC"  ; MPASM  Header
        __config _XT_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
Logged
hamid9543
Active Member
***
Offline Offline

Posts: 124

Thank You
-Given: 80
-Receive: 7


« Reply #10 on: January 19, 2008, 05:42:28 05:42 »

thx.you help me
i compile code and donot report error but error warning:unable to open INCLUDE file M16f87xA.inc
Logged
respected
Guest
« Reply #11 on: January 19, 2008, 07:06:54 19:06 »

@omsk
can you send me eample file
Logged
omsk
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 8
-Receive: 9


« Reply #12 on: January 20, 2008, 05:41:10 17:41 »

you not needed example. If you choose "microcode studio pluse>view>compile and program option>Assembeler>MPASM", simply change line "__config......" in the file 16xxx.inc. All variants of headline are in corresponding file P16xxx.INC which bases in MPLAB directory
Logged
sheriefaly
Newbie
*
Offline Offline

Posts: 15

Thank You
-Given: 3
-Receive: 4


« Reply #13 on: January 22, 2008, 08:46:08 20:46 »

I USE THIS
@ device   hs_osc, wdt_off, pwrt_on, bod_off, lvp_off, protect_on
Logged
kalpakchiev
Active Member
***
Offline Offline

Posts: 137

Thank You
-Given: 34
-Receive: 68



« Reply #14 on: July 04, 2008, 08:57:09 20:57 »

It cab be done this way too :

@ DEVICE PIC12F675, INTRC_OSC_NOCLKOUT, WDT_OFF, PWRT_ON, MCLR_OFF, BOD_OFF, CPD_OFF, PROTECT_OFF
Logged

A known mistake is better than an unknown truth.
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC