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.

[SOLVED] Programming problem for pic16f72

Status
Not open for further replies.
Sahu,

I have corrected the syntax errors and successfully compiled your program. However, the main problem you're encountering is:

error: 102****342****There is not enough ROM space****__Lib_MathDouble.c
error: 27****392****Address must be greater than 0 main****MyProject.c
error: 27****392****Address must be greater than 0 main****MyProject.c
error: 27****392****Address must be greater than 0 main****MyProject.c
error: 27****392****Address must be greater than 0 main****MyProject.c
error: 27****392****Address must be greater than 0 main****MyProject.c

The 16F676 has 1k words of flash (ROM) memory for program storage, the program compiled consumes 1361 words. The lack of available program memory is generating the error is red above. Therefore you'll need a different model PIC if you want to program it with this compiled code.

The compiler log:
Code:
0 1 mikroCPIC1618.exe -MSF -DBG -pP[COLOR="#FF0000"]16F887[/COLOR] -DL -O11111114 -fo8 -N"C:\Documents and Settings\Administrator.BDG\My Documents\Projects\MikroC\Sahu\sahu.mcppi" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for PIC\defs\" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for PIC\Uses\P16\" -SP"C:\Documents and Settings\Administrator.BDG\My Documents\Projects\MikroC\Sahu\" "sahu.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_CType.mcl" "__Lib_CString.mcl" "__Lib_CStdlib.mcl" "__Lib_CMath.mcl" "__Lib_Conversions.mcl" "__Lib_Sprinti.mcl" "__Lib_Sprintl.mcl" "__Lib_Time.mcl" "__Lib_Trigonometry.mcl" "__Lib_Button.mcl" "__Lib_Manchester.mcl" "__Lib_OneWire.mcl" "__Lib_PS2.mcl" "__Lib_Sound.mcl" "__Lib_SoftI2C.mcl" "__Lib_SoftSPI.mcl" "__Lib_SoftUART.mcl" "__Lib_ADC_88X.mcl" "__Lib_EEPROM.mcl" "__Lib_LcdConsts.mcl" "__Lib_Lcd.mcl"  
[COLOR="#FF0000"]0 1139 Available RAM: 352 [bytes], Available ROM: 8192 [bytes]  [/COLOR]
0 122 Compilation Started P16F887.c
960 123 Compiled Successfully P16F887.c
0 126 All files Preprocessed in 63 ms  
0 122 Compilation Started sahu.c
173 123 Compiled Successfully sahu.c
0 127 All files Compiled in 31 ms  
[COLOR="#FF0000"]0 1144 Used RAM (bytes): 16 (5%)  Free RAM (bytes): 336 (95%) Used RAM (bytes): 16 (5%)  Free RAM (bytes): 336 (95%)
0 1144 Used ROM (program words): 1361 (17%)  Free ROM (program words): 6831 (83%) Used ROM (program words): 1361 (17%)  Free ROM (program words): 6831 (83%)[/COLOR]
0 125 Project Linked Successfully sahu.mcppi
0 128 Linked in 187 ms  
0 129 Project 'sahu.mcppi' completed: 421 ms  
0 103 Finished successfully: 13 Aug 2011, 22:48:34 sahu.mcppi

I actually compiled your code use the PIC16F887 as a target, so change accordingly.

Attached is the entire zipped project folder.

BigDog
 

Attachments

  • Sahu.zip
    45.2 KB · Views: 71

Sahu,

I have corrected the syntax errors and successfully compiled your program. However, the main problem you're encountering is:



The 16F676 has 1k words of flash (ROM) memory for program storage, the program compiled consumes 1361 words. The lack of available program memory is generating the error is red above. Therefore you'll need a different model PIC if you want to program it with this compiled code.

The compiler log:
Code:
0 1 mikroCPIC1618.exe -MSF -DBG -pP[COLOR=#FF0000]16F887[/COLOR] -DL -O11111114 -fo8 -N"C:\Documents and Settings\Administrator.BDG\My Documents\Projects\MikroC\Sahu\sahu.mcppi" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for PIC\defs\" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for PIC\Uses\P16\" -SP"C:\Documents and Settings\Administrator.BDG\My Documents\Projects\MikroC\Sahu\" "sahu.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_CType.mcl" "__Lib_CString.mcl" "__Lib_CStdlib.mcl" "__Lib_CMath.mcl" "__Lib_Conversions.mcl" "__Lib_Sprinti.mcl" "__Lib_Sprintl.mcl" "__Lib_Time.mcl" "__Lib_Trigonometry.mcl" "__Lib_Button.mcl" "__Lib_Manchester.mcl" "__Lib_OneWire.mcl" "__Lib_PS2.mcl" "__Lib_Sound.mcl" "__Lib_SoftI2C.mcl" "__Lib_SoftSPI.mcl" "__Lib_SoftUART.mcl" "__Lib_ADC_88X.mcl" "__Lib_EEPROM.mcl" "__Lib_LcdConsts.mcl" "__Lib_Lcd.mcl"  
[COLOR=#FF0000]0 1139 Available RAM: 352 [bytes], Available ROM: 8192 [bytes]  [/COLOR]
0 122 Compilation Started P16F887.c
960 123 Compiled Successfully P16F887.c
0 126 All files Preprocessed in 63 ms  
0 122 Compilation Started sahu.c
173 123 Compiled Successfully sahu.c
0 127 All files Compiled in 31 ms  
[COLOR=#FF0000]0 1144 Used RAM (bytes): 16 (5%)  Free RAM (bytes): 336 (95%) Used RAM (bytes): 16 (5%)  Free RAM (bytes): 336 (95%)
0 1144 Used ROM (program words): 1361 (17%)  Free ROM (program words): 6831 (83%) Used ROM (program words): 1361 (17%)  Free ROM (program words): 6831 (83%)[/COLOR]
0 125 Project Linked Successfully sahu.mcppi
0 128 Linked in 187 ms  
0 129 Project 'sahu.mcppi' completed: 421 ms  
0 103 Finished successfully: 13 Aug 2011, 22:48:34 sahu.mcppi

I actually compiled your code use the PIC16F887 as a target, so change accordingly.

Attached is the entire zipped project folder.

BigDog

thank u my dear sir
i have perchege form our local market 16f676 based stabilizer control card . which have all control feacher as my above code.
so ...if microc compiler want 1k words of flash (ROM) memory for program storage.pl sages me which compiler subtable for my code or any other method adc sense & controlled relay

---------- Post added at 14:11 ---------- Previous post was at 13:51 ----------

i think CCS compiler is best for my code ...
http://http://www.sonsivri.com/forum/index.php?topic=920.0;all

if posibol help me for conversion my in
CCS C **broken link removed**
 

You're talking about a 25% savings in code size, I'm not sure any compiler is going to get you that much of a code size difference. You could try Hi-Tech or CCS make sure they are the Professional versions however. Most Lite versions of compiler do not optimize or have limited optimization of the code during compilation.


You may also have to write some of the library routines provided to you by MikroC.

Good Luck,

BigDog

---------- Post added at 09:57 ---------- Previous post was at 09:55 ----------

Frankly, it would be easier to just buy a PIC16F887 and substitute it for the PIC16F676 on your board.
 

I don't think you can fit in that code with Hi-Tech or CCS, even with full optimization. I would think that it would be better to use integer data types instead of float type.

Hope this helps.
Tahmid.
 

like this ..
Code:
if((ch<=4.60)&&(ch>=1.40))
change as..
Code:
if((ch<=4600)&&(ch>=1400))

and
Code:
ch =(float)tlong/1000; // Extract volts (thousands of millivolts)
change as..
Code:
 ch = tlong       // Extract volts (thousands of millivolts)


i am right ???
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top