Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to initialize rom memory

Status
Not open for further replies.

chasekan@gmail.com

Member level 1
Joined
Jun 23, 2013
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
255
Code:
  #include <htc.h>
   rom unsigned char mydata[]="hello";
void main(void)
 {
   // Write your code here
   unsigned char z;
	 TRISB =0;
	 for(z=0;z<5;z++)
	 {
		 PORTB=mydata[z];
	 }
	 while (1);
 }

hi i am using hi tech c compiler,to store the data in the program code space, here i ve used rom keyword, is the way correct or i ve to use any other notation....it shows the below error msg....if possible suggest me some material for to get knowledge in PIC controller using Hi tech c compiler.

HTML:
Warning at file ../main.c line 9 column 5: (374) missing basic type; int assumed
Error at file ../main.c line 9 column 5: (314) ";" expected
make: *** [main.p1] Error 1
 

Try

const unsigned char

It works in xc8 compiler and i am sure it work in hi tech also
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top