Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Start up questions

Status
Not open for further replies.

user1453

New Member
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 said:
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.

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

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

Yes.

what is a good first pic to tinker with?

Check my tutorials, they use the 16F628 and 16F876/7, two very popular choices.

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.

any good tutorials for assembler?

Try mine! :D

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.
 
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
 
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 said:
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!.
 
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 said:
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 said:
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.
 
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?
 
I don't know what software comes with the K8048 programmer, but ideally you can write, debug and compile the code fully in mplab then just load the final hex file into your programmer software.
The K8048 looks like a good introduction board because of the built-in buttons, leds etc.
The only limitations with it are that it does not appear to support the newer 18F series and has no facility to use ZIF sockets to make life easier if often transfering pics between programmer and breadboards.
However, you could easily upgrade later to a dedicated programmer with built-in ZIF socket (there are plenty of them on ebay).
For the breadboard, I use a fairly large (7"x5") one as it gives plenty of room for circuits and a 7805 5V regulater is fitted, fed from a seperate DC supply.
 
Hello.
Actually I have the K8048 and I should warn you that it has some problems. I was using it when someday just started to bahave oddly. I though it was only mine but after a search in google I saw that it was not!

https://www.google.co.uk/search?q=k8048+no+device+id+received&start=0&ie=utf-8&oe=utf-8

There are people that suggesting hardware solutions which sometimes work. In my case it didn't and I didn't want to spend more time with this, so I looked for a new one. Also I hated that fact that it uses power supply, beacuse your PC has one anyway! Cost me about £40 in UK with a new powersupply (i think!)

Anyway. I found this programmer from ebay which I liked very much. It is fully USB meaning that power and data goes through USB. No PSU.
It cost me less than the other one. It arrived 2 days ago. I checked it and it was working, and the package includes everything you need. I think it is very good. What do the experts say?

**broken link removed**

Also if you are new to this I would suggest you try a very nice simulator. It is very very helpful to get you started. You can do simple things first and observe the results. I tried other simulators which were not so accurate some times.
You can check it out here:
https://www.oshonsoft.com/downloads.html
 
I am including 3 screenshots to see the menus and the features.
 

Attachments

  • prog1.jpg
    prog1.jpg
    118.2 KB · Views: 167
  • prog2.jpg
    prog2.jpg
    120 KB · Views: 233
  • prog3.jpg
    prog3.jpg
    120.3 KB · Views: 158
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top