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.

ROM coding

Status
Not open for further replies.

ktkoota

New Member
Hi,
I have pic18f2420, if I want to write a code on the ROM not RAM what setting in the code are requirede?

Regards,
KtKoota
 
I'll assume you meant a variable and not code. To help in that respect your programming language and complier need to be known.
 
C language.. PICC18.exe
I want to enter a table for months and days and I want them to be in Ram.. is there a specific way for this?
 
Last edited:
C language.. PICC18.exe
I want to enter a table for months and days and I want them to be in Ram.. is there a specific way for this?

In you first post you stated ROM and now you state RAM.

To put a table in ROM you do,
Code:
const rom unsigned char month[12]={
    31,28,31,30,31,30,31,31,30,31,30,31
};

Mike.
 
yeah it was a mistake I meant ROM..
you mean I have just to add (const rom unsigned char ) for any variable to be in rom?

Regards,
Ktkoota
 
Last edited:
If you want it to be an unsigned char then, yes. If you want bigger variables then change it appropriately.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top