Page 1 of 1

dp in 7 segment display

Posted: Mon Nov 25, 2013 12:32 pm
by bluejetsthree
If not using the dp in a seven segment display one has to "connect" it but then turn it off if it is not required in the macro.
So, if one wants to use this pin for another purpose, how does one go about it.??

Re: dp in 7 segment display

Posted: Sat Nov 30, 2013 10:49 pm
by bluejetsthree
No answers here.......perhaps technical could advise.

Re: dp in 7 segment display

Posted: Tue Dec 03, 2013 1:26 pm
by Benj
Hello,

The 7seg component requires a pin to drive the decimal point and assumes that this is what you will be using it for. I think there will likely be a compile error if you do not assign a connection to the pin but what about if you use a pin which is already assigned to one of the anode or cathode pins? This may not work perfectly but may give you a workable solution leaving your other pins free to do what you like with.

Here is the v5 C code you could override to switch off the DP pin.

ShowDigit function

Code: Select all

		//if (cSegmentValue & 0x80)
		//{
		//	FC_CAL_Bit_High_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
		//}
		//else
		//{
		//	FC_CAL_Bit_Low_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
		//}

 		......

		//if (cSegmentValue & 0x80)
		//{
		//	FC_CAL_Bit_Low_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
		//}
		//else
		//{
		//	FC_CAL_Bit_High_DDR(%a_SEG_PORT, %a_SEG_TRIS, %a_SEG_PIN7);
		//}

Re: dp in 7 segment display

Posted: Tue Dec 03, 2013 11:48 pm
by bluejetsthree
It does not get as far as a compile error.
I do not see the need to do a c code.
It simply will not accept that the dp pin is left disconnected in the "connections".
It will however allow turning it on or off in the macro as i explained earlier but it appears cannot be used other than that.
Ok..thanks.

Re: dp in 7 segment display

Posted: Wed Dec 04, 2013 11:00 am
by Benj
Hello,

If you attach your Flowcode program then I will do some minor edits to remove the DP functionality by customising the C code embedded in the 7-seg component in your project.