Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Pic 16F84A, please help

Status
Not open for further replies.

StoppTidigare

Full Member level 2
Joined
Jul 16, 2002
Messages
148
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Location
Northern earth
Activity points
1,703
p16f84a.inc

Hi all, I want to turn on a LED with a PIC 16F84A, but MPLAB IDE continues to say that build failed.

I want to use the RC oscillator so I've wrote
__config _RC_osc & _WDT_OFF

I also tried the config statment

CONFIG
dw _RC_OSC & _WDT_OFF

There is also a pulldown menu in the MPLAB IDE, where one can choose the configuration bits.

Tried also that.

Here is the code:
list p=16f84a
#include p16f84a.inc


errorlevel 0,-305
PAGE

; __config _RC_OSC & _PWRTE_OFF & _WDT_OFF & _CP_OFF
CONFIG CODE
dw _CP_OFF & _WDT_OFF & _RC_OSC


org 0
clrf PORTB
bsf STATUS,RP0
bcf TRISB & 0x07F, 0
bcf STATUS, RP0

loop goto loop



end


Does anybody know why build is failing ?

Kindest regards,

StoppTidigare
 

_rc_osc

I don't understand your "configuration" code. Here is an example of configuration:
Code:
4.11.5 Simple Examples
Example 1: PIC16 Devices
#include p16f877a.inc ;include file with config bit definitions
__config _HS_OSC & _WDT_OFF & _LVP_OFF ;Set oscillator to HS,
;watchdog time off,
;low-voltage prog. off

Other:
Code:
LIST  P=16F870

#INCLUDE "P16f870.inc"
	__config _CP_ALL & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _LVP_OFF & _BODEN_ON & _PWRTE_ON & _WDT_ON & _RC_OSC
 

_wdt_off

Hi, thanks barral.

Still doesn't work though. All I want to do is still to turn on a LED using 16f84a

I got rid of the __config statment. And is now using only, the menu setting in MPLAB IDE
Configure->Configure Bits
Category Settings
oscillator RC
watchdog OFF
powerup timer ON
code protection OFF

I also added a linker 16f84a.lkr in the project files

Now my(from a book by Myke Predco ) code looks like this:
list p=16f84a
#include "p16f84a.inc"
errorlevel 0,-305
PAGE
org 0
clrf PORTB
bsf STATUS,RP0
bcf TRISB, 0
bcf STATUS, RP0
loop goto loop
end
A led connected to RB0 is supposed to shine when running this.

The error I got is
Microchip\MPASM Suite" /q /p16F84A "ledtest2.asm" /l"ledtest2.lst" /e"ledtest2.err" /o"ledtest2.o"
Could not spawn langauge tool. Check command-line options. (5)
BUILD FAILED: Mon Sep 26 16:11:13 2005


Kindest regards,
StoppTidigare
 

16f84a led

This is an example, which turns on LED on port RBO. It is writen for XT oscilator, so you have to change it.


list p=16f84a
#include <p16f84a.inc>

__CONFIG _CP_OFF & _XT_OSC & _WDT_OFF & _PWRTE_ON


org 0x000
goto Zacni
org 0x004


Zacni
bsf STATUS, RP0
movlw 0x00
movwf TRISB
bcf STATUS, RP0
movlw 0x01
movwf PORTB


zanka goto zanka

end
 

__config 16f84a

i think your problem is the toolset setup - are you sure it's correct? last time i installed the toolset was missing and i had to point it manually.

project -> select language toolsuite. make sure mpasm is the selection. now are any of the three tools greyed out? in mine mplink and mplib were not auto-set, so i had to browse them to their proper directory in c:\program files.
 

__config pic16f84a

Hi all and thanks.

yes, you were right electronrancher.

One believes that the IDE enviroment would look up were it is installed or at least take care of it when the project wizzard is run.
Really bad.

Kindest regards,

StoppTidigare
 

16f84 rc oscillator

yeah it's a bad verision i think - i've used many versions of mplab, & this is the first time this screwup occurred.

glad you're up & running!
-er
 

16f84a config

donot use

loop goto loop

use

loop:
nop
goto loop
 

could not spawn language tool.

@shafee001:

Can you shortly explain whay?

When/where can be a problem if we use loop goto loop?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top