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.

16bit pic assembly

Status
Not open for further replies.

Daniek

New Member
Hello

I was wondering if anyone out there knew of some example programs for the dspic's or pic24's? I have tried looking at microchips site, and searched a bit, but I can't seem to find any support other than for C.

Looks like I might have to learn c. Eek
 
Have you looked at the PICASM manual? I'm not sure if it applies to dsPICs as well, but there is probably an equivelant floating around somewhere.
 
I've done some assembly programming for 16 bit PICs.

Here is an example if you want it. You need the .inc and the .gld files in the project directory, as well as the code in a .s file.

This measure temperatures with some DS1802 temperature sensors, drives a display and turns on and off two outputs. The temperature limits can be changed with a pushbutton.

The application could probably be easily done with an 8 bit PIC but it gives some ideas.
 

Attachments

  • p24FJ32GA002.zip
    26.6 KB · Views: 140
Hello
I was wondering if anyone out there knew of some example programs for the dspic's or pic24's? I have tried looking at microchips site, and searched a bit, but I can't seem to find any support other than for C.

Looks like I might have to learn c. Eek

Microchip has not been forthcoming with ASM support for the 16-bit series. They just now started to supply links to the 24F family datasheets. I was forced to use the dsP family as a reference and of course kept using instructions that failed in code because they do not apply to the 24F series. I included a few attachments that show some examples. The main aspect of 16-bit is you need to increment address by 2, use even address, and be knowledgeable about what registers you are using. NO MORE BANKING!!!
 

Attachments

  • 24F-5X7_RAM.txt
    1.7 KB · Views: 164
  • 24F-5X7-part1.txt
    10.9 KB · Views: 239
  • 24F-5X7-part2.txt
    10.2 KB · Views: 377
hey


Thanks for the examples people, just what I wanted. Just needed something to get me started, I can probably fumble my way from this.

dknguyen
I couldn't find anything like that, I couldn't find the PICASM manual either though, so maybe I just don't have satisfactory looking skills.

I think I've got what I wanted anyways...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top