Jump to content

Display Blink


LiFo
 Share

Recommended Posts

is there any command you can sent to the display to get it to blink

or is it only the cursur that is blinkin

or have i to programm it my self to blink ?

if i have to make it blink my selv

i was thinking about using a timer somhow

i have only looked breafly at the function page and as i understand there are only 1 timer i can use

was also thinking to use another timer to make one dout blink a diode indicating the tempo

to get me started, some c examples using a timer would be realy great

Link to comment
Share on other sites

Hi!

The backlight is connected to the supply voltage via a resistor and a transistor and not to an I/O of the pic.

Therefore the backlight (I am speaking about the led backlight here) can't be turned on or of.

But I am sure you can get the letters to blink.

Another way would be to to connect the backlight to an output of the DOUT Module.

But I think this can only be done with the help of another transistor since the DOUT is not able to drive the backlight.

Regards

M.

Link to comment
Share on other sites

I think we need a Datasheet repository on the Wiki... There are some on the portal (it might need updating, when I clean out my C:\Temp directory I'll upload them if I can) we could just link to those... Or maybe move those files to the Wiki? I don't know... I'll leave that to you webmaster types :) Anyway, I've now added various LCD PDFs to my temp directory for uploading later on, including the official Hitachi 44780 Datasheet.

I must admit that, in the defense of the newbies, the information could be getting a little too spread out... There's ucapps.de, the forum, the wiki, the portal... Would it be worthwhile to attempt to bring some of that info together? Newbies, please let us know what you think... Maybe I am trying to make it too easy?

Link to comment
Share on other sites

Mobius thanks for the verry positiv informativ anwser

i was more looking for an anwser in the line of this

>is there any command you can sent to the display to get it to blink

>or is it only the cursur that is blinkin

no there is no command to get the display to blink only the cursor

>or have i to programm it my self to blink ?

yes you have to

but there is a command you can send to the display to hide (turn off) the text

and another to show(turn on) the text again

look at example furder down

>if i have to make it blink my selv

>i was thinking about using a timer somhow

sounds like a good idea

>i have only looked breafly at the function page and as i understand there are only 1 timer i can use

>was also thinking to use another timer to make one dout blink a diode indicating the tempo

>to get me started, some c examples using a timer would be realy great

make 2 variables

char blink;

char blinkNr;

in init methode

void Init(void) __wparam

{

blinkNr = 0;

blink = 0;

//initialize timer to  fire each 50 ms

MIOS_TIMER_Init(0x03,62500);

}

in the Timer function make this

void Timer(void) __wparam

{

if(blinkNr == 10)

{

blinkNr = 0;

TogleBlink();

}else

{

blinkNr++;

}

}

void TogleBlink()

{

if(blink == 0)

{

// sends a display on command

MIOS_LCD_Cmd(8+4);

blink =1;

}else

{

// sends a display off command

MIOS_LCD_Cmd(8);

blink = 0;

}

}

this maby a stupid way of doing it

but i dont know any better

and nowbody seams to be villing to help a newbie

so this  is how i am going to do it

and if another newbie like me wants to do the same think here is a simple solution

Link to comment
Share on other sites

Mobius thanks for the verry positiv informativ anwser

Thank You - I'm always happy to not please.

Let me ask You one question: Even with a detailed reply, Do You think you would accomplished this WITHOUT reading the datasheet and looking at the HD44780 command set?

Good work - what, did it take a day without proper help from here ;)

Moebius the Sunshine

Link to comment
Share on other sites

Clearly, I AM trying to make it too easy! Ignore my previous thoughts on centralisation please.

Mobius thanks for the verry positiv informativ anwser

Hey man, lets face it, he was being sarcastic, but he was right. You gave NO indication that you'd read it, so reading it was the next step.

i was more looking for an anwser in the line of this

That's bloody great!! If you'd posted that first, wow, I would have jumped to help you out! That really shows what some more investigation can do. Just the MIOS C function reference, the 44780 datasheet, and some C, and you have your answer

So well done

But dude, what is this little temper tantrum all about?

this maby a stupid way of doing it

but i dont know any better

and nowbody seams to be villing to help a newbie

so this is how i am going to do it

and if another newbie like me wants to do the same think here is a simple solution

Really, it's not like that, and I think you know that. We're both more than happy to tell you what you need, and we did. Once again, you have posted your thoughts and asking for confirmation that you've got it right and we are telling you yes. Why are you making out like you didn't get any help? Wasn't the datasheet enough? I went and opened and read it just then to check it out and make sure you had the right code, and there it is, page 25. Then it dawned on me... I will answer your questions with references to the datasheet, just to show you that when Mobius said to read the datasheet, he DID give you the answers you typed out... here they are:

Google tells me:

http://www.trash.net/~luethi/microchip/datasheets/lcd/hd44780.pdf

is there any command you can sent to the display to get it to blink

or is it only the cursur that is blinkin

Page 2

Wide range of instruction functions:

¾ Display clear, cursor home, display on/off, cursor on/off, display character blink, cursor shift,

display shift

You don't want the first one, cause you want the letters to come back

You don't want the 2nd one

The third one you could use by turning it on and off

The fourth is only the cursor

The fifth is only the character

The others are shifts, you don't want those

So obviously you want display on\off... hit search, type it in, clickety-click and page 25 comes up:

Display

on/off

control

0 0 0 0 0 0 1 D C B

Sets entire display (D) on/off,

cursor on/off ©, and

blinking of cursor position character (B).

37 ?s

So we ignore B and C, on and off are:

0 0 0 0 0 0 1 0 0 0   = 8

0 0 0 0 0 0 1 1 0 0   = 12

or have i to programm it my self to blink ?

See above.

to get me started, some c examples using a timer would be realy great

http://www.ucapps.de/cmios_fun.html#MIOS_TIMER_Init

http://www.ucapps.de/cmios_fun.html#USER_Timer

Those links contain all the syntax for the commands. Obviously some creativity is required as to how you use them, but clearly you require no assistance there! If you'd have done everything else above, and had a go at the code based on those references, I'm sure moebius would have helped if it needed fixing.

So why did I go to all this effort? Because I'm tired of people getting out the violins and having a sook when they don't get hand-held. Man, I didn't know this stuff off the top of my head, I had to go check them datasheets. Let me tell you, I've done very very little with LCD's in MIOS as yet, I haven't had the need to. It wasn't quick, I've been sitting here copying links for an hour or so - but the answers are RIGHT THERE.

Now this part, I planned on answering when you came back after reading up a bit. Now I will, because you clearly have!

if i have to make it blink my selv

i was thinking about using a timer somhow

i have only looked breafly at the function page and as i understand there are only 1 timer i can use

was also thinking to use another timer to make one dout blink a diode indicating the tempo

No problem :) The tempo will either be internally generated using or externally generated F8 bytes, interpolated by TK's algorithm (You'd be mad to write your own, it's great!) either way, it will be 96ppqn (pulses per quarter note).

So you setup a pair of countdowns which will control the two flashes. Each time a F8 byte is received while you are playing, you decrement the counters by one. When they reach 0, you loop them back to their default.

The tempo counter can blink every 1/4 note, so that counter default is 96. Leave the LED off, and when you hit play, turn it on, and start the countdown. When it reaches 84 you turn the LED off, so it pulses for a 1/32nd note for each quarter (or turn it off at 90 for a 64th note etc). When it reaches 0, you turn it on and reset the counter to 96...

The screen will blink faster than that (crikey your timer is set to 50ms my gosh that's a fast blink, I would go slower than that. I think that's more like vibration ;) ) let's make it black out every 4th 16th note... That counter's default would be 24. You leave the screen on, and when you go into bllink mode you start the countdown. When it gets to 6, you turn the LCD off, when it gets to 0, you turn the LCD on and reset the counter to 24.

These are just examples, have a play :)

If you don't want to ues MIDI Clock command like above, you could just set a timer to 96ppqn@120BPM or something... Use your imagination, you very clearly have the skills required to do this customisation!

Hope that helps.

PS, you don't have to do fancy timed blinks like above, you can just set a timer that turns it off, counts down, turns it on, counts down, turns it off.....etc etc Faster, but not as pretty.

Link to comment
Share on other sites

dont take this the wrong way

i am happy with all the help i have got an can get

i am lazy and have always been

and this is a project i am doing for a frend 

so i am not so entusiastic and driven as many of you

therfor am i seeking the shortcuts

mobius to your question

Let me ask You one question: Even with a detailed reply, Do You think you would accomplished this WITHOUT reading the datasheet and looking at the HD44780 command set?

yes it would be sufficient to inform me that i have to do it my self

and that i could turn off the text with 0x08

and turn it on with 0x0c

stryd_one

(crikey your timer is set to 50ms my gosh that's a fast blink, I would go slower than that. I think that's more like vibration Wink )

yes the timer is set for 50 ms but if you look at the ToggleBlink function you vil see that here is a counter

so the real blink frequancy is ½ sec.

sorry for my wage misleding question about the tempo

you gave a long detailed explanation about something else than the thing i wanted (i think ? or i hope so else it sounds way to complicated)

i don't even know my self what i want

i am making a floorboard for my friend

and i only implement what he tells me  and the hole proccess is extremly ad hoc

and among other things he wants a tap/tempo or something button on it

to transmit some cc ommand (i think, have not researched)

and if it is only a command to send out

then the idea was to track internaly the tempo he is tapping the pedal  and show the tempo on a diode

but hey not problen i have figured the timer out so there is no problem there

ps. Spelling errors don't exist in my univers only coding errors

Link to comment
Share on other sites

dont take this the wrong way

i am happy with all the help i have got an can get

i am lazy and have always been

and this is a project i am doing for a frend 

so i am not so entusiastic and driven as many of you

therfor am i seeking the shortcuts

Geez at least you're honest about it :) But you won't find many shortcuts around here, sorry mate. You might have gotten yourself in for more than you bargained for.... This stuff is going to be fairly indepth, and that's pretty much unavoidable.

yes it would be sufficient to inform me that i have to do it my self

and that i could turn off the text with 0x08

and turn it on with 0x0c

This is my point -  we don't go around memorising IC datasheets for fun, and we aren't amazing magical super-gurus who can recite hex codes for programming various devices off the tops of our heads.(Well I'm not, maybe TK hs the PIC18F datasheet committed to memory ;) heehhe) I had to read the datasheet just to see if you were right or not. See what I'm saying? To find out that is 8 and 12, one has to read the datasheet..... and I don't think that anyone here is going to help you so much as to go and read datasheets for you when you're perfectly capable of doing so yourself. To me it is like asking someone to read your homework for you. You were honest enough to admit that you're lazy, and I respect that a lot, so I will be honest enough to tell you that you're a bit too lazy if you expect such things of us ;) We're here to help, but not to be your eyes and ears, seeing eye dog or bedtime story readers ;) hehehehe

yes the timer is set for 50 ms but if you look at the ToggleBlink function you vil see that here is a counter

so the real blink frequancy is ½ sec.

Right you are. Sorry I missed that, I had been out all night, I even had a drink (yuck! I hate alcohol) it was 5 am, and I'd already spent an hour showing you that other stuff, I guess I overlooked it. I'm sure you understand :) My brain will come back soon heheheh

sorry for my wage misleding question about the tempo

you gave a long detailed explanation about something else than the thing i wanted (i think ? or i hope so else it sounds way to complicated)

i don't even know my self what i want

i am making a floorboard for my friend

and i only implement what he tells me  and the hole proccess is extremly ad hoc

and among other things he wants a tap/tempo or something button on it

to transmit some cc ommand (i think, have not researched)

and if it is only a command to send out

then the idea was to track internaly the tempo he is tapping the pedal  and show the tempo on a diode

but hey not problen i have figured the timer out so there is no problem there

ps. Spelling errors don't exist in my univers only coding errors

If I were you I'd get my friend to sort it out. Making it up as you go along will make this even more confusing. Tell him to figure out what he wants, then give you the specs. Better yet, why can't he do it himself? If you're so unenthusiastic, and he is obviously too unenthusiastic, there's not a lot of enthusiasm going on there, and not much to drive the project. The project won't be incredibly hard, but it won't be a walk in the park either. With so little enthusiasm driving you both, you don't stand much of a chance :(

What you're talking about is MIDI Clock and the thing I said that "sounds way too complicated" is just one little part of that... You'll need to write a tap-tempo function to set the clock period according to the speed of the taps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...