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

interfacing pic micro with shift register

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







interfacing pic micro with shift register
PostPosted: Mon Dec 24, 2007 3:19 am     Reply with quote

Dear sir,
I have an appln wherer i have to read 4 line status connected to 74hc165 as 4 parallel i/p.i have interfaced this IC to PIC micro.Basically i am using 3 pins ....1) CP 2) PL 3) Q7.
CE pin is gnd.Could anyone has sample C code.My understanding to read 4 line status is steps as below:
1) CLK -> HIGH
2) PL -> LOw
3) PL-> HIGH
4) repeat in loop 4times ....
a) read the pin value and shift the result in a read165 variable.
b) CLK -> LOW
c) CLK -> HIGH
5) PL -> LOW
6) Now analyze the status.

pls review and help ..

regards,
arp
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Dec 24, 2007 6:41 am     Reply with quote

The steps you describe above are very easy to translate into a program, basically every line in your sequence equals to a single C command.

So, you bought a C compiler but don't know how to program in C? Sounds like a school assignment. I can help you by giving an example program but then you would be coming back for every little change again and again. Sorry, but the best way for everybody is when you try to learn C first.
arup
Guest







PostPosted: Mon Dec 24, 2007 10:36 pm     Reply with quote

ckielstra!!
already used 2 c compilers . yes me new to pic micro.but not to C.......
hope this will hep u in giving further suggestions
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 24, 2007 10:50 pm     Reply with quote

See the following CCS driver and example files:
Quote:

c:\Program Files\picc\Drivers\74165.c
c:\Program Files\picc\Examples\Ex_expio.c

More information on using 74165.c:
http://www.ccsinfo.com/forum/viewtopic.php?t=29364
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