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.

C Microcontroller tutorial?

Status
Not open for further replies.
Bill said:
The problem you might have being a Linux user is that most tools are for windows. MPLAB, C18 both excellent tools are for windows.

The machine i will use for PICs will be running windows because of that.

aussiepoof said:
I didn't say anything offensive. At no point did you say you were quite comfortable with C. Nor did you mention Linux (use of which doesn't imply knowledge of C at all.)

I know. ;) I was just saying. I am a tux head.


3v0 said:
If that is all that is holding back you should have said so.

Start by getting sampling these parts if you want my help.

18F1330's are 18 pin PICs that can be run up to 32Mhz using the internal OSC.
Get some 1024K Byte EEPROM 24FC1025-I/P and/or 24LC1025-I/P, you can use these to work with I2C.
If you are interested in doing the recorded voice thing from mondo you will want their digital pots MCP41010-I/P.
Do not order and 16F parts.

If you make this order I can have you up and running very quickly. The parameters are cook book stuff. I can give them to you. You can also figure them out from
MPLAB C18 PIC18 Configuration Settings Addendum

well, that isn't the ONLY problem, but it is sure one of them. I am confused now. :( Thank you so much for the ICD clone, and i am sorry if i am being a pain in the ass, but this is all really too much for me! :( :(

I DO NOT understand assembly. If i understood how it works, then maybe i could get my head around PICs. It is kinda hard to learn when i have been nothing but self taught. :(

more later
 
Marks256 said:
I DO NOT understand assembly. If i understood how it works, then maybe i could get my head around PICs.
It's not going to just "come to you". You have to go get it. Get started by reading about it. Books and/or internet - it doesn't matter. But don't just read. Start writing some programs. Borrow someone else's code and modify it if nothing else.

It is kinda hard to learn when i have been nothing but self taught. :(
Of course it's hard. If it was easy then everyone would be doing it. I'm self taught, and I learned C and 6809/68000/Z80/80x86 assembler before there was internet (when it was HARD to get info).

The web is FULL of good information (as well as a lot of crap). It's not going to be easy no matter what kind of spoon-feeding tutorial you get. Dig in and get doing it. Start small.

You can make excuses forever but that will get you nowhere.
 
Marks256 said:
I DO NOT understand assembly. If i understood how it works, then maybe i could get my head around PICs. It is kinda hard to learn when i have been nothing but self taught. :(

Most people are self taught PIC assembly, personally I'm self taught all my programming languages.

Just work at it, you seem to keep starting loads of different projects (like a Z80 board) and never getting anywhere with any of them.

PIC assembler is simple, as 16 series only has 35 commands, and a fair number of those are only used very occasionally.
 
Marks256 said:
well, that isn't the ONLY problem, but it is sure one of them. I am confused now. :( Thank you so much for the ICD clone, and i am sorry if i am being a pain in the ass, but this is all really too much for me! :( :(

I DO NOT understand assembly. If i understood how it works, then maybe i could get my head around PICs. It is kinda hard to learn when i have been nothing but self taught. :(

more later
Need to know what your are confused about ?

With a 18F1330 you can have a PIC up and running on a breadboard with little more the a few wires and a bypass cap.

You do not have to understand ASM to get started. You need to get your feet wet so to speak. Once you can blink an LED or six with your code, you can look at the listing file and get a feel for how the machine is doing the work. How the asm relateds to the C code. BUt one thing at a time. That way you will never be in over your head.

Since you already know C you are in a good position to do this. It is a lot of fun. Really it is.

FWIW the only switches/config you need to get a 18F1330 working is
Code:
#pragma config WDT = OFF 
#pragma config OSC = INTIO2
#pragma config PWRT = ON
#pragma MCLRE = ON
At that point it will work. For most apps you would want to speed up the clock but that is just another few lines.
 
Last edited:
blueroomelectronics said:
I built a COSMAC Elf 1802, and blinked the LED. I hated entering the program (with a hex keypad) everytime I turned it on.
Holy crap! You're old! :D :D (Just kidding :p ) I have that issue of Popular Electronics still. Looked at the Elf. Had no money then. Wanted a Kim-1 and a SWTP 6800. Started programming BASIC in 1977 on a TRS-80 Model 1 at school.
 
Me too.

blueroomelectronics said:
Amazingly I've never learned C, dunno why. And I've even hand coded 6502.
C isn't so bad. I've never liked it much, mostly because, at least on a PC, there's SO MUCH setup code before you actually get down to really doing something. You soon learn to have skeletons built and ready for each new program to alleviate the drudge work of starting from scratch every time. Also, when I was programming in C the compiler made bloated, slow code. I could do the same thing in assembler and have it run hundreds or thousands of times as fast in a tiny fraction of the memory space (memory was at a premium then, as you know).

These days C and BASIC and Python and lots of other languages aren't so different from each other anymore. You'd pick it up easily.
 
blueroomelectronics said:
Yep 46, not as old as Nigel or AudioGuru though :)

Amazingly I've never learned C, dunno why. And I've even hand coded 6502.

I've done some Assembly for the 6502. I preferred the Z80... although admittedly, the Z80 encourages more relaxed programming techniques. Which isn't a good thing.

Brian
 
Go Sysin Dd*

futz said:
C isn't so bad. I've never liked it much, mostly because, at least on a PC, there's SO MUCH setup code before you actually get down to really doing something.

It takes some setup to get a system to do what you need. I do not think that is about to change any time soon. Some languages hid it from you. There is little advantage in that. You can always ignore the non interesting stuff. But if you can see it you can change it if needed. Not so if it is hidden.

With C you can always set a breakpoint on main and hit run. It will put you where your code starts.

The same is true the link step.
 
Last edited:
blueroomelectronics said:
Yep 46, not as old as Nigel or AudioGuru though :)

Don't know as I like being put in the same age group as AudioGuru? :p

Amazingly I've never learned C, dunno why. And I've even hand coded 6502.

I've dabbled with C occasionally, and even bought the Lattice C compiler for the Amiga (at HUGE!!!! expense) - but never really got on with it. I have converted a LOT of C to Pascal in my time though! :D

My first micro-processor experience was also hand assembling 6502 code, on a MicroTan Tangerine system - which I still have.
 
You too are OLD!

Everybody is old for somebody else, at any time in life! You too!

:(
 
Nigel Goodwin said:
Just work at it, you seem to keep starting loads of different projects (like a Z80 board) and never getting anywhere with any of them.

i know. :( I still want to build it, but there are a few more high priority things on my list... like PICs...

Ok. I will TRY to mess around with them this weekend. If i have any qestions, i will ask here.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top