CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

LCD works in Proteus - fails in hardware

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rubenskc



Joined: 28 Sep 2011
Posts: 12

View user's profile Send private message

LCD works in Proteus - fails in hardware
PostPosted: Mon Oct 10, 2011 2:09 pm     Reply with quote

Hi guys... thanks for the flex_lcd.c, it's a dream, truly good stuff! The problem I have now:

I wrote a program for my 16F877A that compiles perfectly fine, and runs 100% well when using the generated .cof on my simulation on Proteus 7.1 SP4. LCD running so perfect that hurts! You should see!

However, when writing the .hex file to the actual PIC - nothing happens! Seems that the program "locks" or just freeze. No ideas. PIC plays dead. The programmer works fine - used dozens of times with no problem.... What am I doing wrong? Edited the flex_lcd.c, only altering the output pins.

That's my program
Code:

#include <16F877A.h>

#device adc=8

#FUSES XT
#FUSES NOWDT
#FUSES NOPROTECT

#use delay(clock=4000000)

#include "flex_lcd.c"

void main()
{

setup_adc_ports(AN0_AN1_AN2_AN4_AN5_AN6_AN7_VSS_VREF);
setup_timer_1(T1_DISABLED);
setup_adc(ADC_CLOCK_DIV_2);

set_tris_C(0x00);
set_tris_D(0x00);

output_D(11111111);

setup_ccp1(CCP_PWM);

setup_timer_2(T2_DIV_BY_16,208,1);

set_pwm1_duty(50);

lcd_init();
delay_ms(10);

output_low(PIN_E0);
output_high(PIN_E0);
delay_ms(150);            // beep buzzer
output_low(PIN_E0);

.
.
.
.

_________________
Rubs
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Oct 10, 2011 5:23 pm     Reply with quote

got a schematic of the hardware to post ??

sure the LCD is wired right??
that the contrast bias voltage is set so you can SEE the display?

hint: hardware less forgiving than PROTEUS
but can B just as buggy ;-))

this goofy line got my attention:

output_D(11111111);

??
do you mean '0b11111111'

what does PROTEUS think it means??

lastly as shown it does not compile anyway.......
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Oct 11, 2011 1:17 am     Reply with quote

Seriously, when proteous is even mentioned, I immediately think "Sticky note: Proteus != live hardware"


I'm taking a wild guess that something is not write with the LCD and you're getting stuck in the while() loop that checks the busy flag of the LCD.

I don't have the code handy -- so I can't look... but you might consider starting there...

Got a scope I assume?

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group