Jump to content

Search the Community

Showing results for tags 'LCD'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • PIC Embedded Programming
    • BoostC and Chameleon compilers programming
    • BoostC porting source code
    • BoostC++ compiler programming
    • BoostBasic compiler programming
    • Assembler programming PIC
    • Novo RTOS Programming
    • Hardware PIC
    • Enhancement Requests
    • Bug Reports

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 3 results

  1. Hello kind Sourcebost developers last two days I'm getting mad about my LCD driver that I written, cause I can't really make it work and don't know where the problem can be (tried on real device and also in the paid plugin of yours). These are the main functions, the delays are just as in the example for the LCD plugin (asm nop's): void sendDataToLCD_delay (char data, char rs) { RS = rs; LCD_SetupDelay(); LCD = data >> 4; // sending left nibble E = 1; // perhaps a little delay will be needed before and after LCD_EnablePulseDelay(); E = 0; // pulse Enable H/L to send the data LCD_HoldupDelay(); LCD_CycleMakeupDelay(); RS = rs; LCD_SetupDelay(); LCD = data & 0x0F; // sending right nibble E = 1; // perhaps a little delay will be needed before and after LCD_EnablePulseDelay(); E = 0; // pulse Enable H/L to send the data LCD_HoldupDelay(); LCD_CycleMakeupDelay(); } // Clears the LCD display void clearLCD (void) { sendDataToLCD_delay(clear_lcd, 0); delay_ms(2); } // initializes the LCD display void initLCD (void) { char a; //delay_ms(20); // delay_ms(20) before delay_ms(16); // delay_ms(20) before sendDataToLCD_delay(system_set_reset_4bit, 0); delay_ms(5); sendDataToLCD_delay(system_set_reset_4bit, 0); delay_10us(100); // min delay here of 100us sendDataToLCD_delay(system_set_reset_4bit, 0); delay_10us( 5 ); // standard command delay time sendDataToLCD_delay(system_set_4_bit, 0); delay_10us( 5 ); // standard command delay time sendDataToLCD_delay(entry_mode, 0); sendDataToLCD_delay(display_on, 0); //sendDataToLCD_delay(set_dd_ram, 0); } // Sends a string to certain position of the display void sendStringToLCD (char *s, char pos) { int ptr = 0; sendDataToLCD_delay(set_dd_ram+pos, 0); while (s[ptr] != 0) sendDataToLCD_delay(s[ptr++], 1); } The configuration is for PORTB - PORTB.RB5=E, PORTB.RB4=RS, PORTB.RB0-RB3 - DATA (D4-D7), RW=GND, I think the problem lies in the config, but I can't see it clearly. Could you give me a slight hint, am I missing some operation or do I send the data in a wrong way? Thanks for your help! Midin
  2. Hello, I'm quit new to programming with C, I've done some basic stuff at school couple of years ago but it never was my thing. Well after a few years it's still whispering in my ears that i should learn how to program. For school I;ve bought the Sourceboost Boostc Pro 6.xx license. And still own this license. Found out that a lot has changed since the version I had (6.40) so updated to 6.97 latest version of 6.xx At the moment i;m just playing around to learn how to program. Only walking in to two problems at this moment. I'm using the lcd driver from lika.be http://lika.be/wp/2005/08/boostc-compiler-libraries/ Well I can send commands to the LCD. that all worked fine. But what I can't figure out is how to move the cursor to a specific place at the display. gotoxy doesnt seem to work. The next problem I walked in to was that i could not place the interrupt tmr0 result at the display. Well I;ve found a way to convert it so it shows the value at the lcd now. But it's using way to much rom of my PIC16F627A about 35% just for the conversion. Are there any replacement commands for the sprintf conversion to show the value on the display? This is the code I;ve made so far: #pragma DATA 0x2007, 0x2118 #pragma CLOCK_FREQ 4000000 #include <system.h> #include <stdlib.h> #include <stdio.h> #include "lcd_test.h" #include "lcd.h" unsigned int rx_out; void init(void) // Configureren van de settings { //Config //76543210 trisa = 00100000b; // Stel de in / uitgangen op port A in. trisb = 00000001b; // Stel de in / uitgangen op port B in. porta = 00000000b; // Alle pennen poort a zijn laag portb = 00000000b; // Alle pennen poort b zijn laag //rx_out = 0; //Configuratie Timer0 option_reg.T0CS = 0; // 0 = Gebruik systeemklok, 1 = Gebruik klok op pin T0CKI option_reg.T0SE = 0; // bit 4 TMR0 Source Edge Select bit 0 = low/high 1 = high/low option_reg.PSA = 0; // 0 = Prescaler voor Timer0, 1 = Prescaler voor WatchDogTimer WDT option_reg.PS2 = 0; // PS0 - PS2 Prescaler waarde zie datasheet option_reg.PS1 = 1; option_reg.PS0 = 0; option_reg.INTEDG = 1; // Interrupt als portb.0 ? wordt. set_bit(intcon,GIE); // Interrupts activeren. set_bit(intcon,INTE); // Interrupt PortB.0 is actief = 1, Uitgeschakeld = 0. // LCD interface lcd_init(); // LCD initialiseren lcd.c / lcd.h / lcd_test.h lcd_send_cmd(LINE1); // Stuur LCD naar regel 1 lcd_printf("Test 1"); // Plaats de volgende tekst op het lcd lcd_send_cmd(LINE2); // Stuur LCD naar regel 2 lcd_printf("Regel 2"); // Plaats de volgende tekst op het lcd delay_s(2); // Wacht 3 seconden (start op scherm) return; } void main() { init(); // Eerst alle settings goed zetten char buffer[5]; // Buffer aanmaken voor conversie naar LCD lcd_send_cmd(DISP_CLR); // Display leegmaken while(1) // Start van de programma Loop { sprintf(buffer, "%5d", rx_out); // Conversie int naar string lcd_send_cmd(LINE1); // Stuur LCD naar regel 1 lcd_printf(buffer); // Plaats de volgende tekst op het lcd delay_ms(10); // wacht 0,1 seconde voor refresh } } void interrupt( void ) // Interrupt routine { if(test_bit(intcon,INTF)) // Controleer algemene interrupt vlag { if(option_reg.INTEDG == 1) // Controleer status portb.0 interrupt { tmr0 = 0; // Reset tmr0. intcon.T0IE = 1; // option_reg.INTEDG = 0; // Zet portb.0 interrupt op laag intcon.INTF = 0; // Reset interrupt vlag return; } else { rx_out = tmr0; // Schrijf waarde tmr0 weg naar rx_out intcon.T0IE = 0; // option_reg.INTEDG = 1; // Zet portb.0 interrupt op hoog intcon.INTF = 0; // Reset interrupt vlag return; } } } I've tried the dutch forum www.circuitsonline.nl for help and also have tried a lot of things myself but i seem pretty stuck for now.
  3. I have a problem with the LCD setup. PIC is 18F2520 Here is the code: #define LCD_ARGS 1, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 0, /* Use busy signal: 1 = use busy, 0 = use time delays */ \ PORTC, TRISC, /* Data port and data port tris register */ \ PORTA, TRISA, /* Control port and control port tris register */ \ 6, /* Bit number of control port is connected to RS */ \ 4, /* Bit number of control port is connected to RW */ \ 7 /* Bit number of control port is connected to Enable */ #include <lcd_driver.h> // LCD template code This will not work but this does: #define LCD_ARGS 2, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 0, /* Use busy signal: 1 = use busy, 0 = use time delays */ \ PORTC, TRISC, /* Data port and data port tris register */ \ PORTA, TRISA, /* Control port and control port tris register */ \ 1, /* Bit number of control port is connected to RS */ \ 2, /* Bit number of control port is connected to RW */ \ 3 /* Bit number of control port is connected to Enable */ #include <lcd_driver.h> // LCD template code LCD works OK on High Nibble. Can anyone help me? LCD is wired: RC0 -> DB4 RC1 -> DB5 RC2 -> DB6 RC3 -> DB7 for low nibble. All I get is a flashing block cursor. Same working LCD is wired: RC4 -> DB4 RC5 -> DB5 RC6 -> DB6 RC7 -> DB7 for high nibble. Swapped LCD from another project using 16F883 chip. LCD works.. I usually use the high nibble but this project called for the LOW nibble. The PCBoard has already been made so it will be a hassle to change it to swap the pins to high. Surely the LOW Nibble option is OK but what's wrong? A bug in lcd_driver.h? Carlos
×
×
  • Create New...