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

Strange-18F4431 Problem.

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



Joined: 12 Aug 2010
Posts: 119

View user's profile Send private message

Strange-18F4431 Problem.
PostPosted: Tue Oct 21, 2014 11:39 pm     Reply with quote

Hi,

I have designed circuit for a display with the following code.
Code:

#include <18F4431.h>
#device ICD=TRUE ADC=10
#fuses HS,NOLVP,NOWDT
#use delay (clock=8M)
#include <flex_lcd.c>
#include <stdlib.h>

void main()
{
   lcd_init();             
   //delay_us(30);
   delay_ms(100);
   while(true)
   {
      lcd_putc("\fHello\n");
      lcd_putc("\World\n");
      delay_ms(1000);
      output_toggle(Pin_B4);
    }
}

which is not working, however when I change the header file to 18F4520.h and use 18F4520 it works on the same circuit board.
Not sure what is the problem.,

please suggest.
Sid
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Wed Oct 22, 2014 12:32 am     Reply with quote

The old comment applies.

If having problems, look at what peripherals are on the pins.

Now, you don't tell us what pins your LCD is on, but look at what the NOPWMPIN fuse does.
Sid2286



Joined: 12 Aug 2010
Posts: 119

View user's profile Send private message

PostPosted: Wed Oct 22, 2014 12:50 am     Reply with quote

MuC Pin LCD Pin
Pin D0 -> E
Pin D1 -> RS
Pin D2 -> RW

Pin D4 -> LCD_D4
Pin D5 -> LCD_D5
Pin D6 -> LCD_D6
Pin D7 -> LCD_D7

I tried NOPWMPIN but still there is no change..
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Oct 22, 2014 5:28 am     Reply with quote

I don't use those PICS but some
other things that need looking at...

1) icd=true. might affect operation,I don't use it but.......

2) HS. is it the correct option for your clock setup?

3) do a delay before the LCD_init. Every LCD module needs some 'waking up time' before you access it. Usually a delay_ms(500) is executed before the LCD_init() call.

4) as Mr. T says....check out what other peripherals are using those pins( or others !).

5) does the classic 1Hz LED test run correctly ?

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Wed Oct 22, 2014 8:43 am     Reply with quote

Try disabling BROWNOUT.

I remember having problems with these chips. Two things. The first was the NOPWMPIN, and the second was that it defaulted to having the brownout enabled, but the voltage set to 'reserved' (impossible combination...).

Agree whole heartedly with Temtronics other comments. Remember if ICD is set 'true', and you are not connected to an ICD unit, resistors are required on the ICD lines of the chip won't work...
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