I am trying my first code on my new EasydsPIC4 which I also got the LCD with.
I am trying the sample code to see the LCD working, but when compiling and flashing into the processor - not too much happens at all. The screen lights up but I don't have the text as I'd expect.
The code I am using is below. What haven't I done yet?? I have made no changes to the SW settings.
Fritzables
' * Project name:
' Lcd4bitTest
' * Copyright:
' (c) MikroElektronika, 2006.
' * Revision History:
' 20060515:
' - Initial release
' * Description:
' The program is a simple demonstration of the LCD library routines.
' It writes the word mikroElektronika across two rows.
' * Test configuration:
' MCU: dsPIC30F4013
' Dev.Board: EasydsPIC4
' Oscillator: XT-PLL8, 10.000MHz
' Ext. Modules: LCD 2x16
' SW: mikroBasic for dsPIC30/33 and PIC24 v4.0.0.0
' * NOTES:
' - None.
program LCD4bitTest
dim txt as string[15]
main:
ADPCFG = $FFFF
Lcd_Init_EasydsPIC4()
Lcd_Cmd(LCD_CURSOR_OFF)
Lcd_Cmd(LCD_FIRST_ROW)
LCD_Chr_Cp("m") ' m
LCD_Chr_Cp(105) ' i
LCD_Chr_Cp(107) ' k
LCD_Chr_Cp("r") ' r
LCD_Chr_Cp(111) ' o
Lcd_Cmd(LCD_SECOND_ROW)
Lcd_Out(2, 6, "Elektronika")
Delay_ms(1000)
txt = "Elektronika"
Lcd_Out(1, 6, txt)
end.
Getting The LCD To Work??
-
- Posts: 61
- Joined: 07 Jun 2008 13:20
- Location: Brisbane AUSTRALIA
-
- Posts: 61
- Joined: 07 Jun 2008 13:20
- Location: Brisbane AUSTRALIA
G'Day BT,
Yea, did all that - I also thought it was a contrast issue but no adjustment made the type appear.
Taking a look at the User's Guide - it shows a graphic of the LCD in place but one thing I had noticed is that on SW2 that ALL switches were in the OFF state except for #7.
There is no mention of it in the text though.....
Yea, did all that - I also thought it was a contrast issue but no adjustment made the type appear.
Taking a look at the User's Guide - it shows a graphic of the LCD in place but one thing I had noticed is that on SW2 that ALL switches were in the OFF state except for #7.
There is no mention of it in the text though.....
Hello down under...
I avoid using mE defaults that are specific to their boards - it makes it easier to transfer code to a real project. Thus, in the code, below, I don't use the easypic init.
I threw this code together for your testing - works on my easydspic4. I counts and displays numbers...
BT
I avoid using mE defaults that are specific to their boards - it makes it easier to transfer code to a real project. Thus, in the code, below, I don't use the easypic init.
I threw this code together for your testing - works on my easydspic4. I counts and displays numbers...
BT
Code: Select all
program Junk_Testing
dim i as integer
dim iout as char[15]
''===================================================================
MAIN:
ADPCFG = $FFFF ' Turns off Analog on ports
LCD_init(portB,3,2,1,0,PortD,0,2,1) ' LCD initialization Must put it here
Lcd_cmd(Lcd_cursor_off)
Adcon2 = $0000 ' $0000 turn off analog, set to digital
Adcon3 = $0000 ' $0000 turn off analog, set to digital
Adcon1 = $0000 ' $0000 turn off analog, set to digital
OC1CON = $0000 ' Turn off capture and compare
OC2CON = $0000 ' Turn off capture and compare
PWMCON1 = $0000 ' Turn off PWM
PWMCON2 = $0000 ' Turn off PWM
LatB = $0030 ' setting LCD to 0's and buttons to 1's
TrisB = $0030 ' 0,1,2,3=LCD out, 4,5 = input
i = 0
'===================================================================
Do
IntToStr (i, iout)
Lcd_out(1,1,iout)
delay_ms(500)
i = i + 1
Loop Until i>=21
end.
-
- Posts: 61
- Joined: 07 Jun 2008 13:20
- Location: Brisbane AUSTRALIA
-
- Posts: 61
- Joined: 07 Jun 2008 13:20
- Location: Brisbane AUSTRALIA