Joined: 08 Sep 2003 Posts: 105 Location: New Castle, DE
Code question for driving a 7447 BCD to 7 Segment TTL IC
Posted: Mon Nov 28, 2011 7:23 am
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
Posted: Mon Nov 28, 2011 10:57 am
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.
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