PDA

View Full Version : Compile 16f629



MICOCALI
- 23rd September 2004, 09:02
i HAVE THIS PROBLEM

DEFINE OSC 4

ADCON1 = 7

F VAR WORD



LOOP:
Count GPIO.5,1756,F
IF F>1400 Then OK

GoTo LOOP
OK:
High GPIO.4
Pause 2000
Low GPIO.4
Pause 20000
GoTo LOOP



End
i COMPILE THIS TEXT BUT THE COMPILER RESPOND WITH MOST ERROR WY?????????? FOR PIC 12F629

Melanie
- 23rd September 2004, 09:09
GPIO is used for 12 series PICs not for 16 series.

There is no GPIO Port on a 16F629... go look in the Datasheet, come back and tell us what Port and Pin you're using.

Also, 4MHz is the PICBasic default, and you don't actually need the DEFINE OSC 4 statement for this PIC.

MICOCALI
- 23rd September 2004, 12:15
the pic is 12F629

Melanie
- 23rd September 2004, 12:28
Check what your compiler errors are telling you... if you don't tell us, we can only guess...

For a start there is no ADCON1 register in a 12F629.

MICOCALI
- 23rd September 2004, 12:38
DEFINE OSC 4

ADCON1 = 7

F VAR WORD


LOOP:
Count GPIO.5,1756,F
IF F>1400 Then OK

GoTo LOOP
OK:
High GPIO.4
Pause 2000
Low GPIO.4
Pause 20000
GoTo LOOP

End

FOR 12F629

THI IS ERROR

MICOCALI
- 23rd September 2004, 12:47
ERROR

Melanie
- 23rd September 2004, 12:50
There is NOTHING WRONG with your posted code EXCEPT you shouldn't have ADCON1 in it. The compiler flags FIVE errors all to do with ADCON1 - and that should immediately cause to you think that there is a problem there. I refer you to the 12F629 Datasheet.

If you are having other errors, then perhaps you should tell us what they are. You might be using the wrong line to compile, or a compiler that doesn't support that device. A statement that says "THIS IS ERROR" doesn't excatly tell us much.

Melanie
- 23rd September 2004, 12:52
I do hope you haven't called your sample program 12F629.BAS and put it in your PBP directory. You would have destroyed the PBP support file with the same name.

Melanie
- 23rd September 2004, 12:55
H:\DATA-R~1\PIC\PBP244>pbp -p12f629 zd
PicBasic Pro Compiler 2.44, (c) 1998, 2003 microEngineering Labs, Inc.
All Rights Reserved.
PM Assembler 4.06, Copyright (c) 1995, 2003 microEngineering Labs, Inc.
Error H:\DATA-R~1\PIC\PBP244\ZD.ASM 44 : [225] Undefined Symbol 'ADCON1'
Error H:\DATA-R~1\PIC\PBP244\ZD.ASM 44 : [225] Undefined Symbol 'ADCON1'
Error H:\DATA-R~1\PIC\PBP244\ZD.ASM 44 : [225] Undefined Symbol 'ADCON1'
Error H:\DATA-R~1\PIC\PBP244\ZD.ASM 44 : [225] Undefined Symbol 'ADCON1'
Error H:\DATA-R~1\PIC\PBP244\ZD.ASM 44 : [225] Undefined Symbol 'ADCON1'
*** 5 Errors ***

H:\DATA-R~1\PIC\PBP244>

zd.bas is the source file I pasted your code into.

Melanie
- 23rd September 2004, 13:01
Unable to open PBPMAC.INC is also a clue...

You either have PBP support files missing, corrupted (or overwritten as in my previous posting) or an incorrect PATH to your PBP directory.

MICOCALI
- 23rd September 2004, 14:26
I HAVE COMPILE THE FILE FOR PIC 12F675 AND ALL OK I WILL START THIS HEX FILE INTO 12F629 ? WY WITH 12F629 THE COMPILER SEND MOST ERROR AND WITH 12F675 NO ERROR?

Dwayne
- 23rd September 2004, 15:07
Hello Micocali,

M>WY WITH 12F629 THE COMPILER SEND MOST ERROR AND WITH 12F675 NO ERROR?<<

As Melanie said before, the 12F675 is completely different that the 12F629.

the 629 doesn't use ADCON1

Each chip is different...just because they show two or three different chips for one data sheet, does not mean they are "compatible". It means the basics of the layout is the same, and one may have different amounds of RAM, ROM, and other charactoristics.

Dwayne