Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 6th September 2006, 04:44 PM   (permalink)
Default Start up questions

Ok so I've come accross PIC's and am interested

my question is have I understood things right so far and what should I do next?

First the code is written in a text editor (textpad or mplab?)
It is then converted into hex (mplab or another program?)
Then the coed is sent to another program which outputs the data on the serial port
This is then feed into the programmer hardware
The PIC is now programmed

Can PIC's be reprogrammed?
Is it worth spending £20 on a programming board? (includes a pic, can handel 8p 14p 18p and 28p in 300mm )
what is a good first pic to tinker with?
do different pic's requrie different assembler code?
any good tutorials for assembler?

can multiple pic's be chainded to perform more complex functions,
how would they communicate?

Sorry for all the questions, I've done some reaserch but want to confirm what I think.
user1453 is offline  
Old 6th September 2006, 05:04 PM   (permalink)
Default

Quote:
Originally Posted by user1453
Ok so I've come accross PIC's and am interested

my question is have I understood things right so far and what should I do next?

First the code is written in a text editor (textpad or mplab?)
It is then converted into hex (mplab or another program?)
Then the coed is sent to another program which outputs the data on the serial port
The serial port is only one option, the parallel port is common as well, and USB programmers are becoming popular as well.

Quote:

This is then feed into the programmer hardware
The PIC is now programmed

Can PIC's be reprogrammed?
Many can, although some are OTP (One Time Programmable).

Quote:

Is it worth spending £20 on a programming board? (includes a pic, can handel 8p 14p 18p and 28p in 300mm )
Yes.

Quote:

what is a good first pic to tinker with?
Check my tutorials, they use the 16F628 and 16F876/7, two very popular choices.

Quote:

do different pic's requrie different assembler code?
Slightly, although the actual code is the same for similar range devices, it's just changes for the different hardware.

Quote:

any good tutorials for assembler?
Try mine!

Quote:

can multiple pic's be chainded to perform more complex functions,
how would they communicate?
Yes, in various different ways - the simplest being a serial connection.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 6th September 2006, 05:05 PM   (permalink)
Default

any kits dor the uk that use usb?
user1453 is offline  
Old 6th September 2006, 05:07 PM   (permalink)
Default Re: Start Up Questions

Hi there,

Yes, from what you have explained that about right.

1) Write you code.
2) Assemble you code.
3) Program you PIC using the .HEX file your assembler create using you desired PIC programmer & Supported Software.

As far as different PIC's are concerned there are so many on the market these days will all sorts of different features. It's all depending on what you want to do with them.

Using more than one PIC for a project isn't the best way of doing things as you will probably find that there would be a PIC on the market that would be better suited for what you're doing.

Communicating between two PIC's also depends on what your application requires. There are many different ways,

E.g. SPI, Parallel Slave Port ect, ect.

As for a good device to start withb there are a number of devices here are a few,

16F88, 16F627, 16F628, 16F877 ect ect

If you want to be a bit more daring you can also try the 18F series which I have found are easier to use in some ways.

It's also depends on what programming background you have if you have a C programming background then PIC C programming may be better suited to you.

Hope this helps

Regards


Pete
Micro82 is offline  
Old 6th September 2006, 05:10 PM   (permalink)
Default

programming experience so far has been mainly javascript and HTML
user1453 is offline  
Old 6th September 2006, 05:13 PM   (permalink)
Default

I would advise you to keep to MPASM for starting off then

Regards

Pete
Micro82 is offline  
Old 6th September 2006, 05:18 PM   (permalink)
Default

Quote:
Originally Posted by user1453
any kits dor the uk that use usb?
They tend to be the far more expensive ones, as they require an on-board processor (as to 'real' serial port programmers).

As suggested, start with assembler and MPASMWIN.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 6th September 2006, 08:09 PM   (permalink)
Default

what is the difference between

PIC16F628-04/P
and
PIC16F627-04/P
one is more expensive, why?
user1453 is offline  
Old 6th September 2006, 09:05 PM   (permalink)
Default

The 627 has 1K of program memory, the 628 has 2K. That is the only difference I see.
tinman10011001 is offline  
Old 6th September 2006, 10:08 PM   (permalink)
Default

would it be possible using a pic to have it count in binary up and down by increments of say +/-4 and +/-1 between the values of 0 and 40 depending on which one of four buttons is pressed?
user1453 is offline  
Old 6th September 2006, 10:11 PM   (permalink)
Default

Quote:
Originally Posted by user1453
would it be possible using a pic to have it count in binary up and down by increments of say +/-4 and +/-1 between the values of 0 and 40 depending on which one of four buttons is pressed?
Yes, it's a fairly trivial task! - PIC's are capable of surprising complexity, it's absolutely incredible what you can do in a small amount of memory!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 6th September 2006, 11:49 PM   (permalink)
Default

If you have a value in the w register and power down the pic, when the pic is powered up again will the pic be able to reuse the value stored?

can more than one number be stored in the w register?
user1453 is offline  
Old 6th September 2006, 11:53 PM   (permalink)
Default

Quote:
Originally Posted by user1453
If you have a value in the w register and power down the pic, when the pic is powered up again will the pic be able to reuse the value stored?

can more than one number be stored in the w register?
No, registers get lost when powered down. A register is a single number. You could split the register up into two sections to hold two numbers or three sections to hold 3 numbers, but essentially it's just one number and you are interpreting it in a different way in your coding.
dknguyen is offline  
Old 7th September 2006, 10:22 AM   (permalink)
Default

Quote:
Originally Posted by dknguyen
No, registers get lost when powered down.
Not 100% 'true' - registers 'may' be lost when powered down, but what's important is that there's no way to know if it's been lost or not, so it's absolutely vital that you don't assume anything is correct. You should always assume EVERYTHING is random when you power up, and program accordingly.

Generally you wouldn't want W to hold anything anyway, it's the only working register you've got!.

If you want to restore data?, most PIC's have a small data EEPROM area where you can store permanent data in non-voltatile memory.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 8th September 2006, 07:49 AM   (permalink)
Default

ok, thanks for the help,

I'll get

K8048 PIC Microcontroller Programmer Kit for £20
PIC16F628
led's
ressistors
capacitors
and a breadboard

I'll use the compiler and programmer that come with the kit
and write the assembler code in mplab for the simulator,
once happy I'll compile the code with the program that came with the k8048 kit

any improvements I should make on that list?
user1453 is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 12:19 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker