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

74595 problem
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
temtronic



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

View user's profile Send private message

PostPosted: Tue Mar 05, 2019 8:14 am     Reply with quote

That depends upon WHAT the 'numbers' on the display represent.
Each 74595 can display 8 bits, so if you have an LED per output pin, you're really displaying 'binary' data.
What is the data you're trying to show? With 4 units, you can show 4 bytes for a total of 32 bits. That could be a single 32-bit number, 2 16-bit numbers, 4 8-bit numbers or 32 1-bit 'on-off' conditions. OR any combination, say 2 8-bit numbers and 16 'on-off' status bits.

How your data (numbers) gets displayed depends on what they are.
You could add 7segment displays to each of the 74595 units and have a 4 digit display that can display numbers (0000-9999) or 4 x hex (0-F) of Alphanumeric, as you have control over each segment of each display.
art



Joined: 21 May 2015
Posts: 181

View user's profile Send private message

PostPosted: Tue Mar 05, 2019 6:06 pm     Reply with quote

art wrote:

Code:
                                                   
                                       data =gethex_usb();
                                       write_expanded_outputs (&data);   



Based on gethex it will only read BYTE.
If I want to to read 2 BYTE , what do i have to change?
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Wed Mar 06, 2019 1:14 am     Reply with quote

Declare data as a 2 byte array.

Then call get_hex as:

Code:

     data[1]=gethex_usb(); //get MSB
     data[0]=gethex_usb(); //get LSB
 
     write_expanded_outputs(data);


Now (obviously) the order you access the bytes in the first two lines
depend on the order you want the data presented to the output (up to
you). Also given you are then using an array, no need to '&' in the output.
This is then dependant on you having the expanded output code setup to
use two chips. So 'NUMBER_OF_74595' set to 2.
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