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.

pic 24's and 18's

Status
Not open for further replies.

Joe G

Member
Does's anyone actually program these in assembly? I've tried to write and sim code in assembly for a PIC18LF45K80 and a PIC24 and it just errors. Also I've only ever seen C code for them. I've been trying to learn C just to use these better pics, but I'd like to start using them w/ assembly whilst I try to learn C.

thanks :)
 
I personally wouldnt touch 18 family and up with asm your looking for a pain. Just get C on them, it's so simple.

But answer to your question, no I don't sorry.
 
If you post the source you have tried... Someone will explain your errors.

There are a good few here on this site that use assembler on these devices..... You can program ANY CHIP in assembly... That's what most C compilers produce...

If you can program in basic... Grab a free basic ( sourceboost.. greatcow... picbasic (lite) ) and write small routines... Then compile and view the assembly output, This will give you a better understanding..
 
Does's anyone actually program these in assembly?)

Hi,

Have used the 18Fs with assembly for many years, they are so much easier than the 16F chips with their large Ram banks and directly addressable program memory space, no more pagesel etc.

The only problem comes if you are wanting to do high end projects like USB, virtually all code examples from Microchip are in C

The K series are a little more comlicated than the standard 18F as they have so many selectable features and as a result about 30 system registers like ANSEL are not within the Access Ram so need specific banking when you access them ( a bit of a backwards feature)
 
thanks all, I was just trying to turn a led on in C, its taken me awhile just to do that. Starting all over again w/ c18. when I first got the chips I tried w/ assembly and it
would not build. after fruitless efforts I just figured its time to learn C. C does seem easier to write once you learn it , especially w/ all the extra banks, and the math...
 
I work currently in Assembly with the 18F family.

I am not C conversant.
 
I've been curious if anyone uses assembly in them. Back in January I tried programing a PIC18LF45K80, then a pic24 in MPLAB and if memory serves me ok, I used just the mpasm which did not build. Then C18 which also didn't work. I even tried anding in a "asm" and "end asm" in a short C code which also didn't build. Can't quite remember now. Been trying to learn C on and off since then and using up my supply of pic16's.
 
Not hard, really...

Hola Joe,

When I changed to the 18F family, first thing I did was to port all my macros what quickly gave me a feeling of the differences (read advantages).

Next was to find out those things that didn't exist in the 16Fs. Never looked back to them.

Many years ago I changed my attitude for when starting with a new micro: careful initialization what made for almost zero surprises when programming one for the first time.
 
Ah, ok, maybe I'll give assembly another try then, but I'll still make my goal of learning C this year!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top