EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

HC12 Potentiometer

Started by billyboy_2345 September 9, 2005
Hey everyone
Im trying to program a HC12 using ImageCraft C to display a rotating
graphical symbol or shape on the top line of the LCD (2 * 8), with the
rotation speed being set by the Front Panel (ADC) potentiometer.
Im having some trouble getting into it.
Would anyone have any code examples that would point me in the right
direction?
It would be a great help.
Thanks heaps.


Hi,

I have used the following characters to do this: "\|/-"

This way You only need to use one custom character - the backslash.

I have also used the characters 0x80-0x9f in strings to be directly translated
to low and high level commands to the display by the lcd routines. This way I
can write stings something like this:

STRLCD_CMD_CLR "** OXY CHECK **" STRLCD_CMD_HOME_2ND "V1.23 2003-03-12"

or

STRLCD_CMD_SAVEPOS STRLCD_CMD_SETPOS "\xc9" STRLCD_CMD_INCWHEEL
STRLCD_CMD_RESTOREPOS

Where STRLCD_CMD... are values in the range 0x80-0x9f that gets translated
either directly to one LCD command or several more complex operations.

I also have a buffer where the main program puts strings to be written to the
LCD and a background task for the LCD which retrieves the characters and
commands from the buffer and sends them when the LCD is ready to receive them
(reading the busy flag).

Sorry, but I don't have any code to share for this right now.

> Hey everyone
> Im trying to program a HC12 using ImageCraft C to display a rotating
> graphical symbol or shape on the top line of the LCD (2 * 8), with the
> rotation speed being set by the Front Panel (ADC) potentiometer.
> Im having some trouble getting into it.
> Would anyone have any code examples that would point me in the right
> direction?
> It would be a great help.
> Thanks heaps. >
==============================
Ruben Jsson
AB Liros Electronic
Box 9124, 200 39 Malm Sweden
TEL INT +46 40142078
FAX INT +46 40947388
ruben@rube...
==============================


G'day, billyboy_2345, and welcome.

Is this a homework assignment? It sounds like one.

I would tackle it by writing a little delay loop and updating the
displayed character each time the loop completes. After that, get the
ADC working, and use the value you read from the ADC to set the number
of times you iterate in the delay loop. If needed, tweak the ADC value
to get a satisfying range of rotation speeds.

Alternately, decide that the shape to rotate is the letter O. :-)

Stephen

--
Stephen Trier
Technical Development Lab
Cleveland FES Center
sct@sct@...



Hi

I have a demo application which reads the ADC value and displays this
level as a bar graph on an LCD. In addition it sends me Emails to
inform me when the voltage reaches either the minimum or the maximum
value.

This is for a MC9S12HC64 and works with operating system support and
is proabably not directly suitable for you (apart from the ADC
routines perhaps).

I have a general tip if you want to be able to develop more simply LCD
applications. At http://www.mjbc.ch/eng/VIP/VIP_Panel_3.htm you can
down load a free LCD simulator and test all commands before committing
any thing to code. You can also connect it to an on-line LCD (set
communication to IP 212.254.22.36 Port 1923 and see it via web cam at
http://212.254.22.36:8080.)

With the inbuilt LCD control panel (view | LCD control panel) you can
create your own symbols and see the character set being updated in the
font viewer. Connected on line you can see the real LCD reacting and
you know that the code is at least correct.

I have generated some test fonts for you - see the web cam. Try it
yourself and you may see that it could help you.

Regards

Mark Butcher
www.mjbc.ch --- In 68HC12@68HC..., "billyboy_2345" <billyboy_2345@y...>
wrote:
> Hey everyone
> Im trying to program a HC12 using ImageCraft C to display a rotating
> graphical symbol or shape on the top line of the LCD (2 * 8), with
the
> rotation speed being set by the Front Panel (ADC) potentiometer.
> Im having some trouble getting into it.
> Would anyone have any code examples that would point me in the right
> direction?
> It would be a great help.
> Thanks heaps.



The 2024 Embedded Online Conference