EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Problem in assembling

Started by chadalawadabalakrishna April 17, 2008
I use Microchip MPASM to assemble. But it doesn't accept keywords like
PORTA etc. Kindly inform me if there is any error in the logic of the
program:

#include

ORG 00H

MOVLW b'00000000'
TRIS PORTB

MOVLW b'00000011'
TRIS PORTA

MOVF PORTA,0
SUBLW 00000000
BTFSS STATUS,2
GOTO LOOP1

MOVF PORTA,0
SUBLW 00000001
BTFSS STATUS,2
GOTO LOOP2

MOVF PORTA,0
SUBLW 00000010
BTFSS STATUS,2
GOTO LOOP3

MOVF PORTA,0
SUBLW 00000011
BTFSS STATUS,2
GOTO LOOP4

LOOP1:
MOVLW 00000000
MOVWF PORTB
END

LOOP2:
MOVLW 00000001
MOVWF PORTB
END

LOOP2:
MOVLW 00000010
MOVWF PORTB
END

LOOP3:
MOVLW 00000011
MOVWF PORTB
END

error file:
Message[301] C:\PROGRA~1\MPLAB\P16F84A.INC 35 : MESSAGE:
(Processor-header file mismatch. Verify selected processor.)
Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 : Found directive in
column 1. (ORG)
Error[147] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 : Directive not allowed
when generating an object file (ORG)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 6 : Illegal opcode (b)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 7 : Illegal opcode (PORTB)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 9 : Illegal opcode (b)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 10 : Illegal opcode (PORTA)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 12 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 13 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 14 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 15 : Illegal opcode (LOOP1)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 17 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 18 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 19 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 20 : Illegal opcode (LOOP2)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 22 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 23 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 24 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 25 : Illegal opcode (LOOP3)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 27 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 28 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 29 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 30 : Illegal opcode (LOOP4)
Error[150] C:\DOCUME~1\BALU\DESKTOP\1.ASM 32 : Labels must be
defined in a code or data section when making an object file
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 33 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 34 : Illegal opcode (PORTB)
Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 35 : Found directive in
column 1. (END)
Error[131] C:\DOCUME~1\BALU\DESKTOP\1.ASM 36 : Processor type is
undefined

Please read the MPLAB getting started manuals. Column 1 is reserved for
labels, you put assembly instructions at the next tab stop.

DLC

> I use Microchip MPASM to assemble. But it doesn't accept keywords like
> PORTA etc. Kindly inform me if there is any error in the logic of the
> program:
>
> #include ORG 00H
>
> MOVLW b'00000000'
> TRIS PORTB
>
> MOVLW b'00000011'
> TRIS PORTA
>
> MOVF PORTA,0
> SUBLW 00000000
> BTFSS STATUS,2
> GOTO LOOP1
>
> MOVF PORTA,0
> SUBLW 00000001
> BTFSS STATUS,2
> GOTO LOOP2
>
> MOVF PORTA,0
> SUBLW 00000010
> BTFSS STATUS,2
> GOTO LOOP3
>
> MOVF PORTA,0
> SUBLW 00000011
> BTFSS STATUS,2
> GOTO LOOP4
>
> LOOP1:
> MOVLW 00000000
> MOVWF PORTB
> END
>
> LOOP2:
> MOVLW 00000001
> MOVWF PORTB
> END
>
> LOOP2:
> MOVLW 00000010
> MOVWF PORTB
> END
>
> LOOP3:
> MOVLW 00000011
> MOVWF PORTB
> END
>
> error file:
> Message[301] C:\PROGRA~1\MPLAB\P16F84A.INC 35 : MESSAGE:
> (Processor-header file mismatch. Verify selected processor.)
> Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 : Found directive in
> column 1. (ORG)
> Error[147] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 : Directive not allowed
> when generating an object file (ORG)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 6 : Illegal opcode (b)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 7 : Illegal opcode (PORTB)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 9 : Illegal opcode (b)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 10 : Illegal opcode (PORTA)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 12 : Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 13 : Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 14 : Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 15 : Illegal opcode (LOOP1)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 17 : Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 18 : Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 19 : Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 20 : Illegal opcode (LOOP2)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 22 : Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 23 : Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 24 : Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 25 : Illegal opcode (LOOP3)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 27 : Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 28 : Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 29 : Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 30 : Illegal opcode (LOOP4)
> Error[150] C:\DOCUME~1\BALU\DESKTOP\1.ASM 32 : Labels must be
> defined in a code or data section when making an object file
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 33 : Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 34 : Illegal opcode (PORTB)
> Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 35 : Found directive in
> column 1. (END)
> Error[131] C:\DOCUME~1\BALU\DESKTOP\1.ASM 36 : Processor type is
> undefined
>
>
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
You need to declare PORTA refers to HEX,BINARY,DECIMAL
number

eg.

PORTA equ 05H

Good luck
--- chadalawadabalakrishna
wrote:

> I use Microchip MPASM to assemble. But it doesn't
> accept keywords like
> PORTA etc. Kindly inform me if there is any error in
> the logic of the
> program:
>
> #include ORG 00H
>
> MOVLW b'00000000'
> TRIS PORTB
>
> MOVLW b'00000011'
> TRIS PORTA
>
> MOVF PORTA,0
> SUBLW 00000000
> BTFSS STATUS,2
> GOTO LOOP1
>
> MOVF PORTA,0
> SUBLW 00000001
> BTFSS STATUS,2
> GOTO LOOP2
>
> MOVF PORTA,0
> SUBLW 00000010
> BTFSS STATUS,2
> GOTO LOOP3
>
> MOVF PORTA,0
> SUBLW 00000011
> BTFSS STATUS,2
> GOTO LOOP4
>
> LOOP1:
> MOVLW 00000000
> MOVWF PORTB
> END
>
> LOOP2:
> MOVLW 00000001
> MOVWF PORTB
> END
>
> LOOP2:
> MOVLW 00000010
> MOVWF PORTB
> END
>
> LOOP3:
> MOVLW 00000011
> MOVWF PORTB
> END
>
> error file:
> Message[301] C:\PROGRA~1\MPLAB\P16F84A.INC 35 :
> MESSAGE:
> (Processor-header file mismatch. Verify selected
> processor.)
> Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 :
> Found directive in
> column 1. (ORG)
> Error[147] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 :
> Directive not allowed
> when generating an object file (ORG)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 6 :
> Illegal opcode (b)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 7 :
> Illegal opcode (PORTB)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 9 :
> Illegal opcode (b)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 10 :
> Illegal opcode (PORTA)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 12 :
> Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 13 :
> Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 14 :
> Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 15 :
> Illegal opcode (LOOP1)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 17 :
> Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 18 :
> Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 19 :
> Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 20 :
> Illegal opcode (LOOP2)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 22 :
> Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 23 :
> Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 24 :
> Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 25 :
> Illegal opcode (LOOP3)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 27 :
> Illegal opcode (PORTA)
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 28 :
> Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 29 :
> Illegal opcode (STATUS)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 30 :
> Illegal opcode (LOOP4)
> Error[150] C:\DOCUME~1\BALU\DESKTOP\1.ASM 32 :
> Labels must be
> defined in a code or data section when making an
> object file
> Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 33 :
> Illegal character (0)
> Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 34 :
> Illegal opcode (PORTB)
> Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 35 :
> Found directive in
> column 1. (END)
> Error[131] C:\DOCUME~1\BALU\DESKTOP\1.ASM 36 :
> Processor type is
> undefined
>
Send instant messages to your online friends http://uk.messenger.yahoo.com

You have to tell it that when you write PORTA you mean register 5

use:

#define PORTA 0x05

at the start of your prog
Not sure about your loop statements. I normally put loop statements in col 1, operator on col 2 etc

loop1 movlw 0
movwf portb
so on

Cheers, Guy
----- Original Message -----
From: chadalawadabalakrishna
To: p...
Sent: Tuesday, March 18, 2008 8:09 AM
Subject: [piclist] Problem in assembling
I use Microchip MPASM to assemble. But it doesn't accept keywords like
PORTA etc. Kindly inform me if there is any error in the logic of the
program:

#include

ORG 00H

MOVLW b'00000000'
TRIS PORTB

MOVLW b'00000011'
TRIS PORTA

MOVF PORTA,0
SUBLW 00000000
BTFSS STATUS,2
GOTO LOOP1

MOVF PORTA,0
SUBLW 00000001
BTFSS STATUS,2
GOTO LOOP2

MOVF PORTA,0
SUBLW 00000010
BTFSS STATUS,2
GOTO LOOP3

MOVF PORTA,0
SUBLW 00000011
BTFSS STATUS,2
GOTO LOOP4

LOOP1:
MOVLW 00000000
MOVWF PORTB
END

LOOP2:
MOVLW 00000001
MOVWF PORTB
END

LOOP2:
MOVLW 00000010
MOVWF PORTB
END

LOOP3:
MOVLW 00000011
MOVWF PORTB
END

error file:
Message[301] C:\PROGRA~1\MPLAB\P16F84A.INC 35 : MESSAGE:
(Processor-header file mismatch. Verify selected processor.)
Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 : Found directive in
column 1. (ORG)
Error[147] C:\DOCUME~1\BALU\DESKTOP\1.ASM 4 : Directive not allowed
when generating an object file (ORG)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 6 : Illegal opcode (b)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 7 : Illegal opcode (PORTB)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 9 : Illegal opcode (b)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 10 : Illegal opcode (PORTA)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 12 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 13 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 14 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 15 : Illegal opcode (LOOP1)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 17 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 18 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 19 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 20 : Illegal opcode (LOOP2)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 22 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 23 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 24 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 25 : Illegal opcode (LOOP3)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 27 : Illegal opcode (PORTA)
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 28 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 29 : Illegal opcode (STATUS)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 30 : Illegal opcode (LOOP4)
Error[150] C:\DOCUME~1\BALU\DESKTOP\1.ASM 32 : Labels must be
defined in a code or data section when making an object file
Error[108] C:\DOCUME~1\BALU\DESKTOP\1.ASM 33 : Illegal character (0)
Error[122] C:\DOCUME~1\BALU\DESKTOP\1.ASM 34 : Illegal opcode (PORTB)
Warning[205] C:\DOCUME~1\BALU\DESKTOP\1.ASM 35 : Found directive in
column 1. (END)
Error[131] C:\DOCUME~1\BALU\DESKTOP\1.ASM 36 : Processor type is
undefined
----- Original Message -----
From: Guy Martin
To: p...
Sent: Thursday, April 17, 2008 11:44 AM
Subject: Re: [piclist] Problem in assembling
> You have to tell it that when you write PORTA you mean register 5
>
> use:
>
> #define PORTA 0x05
>
> at the start of your prog
> Not sure about your loop statements. I normally put loop
> statements in col 1, operator on col 2 etc

DO NOT DO THIS. DO NOT EVER DO THIS. I'm not sure why so many hobbyists do
this, the only thing I can see is that it is a leftover from back in the
days when we assembled from a floppy disk and we could save a few seconds by
not using the include file. Hand coding #defines that are in the include
file make the program harder to read, less maintainable, and are a potential
for many errors. Microchip provides an include file, use it.

Now, here's the actual problem:

>
> ----- Original Message -----
> From: chadalawadabalakrishna
> To: p...
> Sent: Tuesday, March 18, 2008 8:09 AM
> Subject: [piclist] Problem in assembling
> I use Microchip MPASM to assemble. But it doesn't accept keywords like
> PORTA etc. Kindly inform me if there is any error in the logic of the
> program:
>
> #include

This isn't C. The include does not require a #, it is preceeded by
whitespace, and the filename does not have angle brackets surrounding it.

include p16f84a.inc
>
> ORG 00H
>

Get over this as soon as possible. Absolute code is OK for your first
outing or two, but once you have your head around the PIC, learn relocatable
code. It can be a little weird getting your head around it at first, but it
will make you far more productive in the long run.

Ditto with the F84. It is *THE* PIC to learn on, but once you have, every
other PIC is cheaper or better, most are both.

72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35

John J. McDonough, WB8RCR wrote:
> ----- Original Message -----
> From: Guy Martin
> To: p...
> Sent: Thursday, April 17, 2008 11:44 AM
> Subject: Re: [piclist] Problem in assembling
>> You have to tell it that when you write PORTA you mean register 5
>>
>> use:
>>
>> #define PORTA 0x05
>>
>> at the start of your prog
>> Not sure about your loop statements. I normally put loop
>> statements in col 1, operator on col 2 etc
>
> DO NOT DO THIS. DO NOT EVER DO THIS. I'm not sure why so many hobbyists do
> this, the only thing I can see is that it is a leftover from back in the
> days when we assembled from a floppy disk and we could save a few seconds by
> not using the include file. Hand coding #defines that are in the include
> file make the program harder to read, less maintainable, and are a potential
> for many errors. Microchip provides an include file, use it.
>
> Now, here's the actual problem:
>
>> ----- Original Message -----
>> From: chadalawadabalakrishna
>> To: p...
>> Sent: Tuesday, March 18, 2008 8:09 AM
>> Subject: [piclist] Problem in assembling
>> I use Microchip MPASM to assemble. But it doesn't accept keywords like
>> PORTA etc. Kindly inform me if there is any error in the logic of the
>> program:
>>
>> #include This isn't C. The include does not require a #, it is preceeded by
> whitespace, and the filename does not have angle brackets surrounding it.
>
> include p16f84a.inc
>> ORG 00H
>> Get over this as soon as possible. Absolute code is OK for your first
> outing or two, but once you have your head around the PIC, learn relocatable
> code. It can be a little weird getting your head around it at first, but it
> will make you far more productive in the long run.

Lets be more clear. The interrupts and reset address are fixed and
there is NO problem with "ORG" when you want direct access to them - And
very often you _do_.

Sometimes you aren't writing relocatable code, sometimes you are
doing a very discrete thing in a small PIC. We're not always writing
libraries to use with other programs.

> Ditto with the F84. It is *THE* PIC to learn on, but once you have, every
> other PIC is cheaper or better, most are both.

I don't see any reason to use this part. It is a real PIC dinosaur.

> 72/73 de WB8RCR http://www.qsl.net/wb8rcr
> didileydadidah QRP-L #1446 Code Warriors #35

Just my $0.02 worth,
DLC

DLC
>
>
>
----- Original Message -----
From: "dlc"
To:
Sent: Monday, April 28, 2008 11:18 PM
Subject: Re: [piclist] Problem in assembling
>> Ditto with the F84. It is *THE* PIC to learn on, but once you have,
>> every
>> other PIC is cheaper or better, most are both.
>
> I don't see any reason to use this part. It is a real PIC dinosaur.

It is kind of a dinosaur, but it has a couple of advantages over almost all
other PICs for learning:
- Each pin only does one thing
- All the RAM is echoed in all banks

For a lot of people, learning any microcontroller is kind of intimidating.
With only 35 instructions, the PIC16 isn't rocket science to be sure, but
many of people approach it with a lot of uncertainty. While the step up
from the 84 to anything else isn't a big one once you have your head around
the PIC, trying to learn the PIC while your variables disappear every time
you do the mysterious banksel to access a register, and remembering to turn
off peripherals you don't yet understand makes it a lot harder for the
newbie.

Once you know what you are doing, these things are, at worst, minor
irritations, but when you first approach the PIC, they add to a barrier that
already appears to be a lot higher than it is.

For people still married to the 84, the other PIC16s are practically the
same. All offer more peripherals than the F84, and almost all offer more
memory. Except for some of the 40 pin parts, all are cheaper. There are a
couple of little coding things to watch out for, but with a little care you
can use the same code across all the PIC16s. (except the PIC16F54/84 which
is a PIC12 with a PIC16 number). My latest Elmer 160 lesson addresses these
differences, and the experiments run on all the 18 pin 16Fs except the 716
which has no EEPROM (the experiments use EEPROM). Unfortunately, with a
bunch of different PICs and 3 development environments, and on the larger
parts, over 1000 meaningfully different ways to organize memory, every
little change requires a ton of testing, so it is going very slow.

That being said, I wonder if the newbie in this day and age shouldn't be
heading right for the 18F anyway. No banking, a lot of the 16F irritations
are gone, and prices have reached the point where it is hard to tell the
difference. There is no 84 equivalent so you need learn to turn off the
analogs right away, but there is none of that annoying banking, and most of
the quirky instructions have been fixed. The main thing lacking is example
projects.

72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
> > I don't see any reason to use this part. It is a real PIC dinosaur.
>
> It is kind of a dinosaur, but it has a couple of advantages over almost all
> other PICs for learning:
> - Each pin only does one thing

The fact that a pin *can* do other things does not mean you have to be
bothered by that feature (except for the disabling of some analog
functions, which can easily be done 'by recepy' without knowing what
exactly you are doing).

> - All the RAM is echoed in all banks

The only reason for going to other banks when using a PIC in
'16F84-mode' is to set the TRIS registers, which can (contrary to what
uChip seems to advocate) still be done with TRIS instructions.

So using a 16F628A, 16F630, etc. Has zero (or very little) technical
disadvantage, one one big advantage: killing the chip does not hurt your
wallet so much!

> That being said, I wonder if the newbie in this day and age shouldn't be
> heading right for the 18F anyway.

The 16-bit-cores still lack low pincount chips. And the cute little SMD
10F's (12-bit cores) are much like the 14-bit cores (but with a few
quircks added to the already impressive list for 14-bit cores), so they
are easy to explain to someone who knows his way around with a 14-bit core.

--

Wouter van Ooijen

-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: www.voti.nl/hvu
>
> ----- Original Message -----
> From: "dlc"
> To:
> Sent: Monday, April 28, 2008 11:18 PM
> Subject: Re: [piclist] Problem in assembling
>>> Ditto with the F84. It is *THE* PIC to learn on, but once you have,
>>> every
>>> other PIC is cheaper or better, most are both.
>>
>> I don't see any reason to use this part. It is a real PIC dinosaur.
>
> It is kind of a dinosaur, but it has a couple of advantages over almost
> all
> other PICs for learning:
> - Each pin only does one thing
> - All the RAM is echoed in all banks
>
> For a lot of people, learning any microcontroller is kind of intimidating.
> With only 35 instructions, the PIC16 isn't rocket science to be sure, but
> many of people approach it with a lot of uncertainty. While the step up
> from the 84 to anything else isn't a big one once you have your head
> around
> the PIC, trying to learn the PIC while your variables disappear every time
> you do the mysterious banksel to access a register, and remembering to
> turn
> off peripherals you don't yet understand makes it a lot harder for the
> newbie.
>
> Once you know what you are doing, these things are, at worst, minor
> irritations, but when you first approach the PIC, they add to a barrier
> that
> already appears to be a lot higher than it is.
>
[snip]

> That being said, I wonder if the newbie in this day and age shouldn't be
> heading right for the 18F anyway. No banking, a lot of the 16F
> irritations
> are gone, and prices have reached the point where it is hard to tell the
> difference. There is no 84 equivalent so you need learn to turn off the
> analogs right away, but there is none of that annoying banking, and most
> of
> the quirky instructions have been fixed. The main thing lacking is
> example
> projects.

Code page banking is gone with the 18F parts, but memory banking is
still there (darn it!) - Then there is the access page and the linker
files. Hmm, maybe the 18F isn't the place to start.

DLC
> 72/73 de WB8RCR http://www.qsl.net/wb8rcr
> didileydadidah QRP-L #1446 Code Warriors #35
>
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Code page banking is gone with the 18F parts, but memory banking is
> still there (darn it!) - Then there is the access page and the linker
> files. Hmm, maybe the 18F isn't the place to start.
>

The 16F874 is a nice part. It has a lot of the cadillac features but is still
the PIC16 architecture. You can also get new ones cheap.

I had a hard time with linker scripts. They're not documented very well and
they're really intended for the C compiler. I do not recommend that a beginner
try to work with the C compiler. It's complicated. You really need some
experience with the parts before you start working with it.

Mike Harpe


The 2024 Embedded Online Conference