![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
am confused about which LCD display to purchase. only need 2 lines connecting to 18F452 need to purchase using the LCD code from PIC Microcontroller Tutorials, Projects and Examples backlighting, different drivers etc. found a nice display at goldmine but needs 100v for backlighting. Hantronix HDM64GS24Y 240 x 64 Graphics LCD Display Module-The Electronic Goldmine am totally lost on this subject just a basic display to tinker with. | |
| |
| | #2 |
|
The LCD in your link is a Graphics LCD. Do you need a graphics or character LCD?
| |
| |
| | #3 |
|
Hi, The 'standard' lcd is a 16 x 2 character parallel lcd with a HD44780 compatible controller that uses standard logic voltages, typically +5v, they are cheap and common place. Would suggest you start with one of these simpler displays before attemping the larger Graphic modules. From your recent posts I'm not sure what complier you are using etc, but if you are using assembler then why not use ETs own tutorial guru where he gives full hardware and software details Nigel's PIC Tutorial Page | |
| |
| | #4 |
|
do not need graphics going to display the muzzle velocity of air cannon then blank for few seconds then display muzzle energy or projectile energy. helping a good friend build an air cannon for a High School competition next year. need to hit targets at 30, 60, and 90 yards points awarded for accuracy, innovation, distance after the target competition. with a PIC/LCD to determine velocity etc then its just a matter of doing some testing to determine where the projectile (baseballs) will land. a wind speed input would add to the data. that's in the planning stages after I get the basic unit working. just need a numeric LCD display. nothing fancy | |
| |
| | #5 |
|
written in swordfish lots of notes to remember what I need to add or subtract Code: Device = 18F452
Clock = 40
Config OSC = HSPLL // NEED TO REVISE
Include "USART.bas"
Include "convert.bas"
Dim
TMR1IE As PIE1.0, // TMR1 Interrupt Enable
TMR1IF As PIR1.0, // TMR1 Interrupt Flag
TMR1ON As T1CON.0, // TMR1 Count Enable
Timer1 As TMR1L.AsWord, // A quick way of creating a Word Alias
Signal1 As PORTC.0, // Define the signal pin
Signal2 As PORTC.1, // Define the second signal pin
//add second signal pin
Overflow As Byte, // Capture overflowsA
Time As LongWord // A variable for calculating total time
Const
TMR1StartVal = 8, // User defined TMR1 starting value
TMR1ReloadVal = 11, // The TMR1 reload value
nSperIncrement = 100 // Number of nS per TMR1 increment
Sub TMR1_Initialize()
TMR1ON = 0 // Disable TMR1
TMR1IE = 0 // Disable TMR1 Interrupts
TMR1IF = 0 // Clear the TMR1 Interrupt Flag
T1CON.1 = 0 // 1 = External clock from pin RC0/T1OSO/T1CKI (on the rising edge)
// 0 = Internal clock (FOSC/4)
'TRISC.0 = 1 // If External clock, then set clock as an input
'T1CON.2 = 1 // 1 = Do not synchronize external clock input
// 0 = Synchronize external clock input
// When T1CON.1 = 0;
// this bit is ignored.
T1CON.4 = 0 // 11 = 1:8 prescale value
T1CON.5 = 0 // 10 = 1:4 prescale value
// 01 = 1:2 prescale value...
// 00 = 1:1 prescale value
Timer1 = TMR1StartVal // Fill the Timer register with a starting value
End Sub
// Start Of Main Program...
SetBaudrate(br38400)
Overflow = 0 // Clear overflows
TMR1_Initialize // Setup TMR1
Input(Signal1) // Make Signal1 an input
Input(Signal2) // Make Signal2 an input
//input signal2---second sensor
While True
While Signal1 = 0 // Wait for a fresh cycle
Wend //
While Signal1 = 1 // CHECKS FOR SIGNAL 1
Wend //
TMR1ON = 1 // Begin clocking time
Repeat
If TMR1IF = 1 Then // Check for TMR1 overflow
TMR1ON = 0 // Disable TMR1
TMR1IF = 0 // Clear the TMR1 Interrupt
Timer1 = TMR1ReloadVal // Reload a new start value (includes non-counted cycles while disabled)
TMR1ON = 1 // Enable TMR1
Inc(Overflow) // Increment the overflow capture variable
EndIf
Until Signal2 = 1 // Repeat until the signal2 pin goes high
// change to until signal2 = 1
TMR1ON = 0 // Stop clocking time
// Calculate the total time in nS & display via USART
Time = (Timer1 + (Overflow * 65535)) * nSperIncrement
USART.Write(Convert.DecToStr(Time)," nS",13,10)
// Reset variables
Overflow = 0
Timer1 = TMR1StartVal
Wend
| |
| |
| | #6 |
|
If you want to have a serial LCD display try LCD - Modern Device Company
__________________ Mike2545 | |
| |
| | #7 |
|
will it work with code. how does one know what LCD display to buy be80be stated that serial may be easier? LCD Display 16 x 2 - Surplus Electronics in this tutorial what type of display I posted question but have yet to get ansewer | |
| |
| | #8 |
|
From my understanding there are 2 ways of driving a LCD, parallel and serial. Parallel takes what, 4 lines to control and maybe a bit more code. Serial takes one line to control and is more straightforward in the code department. I have only ever used a serial LCD, as my coding is done in Basic. For parallel, you can drive the display directly and serial needs a driver, I have posted the link to the drivers I use above.
__________________ Mike2545 Last edited by Mike2545; 24th October 2009 at 11:16 PM. | |
| |
| | #9 | |
| Quote:
Here is code from a swordfish project that uses a parallel interface: Swordfish Tutorial - ADC (Output to LCD) | ||
| |
| | #10 |
|
Serial LCDs are in general more expensive. If you have the pins to spare, there is no good reason not to use a parallel interface. The 4-bit mode only requires 6 or 7 pins.
| |
| |
| | #11 |
|
I have never used a serial LCD, only parallel. It seems with serial LCD's, you simply send ASCII data serially and it get displayed. That seems to make them limited in functionality, if you can't initialise them and use the full command set. But as I say, I've never used one,
| |
| |
| | #12 | |
| Quote:
__________________ Mike2545 | ||
| |
| | #13 |
|
different driver types? ks0066 hitachi??? spl???? I understand the hitachi driver is perfered or the standard?? | |
| |
| | #14 |
|
The Hitachi (or clones) are quiet popular, easy to find and cheap. The one you linked from that surplus site would be perfect, you can find MANY code examples of how to interface to it, if you're lucky you may even find a C library that you can just plug and play to use. They have a handfull of programmable characters so you can do simple graphics like bar graphs small logo's are mini animations if you update it fast enough.
__________________ "Because I be what I be. I would tell you what you want to know if I could, mum, but I be a cat, and no cat anywhere ever gave anyone a straight answer, har har." | |
| |
|
| Tags |
| display, lcd, selecting |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Substituting a 16x2 LCD display for 16x1 LCD display? | Dawny | Electronic Projects Design/Ideas/Reviews | 19 | 11th October 2008 09:58 AM |
| Lcd Display Help | adnan012 | Micro Controllers | 11 | 2nd November 2007 04:06 PM |
| Is this display burned out? (Sony MD LCD Display) | Amphr_Moth | General Electronics Chat | 4 | 28th October 2007 07:47 PM |
| lcd display with hd44780 display driver | ANUPAMA | Micro Controllers | 2 | 7th April 2004 02:58 PM |
| LCD Display | krishtriram | General Electronics Chat | 2 | 22nd October 2003 07:31 AM |