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] help for compailing c file for PIC16F688

Status
Not open for further replies.
Joined
May 1, 2010
Messages
119
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,308
Location
India, Kerala, Moolamattom
Activity points
0
Please help and compaile this file and i need the hex file. i try many times with MikroC compailer. But i dont get the HEX file. So help me anyone to view this article.

Thanks in advance






/*
Digital Voltmeter based on PIC16F688
Rajendra Bhatt, Oct 12, 2010
*/

// LCD module connections
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections

char Message1[] = "DVM Project";
unsigned int ADC_Value, DisplayVolt;
char *volt = "00.0";

void main() {
ANSEL = 0b00000100; // RA2/AN2 is analog input
ADCON0 = 0b00001000; // Analog channel select @ AN2
ADCON1 = 0x00;
CMCON0 = 0x07 ; // Disbale comparators
TRISC = 0b00000000; // PORTC All Outputs
TRISA = 0b00001100; // PORTA All Outputs, Except RA3 and RA2
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // CLEAR display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,Message1);
Lcd_Chr(2,10,'V');

do {

ADC_Value = ADC_Read(2);
DisplayVolt = ADC_Value * 2;
volt[0] = DisplayVolt/1000 + 48;
volt[1] = (DisplayVolt/100)%10 + 48;
volt[3] = (DisplayVolt/10)%10 + 48;
Lcd_Out(2,5,volt);
delay_ms(100);
} while(1);

}
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,236
Helped
1,151
Reputation
2,321
Reaction score
1,127
Trophy points
1,403
Location
Brazil
Activity points
53,762
If no errors where found it´s just a question to configure compiler.
Had you searched on project this folder ?

+++
 

Joined
May 1, 2010
Messages
119
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,308
Location
India, Kerala, Moolamattom
Activity points
0
Nice to meet you
When i try to build the above programe in MikroC compailor, there is some warning in the line
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;

actually what is the problem in this programme? how i compalied ?

Thanks for your valuable replay
 

bjuric

Advanced Member level 4
Joined
May 4, 2011
Messages
115
Helped
32
Reputation
64
Reaction score
30
Trophy points
1,308
Location
Serbia
Activity points
1,980
Here's the hex.

The settings:
Oscillator: 8MHz
Watchdog: off
Power Up Timer: off
Master clear: enabled
Code & data Protect: off
Brown out: disabled
Internal/external switch over: enabled
Monitor clock fail-safe: enabled

EDIT -> just remembered
You need to enable the "Lcd" libraries on the 'Library Manager' tab on the right side.
 

Attachments

  • Voltmeter.zip
    1.3 KB · Views: 6
Last edited:

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top