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

Code question for driving a 7447 BCD to 7 Segment TTL IC

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



Joined: 08 Sep 2003
Posts: 105
Location: New Castle, DE

View user's profile Send private message

Code question for driving a 7447 BCD to 7 Segment TTL IC
PostPosted: Mon Nov 28, 2011 7:23 am     Reply with quote

I have a 7447 BCD to 7 Segment driver IC connected to port b bits 0-3.
I'm using this with a 8 digit VDF tube to multiplexing a through g.
I'm look for the most speed that I can get.
Right now I'm using a modified send nibble fiction from the LCD programs.
But this seems to be slow.

What is the easiest way of send a nibble to a port without affecting the 4 MSBs?
Is there a faster way just to change the lower 4 bits of a port?

Thank You All in advance!
Tom
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Nov 28, 2011 10:57 am     Reply with quote

Code:

byte newnib; // focus=low 4 bits  - you can use SWAP(newnib) twice if its HIGH
// get the current value and do some masking
output_B((input_b()&0xF0)|(newnib&0x0F));


this MAY take up to 12 instructions to accomplish on a 16F886
but due to better memory access never needs more than 8 clocks
on an 18F4520

( to use fewer clocks where memory is in play -
always consider the 18F parts )

U can see if this works for you well enough.
meanwhile....
i can't wait to see how the REALLY clever folks on the forum would do this,
as i am always eager to learn how to use fewer clock cycles myself.
Very Happy
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