well, i should read carefully the first post... i'll agree with the Ralph's suggestion. But for a thousand board... could be interesting to make a DIP adapter that change the OLD PIC pin to the new PIC pin configuration.
Well just an idea.
well, i should read carefully the first post... i'll agree with the Ralph's suggestion. But for a thousand board... could be interesting to make a DIP adapter that change the OLD PIC pin to the new PIC pin configuration.
Well just an idea.
Last edited by mister_e; - 5th May 2005 at 04:25.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Below is the code I had developed to write data to LCD without using the LCDout command.
thought may be of help:
'************************************************* ***************
'* Name : LCD 8Bit.BAS *
'* Author : uuq1 *
'* Notice : Copyright (c) 2005 [set under view...options] *
'* : All Rights Reserved *
'* Date : 4/25/2005 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
'VARIABLES DECLARATION
CHARCNT VAR BYTE
CHAR1 VAR BYTE
TOTAL CON 20 ' A CONSTANT FOR NO OF CHARS ON ONE LINE OF LCD
'Pin Assignments
LCD_RS VAR PORTA.0
LCD_EN VAR PORTA.1
Start:
Pause 150
TRISA=2
TRISB=0
PORTA=0
PORTB=0
PORTB=%00110000 ' FUNCTION 8 BITS, LCD INITILIZATION REQUIRE THIS COMMAND TO BE SENT 3 TIMES.
GOSUB LCDINS
PORTB=%00110000 ' FUNCTION 8 BITS
GOSUB LCDINS
PORTB=%00110000 ' FUNCTION 8 BITS
GOSUB LCDINS
PORTB=%00111000 ' fUNCTION 8 BITS, 2 LINES, FONT #1
GOSUB LCDINS
PORTB=%00001100 ' DISPLAY ON, CURSOR OFF, BLINK OFF
GOSUB LCDINS
PORTB=%00000001 ' CLEAR THE DISPLAY
GOSUB LCDINS
PORTB=%00000110 ' CLEAR THE DISPLAY
GOSUB LCDINS
CHARCNT=0
PRINC:
IF CHARCNT <= TOTAL THEN
CHAR1="A"
ELSE
CHAR1="B"
ENDIF
IF CHARCNT=TOTAL+1 THEN
PORTB=$C0 'GOTO 2ND LINE FIRST POSITION
GOSUB LCDINS
ENDIF
IF CHARCNT >= (TOTAL * 2)+1 THEN
PORTB=1 'CLEAR THE DISPLAY
GOSUB LCDINS
PORTB=$80 'GOTO 1ST LINE FIRST POSITION
GOSUB LCDINS
CHARCNT=0
ENDIF
'PRINT THE CHAR ON LCD
PORTB=CHAR1
GOSUB LCDDATA
PAUSE 100
'INCREMENT THE CHARCNT
CHARCNT=CHARCNT + 1
GOTO PRINC
LCDDATA:
PAUSEUS 25
HIGH LCD_RS
PAUSEUS 25
HIGH LCD_EN
PAUSEUS 25
LOW LCD_EN
RETURN
LCDINS:
PAUSEUS 25
LOW LCD_RS
PAUSEUS 25
HIGH LCD_EN
PAUSEUS 25
LOW LCD_EN
RETURN
thanks for all the help so far.
>>"Of course you could, even without using a PIC by simply having some DIP-Switches on the Data Lines and a PushButton on the Clock Line."
would it work for only 4 dips for data(d7,d6,d5,d4) plus 1 "clock" button?
is the clock the E or R/S?
how many times would the "clock" have to cycle to get a
command? because only 4 DIPS would mean only 16 combinations.
or
does it(lcd) recive a byte of data through a means of 4 bits on 1 clock and the next 4 bits on the second clock?
if the second is true then i think i can manage a work around.
yes i agree that the lcdout command would be the best method. unfortunatly im not sure if the original code for this board was written in c or assembly er somthing which may not even matter how it is interfaced.
'-------
i know i could design a board to make this eaiser to code, but the whole idea behind this project is to utilize what has already been manufactured and improve on its functionality. in short... No Hardware Modsi really do appreciate all the help i have recived. and i am doing a lot of research before posting.
Hi Edward,
I don't know what type of data you are sending to the LCD, but you need to consider the amount of memory you have available and the time to send it to the display. Your LCD routine will have you convert your byte data into two 4 bit nibbles, and then set the 4 individual output pins to correspond to the correct bits in sequence. This will take time and code space.
The customer will not pay you more for all this effort. I'd tell him that he should upgrade to a "better" processor, then put a SOIC package 16F876 (or even '877) on an adaptor board (like a Stamp or the Pic 10F "hobby kit") with the pin swap incorporated. You can impress the customer with the "latest surface mount technology" and save yourself a lot of trouble. At 1000 off quantities the board cost should not be bad. You could even include ICSP for field upgrades.
Robert G8RPI.
Hello Edward,
Edward>>2. to use four 1 byte variables (one byte for each data line on lcd) and output serially each byte at the same time
or
1. pick what bit holder in a byte to output on a specifed port.
<<
You can load up those 4 bits... and they will not affact your LCD, until you trigger the clock on the chip... Which refers to your #2. Since you already have 4 lines going to your LCD anyhow...this could be a nice software option. Personally I like Ralphs idea of cut a and paste a wire... (nice and slick).
#1 in conjunction with number 2 would work slick as snot. My only question would be, when assigning the output to the port, will it affect the ports that are not supposed to be LCD controllers? Only you know that.
For example... PortB.3 is not used as a LCD data pin... what is it used for? would changing its value by using a quick byte assignment affect your outcome? or is it better to Assign Bits 0-2, separately with a shift, and assign port A.3 separately to ensure proper operation of the circuit.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
thanks for the update guys. wow this is a great forum!
g8rpi- yes a simple HW change would do but thats not and optionalso, in case you forgot there is a 256 byte eeprom on board along side of the pic16f73, which my best gues was that they store the lcd data in that and call it serially.
dwayne - i am interested in how many clock cycles does it take to send a single command to the lcd. i have saved the hd44780 commands page that someone gave me.
could i do this for example:
'on the lcd
1. make pin D7,D6,D5,D4 be a number %0000 to %1111 (0 to 15)
2. send a clock signal from the pic
3. make pin D7,D6,D5,D4 be a number %0000 to %1111 (0 to 15)
4. send another clock signal from the pic
5. and the screen whould diplay something?
i know that R/W is grounded to make it only in write mode.
im not sure on the E and r/s bit.
R/S lets the LCD know if its ascii data or a command it is receiving, right?
1.should E (enable) be high all the time, since i want my lcd on all the time?
2.WHERE DO I SEND THE CLOCK PULSE TOO?? (Enable ?)
3. Is the data ascii? if so do i send the upper half or lower half of the byte first?
when you made your switch controlled lcd did you have to initialize it?
Last edited by EDWARD; - 6th May 2005 at 05:07.
well it sure is embarssing when you answer your own questions.
1. E is the "Clock" line
2. R/S tell the LCD whether the incomming data is intruction data or diplay data.
3. all display data is in ascii format.
A. initalization sequence before using the lcd.
B. i send the upper half (4 bits), make E go from high to low to high, send the lower half (4 bits), make the E go from high to low to high.
If any of these statements are wrong then please correct me. this is what i have gathered and not 100% on it all.
Bookmarks