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

16c765 not working with a simple prog

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







16c765 not working with a simple prog
PostPosted: Wed Jan 07, 2004 10:56 am     Reply with quote

Hit there. I am a new to this forum.

I tried everything but even the simplest program (see below) does not work.
It compiles fine, and I flash it with Icprog v1.05c.
After flashing Icprog tells me that the component is well verified but when powering up the chip, outputs are not initialized at high levels as they should!

I tried to put a delay to make sure it was not a timing issue, but same problem occurs.

Any suggestion would be most welcome as I am in a dead-end...

Bob.

_________________________________________________


#include <16C765.h>

#use delay(clock=20000000)
void main()
{

SET_TRIS_A(0b000000); //configuration of port A (0=Output 1=Input)
SET_TRIS_B(0b00000000); //configuration of port B (0=Output 1=Input)
SET_TRIS_C(0b00000000); //configuration of port C (0=Output 1=Input)
SET_TRIS_D(0b00000000); //configuration of port D (0=Output 1=Input)

delay_ms(500);

OUTPUT_HIGH(PIN_B1) ;
OUTPUT_HIGH(PIN_B2) ;
OUTPUT_HIGH(PIN_B3) ;
OUTPUT_HIGH(PIN_B4) ;
OUTPUT_HIGH(PIN_B5) ;
OUTPUT_HIGH(PIN_B6) ;
OUTPUT_HIGH(PIN_B7) ;
OUTPUT_HIGH(PIN_B0) ;

OUTPUT_HIGH(PIN_A0) ;
OUTPUT_HIGH(PIN_A1) ;
OUTPUT_HIGH(PIN_A2) ;
OUTPUT_HIGH(PIN_A3) ;
OUTPUT_HIGH(PIN_A4) ;
OUTPUT_HIGH(PIN_A5) ;

OUTPUT_HIGH(PIN_C1) ;
OUTPUT_HIGH(PIN_C2) ;
OUTPUT_HIGH(PIN_C3) ;
OUTPUT_HIGH(PIN_C4) ;
OUTPUT_HIGH(PIN_C5) ;
OUTPUT_HIGH(PIN_C6) ;
OUTPUT_HIGH(PIN_C7) ;
OUTPUT_HIGH(PIN_C0) ;

OUTPUT_HIGH(PIN_D1) ;
OUTPUT_HIGH(PIN_D2) ;
OUTPUT_HIGH(PIN_D3) ;
OUTPUT_HIGH(PIN_D4) ;
OUTPUT_HIGH(PIN_D5) ;
OUTPUT_HIGH(PIN_D6) ;
OUTPUT_HIGH(PIN_D7) ;
OUTPUT_HIGH(PIN_D0) ;

}
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Wed Jan 07, 2004 11:27 am     Reply with quote

How are you setting the fuses?
diego_huelva
Guest







PostPosted: Wed Jan 07, 2004 11:45 am     Reply with quote

The PIC16C765 only works at 24 MHz!!!
You can use a 24 Mhz crystal (fuse HS) or a 6 Mhz crystal (fuse H4)
(H HS 4k PLL in IcProg)
Bob
Guest







PostPosted: Wed Jan 07, 2004 2:14 pm     Reply with quote

I want to use the pic at 24Mhz,
i have to put "HS" in oscillator in ICprog ?
Guest








PostPosted: Thu Jan 08, 2004 5:52 am     Reply with quote

Yes!!!!! but only if you circuit has a 24 Mhz osc.

CCS code...

//if 24 Mhz osc (in ic prog put HS)
#include <16C765.h>
#device *=16
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=24000000)

//if 6 Mhz osc (in ic prog put H3 HS 4k PLL)
#include <16C765.h>
#device *=16
#fuses H4,NOWDT,NOPROTECT
#use delay(clock=24000000)
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