Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Print ascii code on lcd

Status
Not open for further replies.
hi...

how can i show ascii code character on lcd using oshonsoft

language: picbasic

hi,
If you post a circuit showing the LCD type, PIC type with the interconnections, I will post you some sample code.;)
 
i not make circuit schematic... :D but i create the pcb layout... using pcb wizard and just place the component manually:D

View attachment 66615


this is lcd configuration (16x2 lcd type)

Code:
Define LCD_BITS = 4
Define LCD_DREG = PORTB
Define LCD_DBIT = 0
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 6
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 5
Define LCD_EREG = PORTB
Define LCD_EBIT = 4
Define LCD_READ_BUSY_FLAG = 1
 
Last edited:
OK, I see the PIC, is it a 16F or 18F type.??
 
hi,
Redraw the pcb showing the correct wiring and post it, I will recheck it.

EDIT
Dont forget the +5V and 0V pins for the PIC..
 
Last edited:
Try this in Oshonsoft.

Code:
'16F877A LCD Demo  23Aug2012

AllDigital
Define SIMULATION_WAITMS_VALUE = 1

Dim cntr1 As Byte

Define LCD_LINES = 2
Define LCD_CHARS = 16
Define LCD_BITS = 4
Define LCD_DREG = PORTB
Define LCD_DBIT = 0
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 6
Define LCD_EREG = PORTB
Define LCD_EBIT = 4
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 5

TRISA = %00000000
TRISB = %00001111
TRISC = %00000000
TRISD = %11110000
TRISE = %00000000

Lcdinit
Lcdout "Ready"

main:

Lcdcmdout LcdLine2Home

Lcdout #cntr1
cntr1 = cntr1 + 1

Goto main

End
 
The LCD looks OK, did you try that simple Basic program I posted.??

In your lastest pcb image, you show 1uF caps on your crystal... they should be approx 22pF

Also why have you used a 1uF symbol for the crystal.??
 
Last edited:
View attachment 66619

i want to show the last character (1111 1111) on lcd.... :D

Hi,
Can we please follow a step by step path on this problem.

Does the Demo program I posted work on your PC when using Oshonsoft.??

Lcdinit
Lcdout "Ready", 0xff ; Use the LCD symbol value for any or special characters... 0xff = the last symbol/char

main:
 
Last edited:
oh my.....

lcdout 0xff <------ its working now

before this i have been try that code but it not working.... arghhhhh

i dont know why :rolleyes:

but tq eric... hehehe

i`m going for the next step... my code is nearly finished....

trying to use internal timer?????????? <--- need to open new thred?
 
hi,
Thats good.

Dont open a new thread, use this one.;)
 
Code:
'16F877A LCD Demo  23Aug2012

AllDigital
Define SIMULATION_WAITMS_VALUE = 1

Dim cntr1 As Byte

Define LCD_LINES = 2
Define LCD_CHARS = 16
Define LCD_BITS = 4
Define LCD_DREG = PORTB
Define LCD_DBIT = 0
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 6
Define LCD_EREG = PORTB
Define LCD_EBIT = 4
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 5

TRISA = %00000000
TRISB = %00001111
TRISC = %00000000
TRISD = %11110000
TRISE = %00000000

Lcdinit
Lcdout "Ready"
Lcdout 0xff

main:


Lcdcmdout LcdLine2Home

Lcdout #cntr1
cntr1 = cntr1 + 1

'here code for timer
'if counter is reach 20, the timer1 will start but counter is still counting
'when timer is reach 5 second it will stop counting and reset count value to 0

Goto main

End


i hope u can understand.... can i do like that??
 
Last edited:
'here code for timer
'if counter is reach 20, the timer1 will start but counter is still counting
'when timer is reach 5 second it will stop counting and reset count value to 0

Using a 4MHz crystal will give an internal clock of 1MHz ie: 1microsec

So what do you plan to do with a 5 * 1uSec Timer1 period.?

If you explain the purpose of your program/project it would be easier for me to help
 
i think we will discuss this one later.... i will try run some timer code and understand how it working....
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top