Truncated match.
PICList
Thread
'Powertip LCD Display problem (HD44780 controller)'
1997\02\19@113903
by
Jim Main
I'm trying to interface a 16C74 to one of these modules (using 8 bit
wide data).
The problem is that only the first 8 characters are displayed (it's a
16X1 display) and I don't understand why..
I thought it was a fault at first, but another module does exactly the
same - any thoughts??
Jim
--
Jim Main
spam_OUTjimTakeThisOuT
ewcomm.demon.co.uk
Visit Eastwood Communications at http://www.ewcomm.demon.co.uk
Broadcast Electronics & Custom Design
1997\02\19@120228
by
myke predko
Jim,
I suspect you have a 16x1 that is electrically set up as an 8x2.
Keep writing to the LCD, More character should start showing up after you've
sent 0x040 (64d) characters.
myke
{Quote hidden}>I'm trying to interface a 16C74 to one of these modules (using 8 bit
>wide data).
>
>The problem is that only the first 8 characters are displayed (it's a
>16X1 display) and I don't understand why..
>
>I thought it was a fault at first, but another module does exactly the
>same - any thoughts??
>
>Jim
>--
>Jim Main
>
.....jimKILLspam
@spam@ewcomm.demon.co.uk
>Visit Eastwood Communications at
http://www.ewcomm.demon.co.uk
>Broadcast Electronics & Custom Design
>
>
"I don't do anything that anybody else in good physical condition and
unlimited funds couldn't do" - Bruce Wayne
1997\02\19@165617
by
Andy Kunz
At 04:32 PM 2/19/97 +0000, you wrote:
>I'm trying to interface a 16C74 to one of these modules (using 8 bit
>wide data).
>
>The problem is that only the first 8 characters are displayed (it's a
>16X1 display) and I don't understand why..
>
>I thought it was a fault at first, but another module does exactly the
>same - any thoughts??
Jim,
The address of the second half of the display is as if it were starting on
Line 2, Column 0.
That's just the way it is wired.
Nice part is that if you ever go to a 8x2 display, you don't need to change
anything except maybe to make it prettier.
Andy
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\02\19@191314
by
Jim Main
>I suspect you have a 16x1 that is electrically set up as an 8x2.
>
>Keep writing to the LCD, More character should start showing up after you've
>sent 0x040 (64d) characters.
>
>myke
You were right - the second chunk of 8 characters started at 28h - takes
away a lot of the flexibility - I'd thought of scrolling the display
window over the 80 char ram memory to get a moving message display - but
the fragmentation makes that a little bit of a handful.
shame the data sheet didn't mention any of this!!
thanks again
jim
--
Jim Main
jim
KILLspamewcomm.demon.co.uk
Visit Eastwood Communications at http://www.ewcomm.demon.co.uk
Broadcast Electronics & Custom Design
1997\02\19@204328
by
Andy Kunz
|
>You were right - the second chunk of 8 characters started at 28h - takes
>away a lot of the flexibility - I'd thought of scrolling the display
>window over the 80 char ram memory to get a moving message display - but
>the fragmentation makes that a little bit of a handful.
You can still scroll a message very simply. Try the attached C code (CCS).
You could
also use the display offset address command (0001sr--, where s=1 causes
display shift, r=1 causes it to shift right) to shift what appears in the
window.
>shame the data sheet didn't mention any of this!!
It probably did. It's the standard.
Andy
======================= File T2.C =======================
#include <T2.H>
#include <LCD.C> // Uses the CCS LCD.C file which I fixed to work on
better
// pin choice layout.
Marquee_LCD (char s[32], byte size)
{
byte left, right, i, leftpos;
byte cleft, cright;
leftpos = 0;
right = 0;
while (right < size+16)
{
left=leftpos++;
right=left+8;
for (i=0; i<8; i++)
{
if (left < size)
cleft = s[left];
else
cleft = ' ';
if (right < size)
cright = s[right];
else
cright = ' ';
lcd_gotoxy (i+1,1);
lcd_putc (cleft);
lcd_gotoxy (i+1,2);
lcd_putc (cright);
left++;
right++;
}
if (leftpos == 1)
delay_ms (1000);
delay_ms (300);
}
}
main()
{
char testmsg[38]= "This is a test of the scroll function";
setup_counters(RTCC_INTERNAL,WDT_18MS);
setup_port_a(RA0_RA1_ANALOG_RA3_REF);
setup_adc(ADC_CLOCK_DIV_8);
port_b_pullups(TRUE);
lcd_init();
lcd_gotoxy (1,1);
lcd_putc ("Montana ");
lcd_gotoxy (1,2);
lcd_putc (" Design ");
delay_ms (2000);
Marquee_LCD (testmsg,37);
lcd_gotoxy (1,1);
lcd_putc ("Montana ");
lcd_gotoxy (1,2);
lcd_putc (" Design ");
while (TRUE);
}
======================= File T2.H =======================
#device PIC16C73A
#use delay(clock=4000000)
#nolist
/////////////////////////////// I/O definitions for INPUT() and OUTPUT_xxx()
#define PIN_A0 0
#define PIN_A1 1
#define ROW2 42
#define PIN_A3 3
#define PIEZO 44
#define ROW1 45
#use fixed_io(A_OUTPUTS=PIEZO)
#byte port_A=5
#define 48
#define COL0 53
#define COL1 54
#define COL2 55
#byte port_B=6
#define PIN_C0 56
#define RX_IN 57
#define SX_OUT 58
#define PIN_C3 59
#define EEPROM_SCL 59
#define PIN_C4 60
#define EEPROM_SDA 60
#define PIN_C5 61
#define TX 62
#define RX 63
#use fixed_io(C_OUTPUTS=SX_OUT,TX)
#byte port_C=7
#use rs232(baud=4800 ,xmit=TX,rcv=RX)
#use i2c(master,sda=PIN_C4,scl=PIN_C3)
/////////////////////////////// Useful defines
#define FALSE 0
#define TRUE 1
#define BYTE int
#define BOOLEAN short int
#define getc getch
#define getchar getch
#define puts(s) {printf(s); putchar(13); putchar(10);}
#define putc putchar
/////////////////////////////// Constants used for RESTART_CAUSE()
#define WDT_FROM_SLEEP 0
#define WDT_TIMEOUT 8
#define MCLR_FROM_SLEEP 16
#define NORMAL_POWER_UP 24
/////////////////////////////// Constants used for SETUP_COUNTERS()
#define RTCC_INTERNAL 0
#define RTCC_EXT_L_TO_H 32
#define RTCC_EXT_H_TO_L 48
#define RTCC_DIV_2 0
#define RTCC_DIV_4 1
#define RTCC_DIV_8 2
#define RTCC_DIV_16 3
#define RTCC_DIV_32 4
#define RTCC_DIV_64 5
#define RTCC_DIV_128 6
#define RTCC_DIV_256 7
#define WDT_18MS 8
#define WDT_36MS 9
#define WDT_72MS 10
#define WDT_144MS 11
#define WDT_288MS 12
#define WDT_576MS 13
#define WDT_1152MS 14
#define WDT_2304MS 15
#define L_TO_H 0x40
#define H_TO_L 0
#define RTCC_ZERO 0x0B20 // Used for ENABLE/DISABLE INTERRUPTS
#define RB_CHANGE 0x0B08 // Used for ENABLE/DISABLE INTERRUPTS
#define EXT_INT 0x0B10 // Used for ENABLE/DISABLE INTERRUPTS
#define GLOBAL 0x0BC0 // Used for ENABLE/DISABLE INTERRUPTS
///////////////////////////////////// Constants used for Timer1 and Timer2
#define T1_DISABLED 0
#define T1_INTERNAL 5
#define T1_EXTERNAL 7
#define T1_EXTERNAL_SYNC 3
#define T1_CLK_OUT 8
#define T1_DIV_BY_1 0
#define T1_DIV_BY_2 0x10
#define T1_DIV_BY_4 0x20
#define T1_DIV_BY_8 0x30
#byte TIMER_1_LOW= 0x0e
#byte TIMER_1_HIGH= 0x0f
#define T2_DISABLED 0
#define T2_DIV_BY_1 4
#define T2_DIV_BY_4 5
#define T2_DIV_BY_16 6
#byte TIMER_2= 0x11
#define INT_TIMER1 0x8C01 // Used for ENABLE/DISABLE INTERRUPTS
#define INT_TIMER2 0x8C02 // Used for ENABLE/DISABLE INTERRUPTS
//////////////////////////////////// Constants used for SETUP_CCP1()
#define CCP_OFF 0
#define CCP_CAPTURE_FE 4
#define CCP_CAPTURE_RE 5
#define CCP_CAPTURE_DIV_4 6
#define CCP_CAPTURE_DIV_16 7
#define CCP_COMPARE_SET_ON_MATCH 8
#define CCP_COMPARE_CLR_ON_MATCH 9
#define CCP_COMPARE_INT 0xA
#define CCP_COMPARE_RESET_TIMER 0xB
#define CCP_PWM 0xC
#define CCP_PWM_PLUS_1 0x1c
#define CCP_PWM_PLUS_2 0x2c
#define CCP_PWM_PLUS_3 0x3c
#byte CCP_1_LOW= 0x15
#byte CCP_1_HIGH= 0x16
#define INT_CCP1 0x8C04 // Used for ENABLE/DISABLE INTERRUPTS
//////////////////////////////////// Constants used for SETUP_CCP2()
#byte CCP_2_LOW= 0x1B
#byte CCP_2_HIGH= 0x1C
#define INT_CCP2 0x8D01 // Used for ENABLE/DISABLE INTERRUPTS
//////////////////////////////////// Constants used in SETUP_SSP()
#define SPI_MASTER 0x20
#define SPI_SLAVE 0x24
#define SPI_L_TO_H 0
#define SPI_H_TO_L 0x10
#define SPI_CLK_DIV_4 0
#define SPI_CLK_DIV_16 1
#define SPI_CLK_DIV_64 2
#define SPI_CLK_T2 3
#define SPI_SS_DISABLED 1
#define INT_SSP 0x8C08 // Used for ENABLE/DISABLE INTERRUPTS
#define INT_SSP 0x8C08 // Used for ENABLE/DISABLE INTERRUPTS
#define INT_RDA 0x8C20 // Used for ENABLE/DISABLE INTERRUPTS
#define INT_TBE 0x8C10 // Used for ENABLE/DISABLE INTERRUPTS
///////////////////////////////////// Constants used for SETUP_ADC()
#define ALL_ANALOG 0
#define ANALOG_RA3_REF 1
#define RA0_RA1_RA3_ANALOG 4
#define RA0_RA1_ANALOG_RA3_REF 5
#define NO_ANALOGS 6
#define ADC_OFF 0
#define ADC_CLOCK_DIV_2 1
#define ADC_CLOCK_DIV_8 0x41
#define ADC_CLOCK_DIV_32 0x81
#define ADC_CLOCK_INTERNAL 0xc1
#define ADC_DONE 0x8C40 // Used for ENABLE/DISABLE INTERRUPTS
#list
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\02\19@221132
by
John Payson
|
> >You were right - the second chunk of 8 characters started at 28h - takes
> >away a lot of the flexibility - I'd thought of scrolling the display
> >window over the 80 char ram memory to get a moving message display - but
> >the fragmentation makes that a little bit of a handful.
>
> >shame the data sheet didn't mention any of this!!
>
> It probably did. It's the standard.
I just got the 16x1 display sold by Radio Shack (at $24.95 it's a bit pricey,
but the catalog picture suggested it was encased nicely. The actual unit
meets that expectation. Perhaps the extra $15 (versus Timeline's prices on
such things) is a bit much for a bit of plastic, but anyway, it looks pretty
nice.
Anyhow, the data sheet with the display does not seem to mention the split
addressing, even though from the "block diagram" it's clear that that's how
the thing works. So I would not be surprised if other people with 16x1
displays are in the same boat. It seems the prices for "true" 16x1 displays
that are in fact wired as such (for 1/8 duty cycle drive) are more than the
prices for 16x2 displays, so the split addressing should probably be in any
type of LCD-related FAQ.
1997\02\20@044558
by
Jim Main
In article <.....199702200258.UAA28055KILLspam
.....Jupiter.Mcs.Net>, John Payson
<EraseMEsupercatspam_OUT
TakeThisOuTMCS.NET> writes
>I just got the 16x1 display sold by Radio Shack (at $24.95 it's a bit pricey,
>but the catalog picture suggested it was encased nicely. The actual unit
>meets that expectation. Perhaps the extra $15 (versus Timeline's prices on
>such things) is a bit much for a bit of plastic, but anyway, it looks pretty
>nice.
I paid 35 (about $52) for my 16x1 display (and that was a 'new low cost
alternative') - although it does have LED backlighting..
The Sanyo version would have been the equivalent of around $80 (!)
>
>the split addressing should probably be in any
>type of LCD-related FAQ.
absolutely - I read a couple of faqs & neither mentioned the split
addressing
Jim
--
Jim Main
jim
spam_OUTewcomm.demon.co.uk
Visit Eastwood Communications at http://www.ewcomm.demon.co.uk
Broadcast Electronics & Custom Design
1997\02\20@045220
by
Jim Main
1997\02\20@051828
by
Andy Kunz
>I just got the 16x1 display sold by Radio Shack (at $24.95 it's a bit pricey,
>but the catalog picture suggested it was encased nicely. The actual unit
>meets that expectation. Perhaps the extra $15 (versus Timeline's prices on
>such things) is a bit much for a bit of plastic, but anyway, it looks pretty
>nice.
Try the Optrex units from Digi-Key.
I use Hantronix myself, as they are half the Optrex price in smaller
quantities. Same glass and controller, though.
Andy
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\02\20@054358
by
Andy Kunz
|
>no - it definitely didn't - I went through it over & over (it was a
>generic data sheet for about 6 or 7 displays in the range) I also had a
>look at a data sheet for a Sanyo equivalent and it didn't mention it -
>so I think I can be forgiven!
You are forgiven, Jim. Guess I'm spoiled by Optrex and Hantronix documentation.
Somebody commented on power-up timing. That's a good point to consider.
Can you power it up, then hit the reset button and see if it works. If so,
that's probably the culprit.
>thanks for the c code - do you find c saves you a lot of time when
>programming the PIC - or is it not a bit loose in compiled code size??
C has its place. When a customer wants to see if something will do what
they want, it's very easy to code up something quick in C. He can start
selling it, but it costs money because I frequently start with a bigger chip
then. (It's also an incentive for him to come back to me for more work <G>).
After he's sold a few, he has me do Version 2 in assembly to cut mfg costs
(cheaper chip).
Sometimes it just doesn't matter. The example I sent you is still coded
mostly in C (I had to write 16-bit decimal display (CCS doesn't have one
that works) and ISRs in assembly for speed). It was based on a '73 because
that chip has the A/D and PWM output (1uS resolution) that I needed. Lots
of code space. I could have used a '71 or '72, but then the PWM resolution
would suffer.
The CCS stuff is OK. Definitely better than ByteCraft/Microchip. Still
very buggy, though. (I often have to proofread the assembly to look for
errors).
Andy
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\02\20@115700
by
John Dammeyer
|
At 05:44 AM 20/02/1997 -0500, you wrote:
[snip]
>The CCS stuff is OK. Definitely better than ByteCraft/Microchip. Still
>very buggy, though. (I often have to proofread the assembly to look for
>errors).
>
>Andy
So Andy, you have used the MPC from Bytecraft as well as the MPLAB-C correct?
When I make comments about the MPLAB-C I try my best to qualify them with
Version numbers. So many of the compiler writers are trying their best to
repair their products and version numbers are the way to keep score. My
complaints with MPLAB-C stem from version #1.10 and yes, you have to walk
through the code to verify it generated correct assembler. At some point I
quit that futile effort after it wouldn't generate the correct code.
As for Bytecraft, they manufacture MPC Ver #1.20c which does _not_ require
walking through the code at all. When I do examine the code it's to figure
out how to rewrite the C to recover some program space or check timing. The
only time I needed to walk through resulted in the change from 1.20b to
1.20c in 1/2 a day from Bytecraft. OTOH, it took 4 weeks to receive a
reply from Microchip on a bug in MPLAB-C 1.10. Didn't matter by then, I
had already purchased MPC.
Similarily with your comments about CCS and proofreading. Which version?
I'm sure Clyde would like to know.
Regards,
John
Pioneers are the ones, face down in the mud,
with arrows in their backs.
Automation Artisans Inc. Ph. 1-250-544-4950
PO Box 20002 Fax 1-250-544-4954
Sidney, BC CANADA V8L 5C9
1997\02\20@161602
by
Andy Kunz
|
>Similarily with your comments about CCS and proofreading. Which version?
>I'm sure Clyde would like to know.
John,
CCS C versions:
2.250, 2.256, 2.262, 2.264, 2.268, 2.271
These versions span the time from 12/13/96 to 2/14/97 (the dates I
downloaded them, anyway). 21 versions in about 63 days works out to a
release every 3 days on average. Does that sound like stable software to you?
Version 2.268 is what I'm using now, because a feature I was utilizing in it
was broken in v2.271. And it was done on-purpose, can you believe that!?!?!
I have reported the problem to CCS several days ago, but there has been no
reply since then. I see myself as an unpaid (actually, PAYING) beta-tester,
so I feel mildly screwed. But I have to admit, it's definitely the better
product.
Andy
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...