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.

PIC16F84 and stepper motors?

Status
Not open for further replies.

43617373

New Member
Hello, I have just started thinking about micro controllers but have yet to get my hands on any compilers since so far the ones I have found go for around $200. I was wondering if any of you would now if this would work to control the steps for a stepper motor.

Code:
Poke TRISB, 0
loop:
Poke PORTB, 5
Pause 2
Poke PORTB, 9
Pause 2
Poke PORTB, 10
Pause 2
Poke PORTB, 6
Pause 2
Goto loop
End

I think it should come out as 0101, 1001, 1010, 0110 across RB0 - RB3 but since I have not yet gotten any parts and started experimenting with them I am unsure... Would that work if RB0 - RB3 where connected to the correct coils, probably through transistors for higher voltage.

Edit: Also browsing though this forum I see a lot of C, would that be a better language to learn than Basic?
 
Last edited:
43617373 said:
Edit: Also browsing though this forum I see a lot of C, would that be a better language to learn than Basic?

This question could result in a language debate that could run for several pages. Let me attempt to nip that waste of time in the bud.

How good any language is depends on the merits of the language and the quality of the compiler.

A lot of people like basic and many basic compiler are capable of doing most anything you need to. Check the abilities and limitations of each. The fairly new Swordfish basic compiler seems to be gaining favor. It can be had with some very NIFTY tools that do everything from schematic capture to simulation. It is expensive.

A lot of people like C. C is more often used in the EDU and workplace. Some may disagree. There are several C compiler vendors that offer evaluation version of their compiler with limitations of some sort. The CCS compiler for example only works with 2 chips (16F877 is one) and you are limited to 2K words of generated code. You can do a lot with 2K.

If you go with the 18F series of PICs microchip has a free student version of their compiler that is limited only by optimization. (compactness of generated code).

As Nigel said learning assembler is a valid option.

In part what you choose to do depends on what you already know and where you want to go.
 
Thank you. Does anyone have any recommended books/websites for learning Assembly?
 
43617373 said:
Thank you. Does anyone have any recommended books/websites for learning Assembly?
Yes, internet is more than enough. See Nigel's signature. I learn a lot from there.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top