BernardQuatermass21
Member
Im passing data to a 4 digit seven segment display. It requires the data to be passed serially, and clocked using a separate pin.
I have tried a simple bit banging approach and it all words fine...but i want to have a clock display that increments every 10ms, as it will be filmed with a high speed camera. Sadly, Passing the data using my current code takes just a bit too long to support this. A fragment of the code is shown below. I'm just testing bit values in the B0 variable and setting the data line low or high as appropriate and toggling the clock line.
symbol Digit = B0
symbol Digit1_SS = B1
symbol datapin = C.0
symbol clockpin = C.1
Digit1_SS= %00110011
Digit = Digit1_SS
if Bit0=1 then
low datapin
else
high datapin
end if
high clockpin
low clockpin
if Bit1=1 then
low datapin
else
high datapin
end if
high clockpin
low clockpin
if Bit2=1 then
low datapin
else
high datapin
end if
high clockpin
low clockpin
and so on.....
I wonder if theres anything I can do to speed if up ? Im running at the fasted clock freq for the chip.
cheers
Nick
Nick
I have tried a simple bit banging approach and it all words fine...but i want to have a clock display that increments every 10ms, as it will be filmed with a high speed camera. Sadly, Passing the data using my current code takes just a bit too long to support this. A fragment of the code is shown below. I'm just testing bit values in the B0 variable and setting the data line low or high as appropriate and toggling the clock line.
symbol Digit = B0
symbol Digit1_SS = B1
symbol datapin = C.0
symbol clockpin = C.1
Digit1_SS= %00110011
Digit = Digit1_SS
if Bit0=1 then
low datapin
else
high datapin
end if
high clockpin
low clockpin
if Bit1=1 then
low datapin
else
high datapin
end if
high clockpin
low clockpin
if Bit2=1 then
low datapin
else
high datapin
end if
high clockpin
low clockpin
and so on.....
I wonder if theres anything I can do to speed if up ? Im running at the fasted clock freq for the chip.
cheers
Nick
Nick