Maker Pro
Maker Pro

Never used PIC before

M

Michael

Hi
I consider myself somewhat accomplished EE, but as "subject"
indicates, I have managed never to "stray away" from analog.
I decided to use PIC12F675 (no specific reason to chose this one)
because I have look to at couple analog signals and to turn couple
status LEDs on and off.
I ordered PIKkit2 with PIC16F690 demo board (Microchip MPLAB and
HiTech HI-TIDE included) hoping that I would play with code
sample(s) , get familiar with the language.
Well, it does not seem to be that straightforward: sample file does
not compile - variable not defined (I failed to include some file)...
To make a long story short: Can you guys point me to the place where I
can get code (project?) samples?
Thank you
 
S

Spehro Pefhany

Hi
I consider myself somewhat accomplished EE, but as "subject"
indicates, I have managed never to "stray away" from analog.
I decided to use PIC12F675 (no specific reason to chose this one)
because I have look to at couple analog signals and to turn couple
status LEDs on and off.
I ordered PIKkit2 with PIC16F690 demo board (Microchip MPLAB and
HiTech HI-TIDE included) hoping that I would play with code
sample(s) , get familiar with the language.
Well, it does not seem to be that straightforward: sample file does
not compile - variable not defined (I failed to include some file)...
To make a long story short: Can you guys point me to the place where I
can get code (project?) samples?
Thank you

Microchip forums
http://www.piclist.com

Note that the PIC16f690 demo board, although inexpensive is not ideal
since you won't be able to debug without buying the separate header
board. (By "debug" I mean single-step through code, look at register
values and that sort of thing-- you'll only be able to program the
chip). Of course you have a fairly good simulator capability built
into MPLAB.
Best regards,
Spehro Pefhany
 
Hi
I consider myself somewhat accomplished EE, but as "subject"
indicates, I have managed never to "stray away" from analog.
I decided to use PIC12F675 (no specific reason to chose this one)
because I have look to at couple analog signals and to turn couple
status LEDs on and off.
I ordered PIKkit2 with PIC16F690 demo board (Microchip MPLAB and
HiTech HI-TIDE included) hoping that I would play with code
sample(s) , get familiar with the language.
Well, it does not seem to be that straightforward: sample file does
not compile - variable not defined (I failed to include some file)...
To make a long story short: Can you guys point me to the place where I
can get code (project?) samples?
Thank you
When you say: 'does not compile' then that looks like you are using th
C compiler.
C compiler will at least want to know what type of PIC you use, so
there is an include for that I suppose
(have not used that compiler), plus the normal C includes,
stdio.h
stdlib.h
and maybe some more.

Also when you try ASM, the line
include <p16f690.inc>
must be somewhere.

I strongly recommend reading the relevant PIC datasheet, and for start
write short asm programs.
It is closer to the chip, and in fact often simpler, and then later if
you use C at least you
know what the compiler should be generating.
The Microchip site has lots of application notes, code examples,
libraries, all for free, just
search a bit.
Write a simple asm program of a few lines that flashes a LED first,
that should get you going.

Well all this is my experience anyways...
 
M

mkr5000

Listen......and listen good.

As someone who was once in the same boat, FORGET about assembly
language or C sharp or anything but.....


Picbasic.

Even as a beginner, it took me several months to get a good grasp on
the microcontroller world and Picbasic.

Get to the library, start from scratch but teach yourself Picbasic
first.

melabs.com -- the library -- books on ebay
 
R

Rich Webb

Hi
I consider myself somewhat accomplished EE, but as "subject"
indicates, I have managed never to "stray away" from analog.
I decided to use PIC12F675 (no specific reason to chose this one)
because I have look to at couple analog signals and to turn couple
status LEDs on and off.
I ordered PIKkit2 with PIC16F690 demo board (Microchip MPLAB and
HiTech HI-TIDE included) hoping that I would play with code
sample(s) , get familiar with the language.
Well, it does not seem to be that straightforward: sample file does
not compile - variable not defined (I failed to include some file)...
To make a long story short: Can you guys point me to the place where I
can get code (project?) samples?

The PicList site <http://www.piclist.com/techref/microchip/index.htm>
is probably the best single starting point. (disclaimer: I usually
work with AVRs nowadays, so I'm not really up to date on the latest
PIC fashions.)

And for what it's worth, I've almost never gotten a demo/development
board and sample software combination to work together right out of
the box. Seems that it's a natural law that one or the other have been
"updated" at some point in time and what you have won't want to play
well together.
 
M

Michael

When you say: 'does not compile' then that looks like you are using th
C compiler.
C compiler will at least want to know what type of PIC you use, so
there is an include for that I suppose
(have not used that compiler), plus the normal C includes,
stdio.h
stdlib.h
and maybe some more.

Also when you try ASM, the line
include <p16f690.inc>
must be somewhere.

I strongly recommend reading the relevant PIC datasheet, and for start
write short asm programs.
It is closer to the chip, and in fact often simpler, and then later if
you use C at least you
know what the compiler should be generating.
The Microchip site has lots of application notes, code examples,
libraries, all for free, just
search a bit.
Write a simple asm program of a few lines that flashes a LED first,
that should get you going.

Well all this is my experience anyways...

Thanks!!!
The sample code (9 lines below) look to me like like....??? #include
at the top is C, the rest - ???
The error message is ": Symbol not previously defined (_BOD_OFF)"
I do want to get correctly configured (working) environment from where
I can start...

#include <p16F690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF &
_CP_OFF & _BOD_OFF & _IESO_OFF & _FCMEN_OFF)
org 0
Start
BSF STATUS,RP0 ;select Register Page 1
BCF TRISC,0 ;make I/O Pin C0 an output
BCF STATUS,RP0 ;back to Register Page 0
BSF PORTC,0 ;turn on LED C0
GOTO $ ;wait here
end
 
On May 5, 1:25 pm, [email protected] wrote:
Thanks!!!
The sample code (9 lines below) look to me like like....??? #include
at the top is C, the rest - ???
The error message is ": Symbol not previously defined (_BOD_OFF)"

That is because it is supposed to be:
BOR_OFF

How do I know?
If you look in p16F690.inc yo uwil lfind all the definitions.
Thse is no BOD_OFF, so I expect a typo.
PIC ASM is pedantic...
The below code is ASM
 
S

Spehro Pefhany

Listen......and listen good.

As someone who was once in the same boat, FORGET about assembly
language or C sharp or anything but.....


Picbasic.

Basic on a PIC?

Sounds a bit like a merger between Circuit City and Blockbuster.
Best regards,
Spehro Pefhany
 
M

mkr5000

Sounded like he was a novice -- my mistake.

I see he's an EE.

Hate to see a beginner waste their time with assembly.
 
M

Michael

That is because it is supposed to be:
BOR_OFF

How do I know?
If you look in p16F690.inc yo uwil lfind all the definitions.
Thse is no BOD_OFF, so I expect a typo.
PIC ASM is pedantic...
The below code is ASM

Oh, Thanks. Error message is gone now. The typo was intentional (?),
not mine that is.
 
J

Jamie

mkr5000 said:
Listen......and listen good.

As someone who was once in the same boat, FORGET about assembly
language or C sharp or anything but.....


Picbasic.

Even as a beginner, it took me several months to get a good grasp on
the microcontroller world and Picbasic.

Get to the library, start from scratch but teach yourself Picbasic
first.

melabs.com -- the library -- books on ebay
Yeck!


--
"I'd rather have a bottle in front of me than a frontal lobotomy"

"Daily Thought:

SOME PEOPLE ARE LIKE SLINKIES. NOT REALLY GOOD FOR ANYTHING BUT
THEY BRING A SMILE TO YOUR FACE WHEN PUSHED DOWN THE STAIRS.
http://webpages.charter.net/jamie_5"
 
Oh yeah, PicBasic Pro works very very well.
Use inline assembler when needed (interrupts mostly) and basic for everything else.
I was really surprised to see how much it would squeeze into 2k of program space.

I think the right way to look at that is how little modern programmers
get done in megabytes and megabytes of code.
 
E

Eeyore

Rich said:
And for what it's worth, I've almost never gotten a demo/development
board and sample software combination to work together right out of
the box. Seems that it's a natural law that one or the other have been
"updated" at some point in time and what you have won't want to play
well together.

Never had any trouble with 8051 stuff.

Graham
 
Top