Never used PIC before

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

Reply to
Michael
Loading thread data ...

Microchip forums

formatting link

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

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

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 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...

Reply to
panteltje

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

Reply to
mkr5000

The PicList site 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.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

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 __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

Reply to
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

Reply to
panteltje

Basic on a PIC?

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

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Sounded like he was a novice -- my mistake.

I see he's an EE.

Hate to see a beginner waste their time with assembly.

Reply to
mkr5000

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

Reply to
Michael

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"
Reply to
Jamie

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.

Mike

If there is no absolute truth then nothing can be known.

Reply to
Mike

else.

space.

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

Reply to
a7yvm109gf5d1

formatting link

John Ferrell W8CCW Beware of the dopeler effect (pronounced dope-ler). That's where bad ideas seem good if they come at you fast enough.

Reply to
John Ferrell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.