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 CCS Technical Support

from 16F84 to 16F88 no longer works
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 12:58 pm     Reply with quote

sorry, I forgot... 470 ohm
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 1:08 pm     Reply with quote

Why do you need to use the 2nd circuit, where you externally supply
+5v to the anode of the LED ?

I always use the first circuit, where the PIC supplies the +5v to the
anode of the LED (through a resistor), and the cathode is grounded.
Why not just do it that way, since it works.
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 1:14 pm     Reply with quote

I tried the second circuit just to find a difference between RB6 and RB1.

Because using B6 and B7 the LCD doesn't work! (but it works using B0 and B1).
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 1:28 pm     Reply with quote

Do you mean that RB6 and RB7 don't work with any LED circuit ?
They never work ?
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 1:33 pm     Reply with quote

If I use RB6 and RB7 to command the display, the lcd display doesn't work.

The only one way to see the LCD working is use different pins (like B0 and B1)
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 2:21 pm     Reply with quote

Instead of asking more questions, I just decided to install vs. 3.160 and
jumper my PicDem2-Plus to your configuration. I made it work.
The problem is that your version of the compiler has bugs for the 16F88.

I used the LCD connections that you specifed in an earlier post:
Code:

#define LCD_DB4   PIN_B4
#define LCD_DB5   PIN_B5
#define LCD_DB6   PIN_B6
#define LCD_DB7   PIN_B7

#define LCD_E     PIN_B3
#define LCD_RS    PIN_B2
//#define USE_LCD_RW   1
 


Then I modified the test program, to add the four lines shown in bold
below. These lines fix problems with your version of the compiler.
Your version of the compiler does not setup the Analog pins as digital i/o.
Also, the setup_adc_ports() function doesn't work correctly. So, I used
a #byte statement to define the address of the ANSEL register and then
in main(), I set it to 0, which makes all pins be digital. Also, the A/D
converter is turned on by the CCS start-up code, and that's not needed,
so I turned it off by writing 0 to the ADCON0 register. Then it works.

Add the lines shown in bold below:
Quote:

#include <16F88.h>
#fuses XT, NOWDT, NOLVP
#use delay(clock=4000000)

#include "flex_lcd.c"

#byte ADCON0 = 0x1F
#byte ANSEL = 0x9B


//=====================================
void main(void)
{
ADCON0 = 0; // Disable A/D converter
ANSEL = 0; // Set i/o pins to be all digital

lcd_init();

lcd_putc("\fHello World");

while(1);
}
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

PostPosted: Tue Oct 20, 2009 1:10 pm     Reply with quote

oh wow, thank you very much!
I was thinking that there was something wrong on my software and hardware. Fortunately it isn't!
Ok, the problems changing from 16F84 to 16F88 came just from using old compiler version.

thank you very much!
anhcmut



Joined: 02 Jul 2011
Posts: 1
Location: ho chi minh-viet nam

View user's profile Send private message Yahoo Messenger

16f84.h
PostPosted: Sat Jul 02, 2011 11:57 pm     Reply with quote

have you got the 16f84.h ? could you post in the website ?
thank you very much !

++++++++++++++++++++++
See Forum Rule #10:

10. Don't post the CCS example code or drivers, or ask for such code and drivers. (including header files).


-- Forum Moderator
++++++++++++++++++++++
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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