Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

Author Topic: PIC Display  (Read 6471 times)

0 Members and 1 Guest are viewing this topic.

5and1half

  • Guest
PIC Display
« on: April 01, 2008, 09:19:12 AM »
Hello all.

I am new to your community and i would like to welcome you all first.

I am also new to PIC programming. I have make some project using a PIC and i want to go further. The peak for me would be an LCD project. For example something like a thermometer or anything that would use an LCD, preferable dot matrix, like the 16X2 that is cheap and i hope also easy.

Any help will be appreciated.
Thank you all.

spic0m

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 841
Re: PIC Display
« Reply #1 on: April 03, 2008, 07:26:10 AM »
Hi and welcome to PCBheaven forums!

I didn't get your point, you need help in what?
Find the LCD, program the pic or whatever, please be more specific on what you want.

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: PIC Display
« Reply #2 on: April 03, 2008, 08:06:37 AM »
I think he wants to make a project with a PIC and an LCD. A clock that will show the time for example. correct?

5and1half

  • Guest
Re: PIC Display
« Reply #3 on: April 06, 2008, 11:27:03 AM »
i really do not care what will i make. i just practice. for example, i want to transmit the next lines to the 16X2:

0123456789ABCDEF
Hello World!

spic0m

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 841
Re: PIC Display
« Reply #4 on: April 06, 2008, 16:54:13 PM »
What type of controller your LCD has?

Here's an example.

5and1half

  • Guest
Re: PIC Display
« Reply #5 on: April 11, 2008, 08:55:27 AM »
It is This LCD from futurlec

The controller is HD44780

Erkeli

  • Guest
Re: PIC Display
« Reply #6 on: April 12, 2008, 00:58:38 AM »
This is an old time classic display that can be found also under stones  ;)

Google a little bit! The net is filled with this

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: PIC Display
« Reply #7 on: April 13, 2008, 14:51:00 PM »
Code: [Select]
list       F=inhx8m, P=16F84A, R=hex, N=0
 __config   0x3FF9    ; fuses setup
 errorlevel -302      ; switches off Message [302]: Register in operand
                      ; not in bank 0.
#include <P16F84A.INC> ; PIC definitions


#define PinRS porta,0
#define PinRW porta,1
#define PinE porta,2

; ram preserved
WaitCounter     equ 0x0c
WaitCounter2    equ 0x0d

; Conastants --------------------------------------------------------------
GLTmrStartValue =       d'186'
GLMaxCnt2Value  =       b'11000011'
GLMinCnt1Value  =       b'00001111'

GLDividerH      =       b'11101000'
GLDividerL      =       b'11100000'

; Program Memory Beginning ------------------------------------------------
                org     0
                goto    Start
; Interrupt Service Routine -----------------------------------------------
                org     4               ; ISR beginning
               
; -------------------------------------------------------------------------
; -------------------------------------------------------------------------
; -------------------------------------------------------------------------
; Microcontroller initialization
Init            movlw   b'00000000'     ; PORTA setup
                movwf   porta
                movlw   b'00000000'     ; PORTB setup
                movwf   portb
                Bank1
                movlw   b'00001000'     ; TRISA setup
                movwf   trisa
                movlw   b'00000000'     ; TRISB setup
                movwf   trisb
                movlw   b'11011000'     ; OPTION_REG setup
                movwf   option_reg
                Bank0
                movlw   b'00000000'     ;
                movwf   intcon
                ;movlw   b'00000000'     ; PORTB setup
                ;movwf   portb
                return

; Main Program ------------------------------------------------------------
Start           call init

NotReady        btfss porta,3
                goto notready

                call wait250msec
                movlw b'00111000'
                movwf portb
                bcf pinrs
                bcf pinRW
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine
                call wait10msec

                movlw b'00001110'
                movwf portb
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'00000110'
                movwf portb
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'11111111' ;B
                movwf portb
                bsf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine


                movlw b'01110101' ;u
                movwf portb
                bsf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'01100111' ;g
                movwf portb
                bsf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'11000000' ;ddadr=2nd line
                movwf portb
                bcf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'11111111' ;-
                movwf portb
                bsf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'00101101' ;-
                movwf portb
                bsf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine

                movlw b'00101101' ;-
                movwf portb
                bsf pinrs
                call wait10msec
                bsf pine
                call wait10msec
                bcf pine


backme          nop
                goto backme


Wait10mSec      movlw d'10'
                goto StartCount
Wait250mSec     movlw d'250'
                goto StartCount

StartCount      movwf WaitCounter2

BackWaitLoop2   movlw d'249'
                call WaitWx4Cycles
                movlw d'249'
                call WaitWx4Cycles
                movlw d'249'
                call WaitWx4Cycles
                decf WaitCounter2,f
                btfss zero
                goto BackWaitLoop2
                return

WaitWx4Cycles   movwf WaitCounter
BackWaitLoop    decfsz WaitCounter,f
                goto BackWaitLoop
                return



Fins           
                end             ; end of program


manley_V

  • Guest
Re: PIC Display
« Reply #8 on: April 19, 2008, 12:39:24 PM »
Lol!

Bug! No there is no bug in the program!

Alex

  • Guest
Re: PIC Display
« Reply #9 on: April 25, 2008, 13:18:13 PM »
Lol!

Bug! No there is no bug in the program!

lol i did not get the meaning of your post until i run the program. Heh!