Sign In

Displaying "digits" On Alpha-numeric Displays

Spencer sabspencer@gmail.com South Africa

Hardware: PIC18F45K22 - With Internal Oscillator At 64 MHz Software: This Is My Choice For The Moment... FLOWCODE From MatrixTsl In The UK

Hi Folks... yes.. I am a pensioner.. learning, how to use PIC / AVR processors.. for various little projects... that are really very simplistic.

One such project.. is to display some numbers on 4 alpha-numeric displays, which are common cathode.. and have segment annotations, from A through to F.. then G1,G2, then H - M ... So what I have is that in FLOWCODE, one can have "great fun", setting up PORTS, and 'parts of a PORT', to get enough I/O to drive the segment LED's in the display.. If I use C-code.. I expect to be able to really "in a flash" create a setup of.. sorts that can drive normal 7-segment.. displays.. with only 7 segments...!!

Now in my project.. I need to drive all segments of an alpha-numeric display.. but with differing requirements on the segments of the LED's..

So what I did was to use FLOWCODE ver 6... and I would simply create a LOOKUP TABLE.. with '1's and '0's... which would form the numbers I would be wanting to display on the 7-segment displays.. I would do this via the SWITCH decision option... so that if the number I wanted on the TENS position... (1st display in a series of 4)... was say 3... then I would read-off the LOOKUP TABLE... of number 3... and then fill up the relevant array..

As in FLOWCODE... the only way you can "talk" to a PORT BIT directly, is to use the said functionality.. in which you would place an INPUT / OUTPUT icon... say the OUTPUT icon.. and then you select either... a '0' or a '1' ... or you can select a setup variable... to carry the '1' or the '0'.. so in my project.. because FLOWCODE is a 'little slow'... and you really cannot do exactly as you want to.. or would in C-code.. you can only 'print' to a PORT.. by loading all the I/O's.. and then either dumping to that PORT... which would be the same as the way we would serially address the PORT... a BIT at a time.. 'serial address' means that to output to a PORT .. either as a PORT... or in a BITWISE mode... by creating the FLOWCODE diagrams..
So now.. I have the problem of the aplha-numeric display.. which requires that more than one total PORT is used.. and so I need like a further 8 I/O's.. to create the number I want to display... Is there a simple way in C-code.. that I can 'fill' a full PORT.. and then singular PORT BITS.. like in ONE GO...!!??
I expect there is..!!..could someone show me the code for that please... because once I have that 'compiled'.. it's time to 'output print' these PORTS.. and characters.. to the said alpha-numeric display...

Images

Replies

R Avinash Gupta
2016-05-24 05:10:46
Hmmmm a lengthy narration still hard to get what you are trying to say.

I think you are using a display like one I have attached an image of. It has total of 16 segments(leaving the decimal point).

So you need two i/o ports for each segment. You can make a function in C that takes a 16 bit value as argument and then split and send these two to the two i/o ports.
R Avinash Gupta
2016-05-26 01:45:24
We are waiting for your reply ...
R Spencer
2016-05-26 06:13:27
Hey folks... good day... well - now this is nice... So what I have done.. is I have used FLOWCODE.... (you all should try it).. and I have successfully achieved the display correctly.. and I can set the "speed" at which I want 'refresh' to be done.. and also how many times I want the displays refreshed... it's very easily achieved in FLOWCODE... So now the problem I have is that I am looking at the Dallas chip.. the DS18B20, or the lower resolution model.. the DS18S20 or the plain DS1820...
Dallas reckons that to do a temperature conversion takes 750 msec.. which is true... for the B20.. chip..
Since I usiing both.. I have routines in FLOWCODE, to do this for both types of chips.. and also do the math for both types of chip... (If anyone wants to see this... just ask - and if / when I get the time.. I will definitely... send them onto you...
So now this is where I appealing to the "very clever people" out there... the ones that I call superb EUSIE.. variety... So what I need to do.. is to.. still utilize the same chip ... the PIC16F45K22 microchip.. which I have gotten to run at 64 mHz.. without a crystal... and what has to happen.. is that.. I need to realize that the chip can only do one thing at a time... so you either refresh the multiplexed display.. or you are "wasting" time getting a conversion done... in the Dallas loop..!! and then... (as I have tried unsuccessfuly). to keep the display alive, and also go get a high resolution Dallas temperature conversion.. done..!!! without the routines of the refresh display... being interrupted too... much...!!
I do not think that this is possible..!! so what I done is to have two processors.. one to do conversion.. of the Dallas chip.. and the other to do the display logic.. and also the fetching of data.. from a serial TX/RX port on the chips..!!
Also - still to be implemented... is the fact that I got - about 4 hardware buttons to be pressed... that will control the relays that have to be controlled in this whole project.. So the alpha-numeric displays needs... about 14 segments,.. to be lighted.!! and then also a decimal point.. there is also... 14 common cathodes... joined of course to one pin.. on one, and one pin on the other.. my displays are two in one casting..!!
So I have decided that the one chip - the slow coach Dallas routine, chip.. will have to be fast enough to do the Dallas routines.. and then also have the buttons to do the relay selection. This chip will be the PIC16F1509, which has maybe just enough pins for this job.. The bigger display driver chip.. will also fall away.. and I will use.. a smaller chip in there... like a 16F2520, or maybe 16F2550...??.. (hopefully there are enough pins to go around... I will look see..!!

However the challenge is still open.. IF ANYONE THINKS that they are clever enough to do a proper Dallas conversion... either with interrupts, or whatever.. and still use the PIC16F45K22.. to do both tasks.. then I will also ask you to implement.. (as not done yet).. push button routines.. which will also display some text.. I have done some of these in FLOWCODE as well - but run out of time.. so I have decided to split and feed the displayable characters.. from one chip to the other..

Thanks for reading.. but I love this PIC stuff... and I also do... AVR... like arduino... and also chipkit... with FLOWCODE... I can write one set of flowcharts.. and simply select another type of processor.. I have not got the ARM variety.. yet.. although they now becoming popular..!!.

I have another problem.. I live in South Africa.. and BOY oh BOY... is this place dying fast... Even the hardy... are starting to FLAG... and the whole problem.. is that the ELSIE are in control.. and their natural way of life, is causing their whole existence, to slowly implode... and they will eventually become extinct.. THEY ARE RACING EXTINCTION...!! (talk about watching a movie called RACING EXTINCTION)... come and live in South Africa... and get horrified.. as you watch what I have trained myself to study, and researched, for over 50 years now... happen, and unfold... each day.. It's not funny.. so for me to buy things "overseas" is now useless..IT COSTS TOO MUCH - GETTING WORSE... everyday.. you cannot "post" me anything anymore... it is treated, as the country's biggest gifting shop.. cause none of the stuff arrives at the destination.. anymore.. but gets taken out the post, by ELSIE takers.. who think that they need it more than the owners..

Okay folks - thanks... I hope to read somethings.. from you folks out there...!!

Post a reply to Spencer

Think you can help Spencer ? Then post your thoughts that might help Spencer. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.