![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I'm having problems with my LCD (both in real life and simulator) on a PIC18F system not showing anything, after ensuring that the hardware is connected properly. I'm beginning to suspect that either my sequence of operations on the LCD during the initialization before writing anything isn't done properly, or the timing of the command functions that I have called (those functions are built-in with mikroC development suite) aren't proper for my LCD (even though their library functions are said to be for HD44780 compatible LCDs). It would fantastic if someone replies on the basic sequence of operations that I should be instructing the LCD in order for it to work. I have basically initialized in the program where the data port, RS, Enable, and R/W pins are connected, turn on the LCD module, clear the display, turn the cursor display/blinking off, and return the cursor to top left corner. Thanks! | |
| |
| | (permalink) |
| The mikroC libararies work fine... I've tested them. Check your connections, your contrast, and make sure you have Digital IO for the PIC pins feeding the LCD. If you want to look at some mikroC LCD source code, I wrote a program that writes the modules and functions based on your pin assignments. It helps optimize the code and speeds up the processes: http://www.mikroe.com/en/projects/download/lcd4.zip Last edited by wschroeder; 7th December 2007 at 08:01 AM. | |
| |
| | (permalink) |
| I have my ADCON1 register to be 0x0e or I believe to be using AN0 only. Also, TRISx = 0x01 would make all the bits 1-7 output and bit 0 input. | |
| |
| | (permalink) |
| I have posted a thread on http://www.mikroe.com/forum/viewtopic.php?t=12630 . It has the link to the project folder that I'm having trouble with if you're interested in seeing more details. Does mikroC functions on the LCD incorporate the delays, or do I have to incorporate them myself? | |
| |
| | (permalink) |
| Deleted by my me as the OP has given his version of c code at the site mentioned.
__________________ Regards, Sarma. Last edited by mvs sarma; 7th December 2007 at 08:45 AM. | |
| |
| | (permalink) |
| What's deleted by my me? | |
| |
| | (permalink) | |
| Quote:
you have provided details, and i was able to see them-as such no issues onwhat you posted, Please
__________________ Regards, Sarma. | ||
| |
| | (permalink) |
| I have one more question, more of a conceptual one: what is the advantage of operating the LCD in 4-bit mode rather than 8-bit mode besides reduction of the amount of pins used on the microcontroller? | |
| |
| | (permalink) | |
| Quote:
Mike. | ||
| |
| | (permalink) |
| I'm using a 28-pin PIC. I also have 40 pin PICs available. How much slower code execution would 4-pin mode compared to 8-bit mode? | |
| |
| | (permalink) | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | (permalink) | |
| Quote:
Code: movfw Data movwf PortB Code: movfw Data movwf PortB bsf PORTB,LCD_E bcf PORTB,LCD_E swapf Data,W movwf PortB bsf PORTB,LCD_E bcf PORTB,LCD_E Mike. | ||
| |
| | (permalink) |
| If I have want to data log something, should I use one microcontroller for the LCD and one for datalogging using a separate microcontroller? | |
| |
| | (permalink) |
| It depends on the speed of logging. If it's less than a few 100 bytes per second then the pic would be able to do both. What are you logging? Keep in mind that if you are writing to EEPROM then it takes around 6mS per byte. Mike. | |
| |
| | (permalink) |
| ssylee, You never said whether you got the LCD working with mikroC. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| LCD 2x16 Demo for the Unicorn (18F4550) | blueroomelectronics | Micro Controllers | 21 | 31st October 2008 05:17 PM |
| HD44780 lcd help | jay543_uk | Micro Controllers | 12 | 8th November 2007 04:26 PM |
| Question about Inchworm+ | Quan | Micro Controllers | 54 | 28th October 2007 01:21 AM |
| LCD Troubles | Kyle-s4h | Micro Controllers | 13 | 11th September 2007 01:30 PM |
| PLL WITH PIC AND TSA5511 | savnik | Micro Controllers | 21 | 29th May 2006 03:39 PM |