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

Driving 2 x 74595

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



Joined: 19 May 2009
Posts: 60

View user's profile Send private message

Driving 2 x 74595
PostPosted: Thu Apr 19, 2012 5:39 am     Reply with quote

In the past I've worked with the CCS driver for 74595 successfully. Now I expand my board with a second one. Wiring is correct but I can't seem to make the code work.

Code:

#define EXP_OUT_ENABLE  PIN_C4
#define EXP_OUT_CLOCK   PIN_C3
#define EXP_OUT_DO      PIN_A3
#define NUMBER_OF_74595 2

void write_expanded_outputs(int16* eo) {
 
  int8 i;
......


I changed eo to int16 en number of chips to 2.
I call the function like
Code:

ledwrite=1024;
write_expanded_outputs(&ledwrite);
 

Where ledwrite is an int16.

If I look with the scope nothing comes out. If I change number of 74595 back to 1 it works.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Thu Apr 19, 2012 7:08 am     Reply with quote

You only need to change the number of chips to 2, eo is an array of bytes.

You make the array large enough to hold all the data bytes you want to send, i.e. leave eo as an array of int8's.

Mike
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