Use pin name instead of number fails - why?

bperrybap:
(1) But the version you have in glcd is only licensed for use with glcd and is not licensed for other use.
If you want to use avrio in some other project then you must get the other one I linked to.
In reality they are the same, other than the license but you still need the other one to comply
with the license.

(2) I'm curious about the brightness control you mentioned.
I've added backlight control with backlight brightness, but I'm assuming
what you are talking about is for the actual pixels and not the backlight.
Got a link to a datasheet for that display?

--- bill

(1) OK no problem. I'll D/L the one you linked to.

(2) You would have to supply your name and address and email to Noritake to download the datasheet, so to save you the trouble, I attached it for you instead. Also attached is the code library that Noritake supplies (that's where you'll see how they do the brightness - in the file "Noritake_VFD_GUU100.cpp".

And finally a #3... I've been looking at the "avrio.h" code and the "glcd" code and I'm not quite sure exactly how to use it. I would really appreciate it if you could give me a push in the right direction.

Here is a the code that I would love to convert to use avrio (this is my version of "parallel.cpp" which you'll see in the Noritake code library) - but I call it "mode0.h":

// mode0.h - GU-U100 in parallel mode
// Arduino MEGA2560 R3 pinout

#ifndef _MODE0_H
#define _MODE0_H

#define RS	30
#define RW	31
#define EN	32
#define CS1	33
#define CS2	34
#define RESET	35

#define PORT	PORTA
#define DDR	PORT-1
#define PIN	PORT-2

// VFD PIN	PORT	  MEGA2560
// NUMBER	NAME	PIN	PORT
// =======	====	===	====
//	 4	RS	30	PC7
//	 5	RW	31	PC6
//	 6	EN	32	PC5
//
//	 7	DQ0	22	PA0
//	 8	DQ1	23	PA1
//	 9	DQ2	24	PA2
//	10	DQ3	25	PA3
//	11	DQ4	26	PA4
//	12	DQ5	27	PA5
//	13	DQ6	28	PA6
//	14	DQ7	29	PA7
//
//	15	CS1	33	PC4
//	16	CS2	34	PC3
//	17	RESET	35	PC2

void initPort() {
	digitalWrite(RESET, HIGH);
	digitalWrite(EN, LOW);
	pinMode(RS, OUTPUT);
	pinMode(RW, OUTPUT);
	pinMode(EN, OUTPUT);
	pinMode(CS1, OUTPUT);
	pinMode(CS2, OUTPUT);
	pinMode(RESET, OUTPUT);
}

void hardReset() {
	digitalWrite(RESET, LOW);
	_delay_ms(10);
	digitalWrite(RESET, HIGH);
	_delay_ms(100);
}

uint8_t readPort(bool rs, bool chip) {
	uint8_t data;
	digitalWrite(CS1, !chip);
	digitalWrite(CS2, chip);
	digitalWrite(RS, rs);
	*(&DDR) = 0b00000000; // DDR input
	digitalWrite(RW, HIGH);
	digitalWrite(EN, LOW);
	digitalWrite(EN, HIGH);
	data = *(&PIN);
	return data;
}

void writePort(uint8_t data, bool rs, bool chip) {
	digitalWrite(CS1, !chip);
	digitalWrite(CS2, chip);
	digitalWrite(RS, rs);
	*(&DDR) = 0b11111111; // DDR output
	digitalWrite(RW, LOW);
	*(&PORT) = data;
	digitalWrite(EN, LOW);
	digitalWrite(EN, HIGH);
}

#endif

I would love to get rid of all those digitalWrites and digitalReads..... :slight_smile:

Noritake_GU-G100_Datasheet.zip (270 KB)

Noritake_VFD_GUU100.zip (582 KB)