Microcontroler Z8F6422 CAN bus project

 1.10.2005  start of date 

Send us your question.

(c) 2005 Pavel Pindora 

 

 

Hardware

Connect LCD display 16x4       new 14.1.2006

CAN a some description           new 11.2.2006

Connect to Itron display 20x4 Noritake CU20045SCPB-W5J     new 18.10.2008

6.12.2009 - Connect to PLC Mitsubishi, LCD 16x2, KeyBoard, CAN bus.

 

Hardware for CAN bus

 

                       

Z8 Encore Development Kit  http://www.zilog.com/products/partdetails.asp?id=Z8F64200100KIT
MCP2515 SPI CAN bus controler http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en010406
82C250 CAN Transceiver 1Mb http://www.semiconductors.philips.com/acrobat_download/datasheets/PCA82C250_5.pdf

 

http://www.youtube.com/watch?v=uoaFeqfVnMw

Connect to PLC Mitsubishi, LCD 16x2, KeyBoard, CAN bus

Send Receive statistics

 

JP2 on Z8 Encore Dev. Kit  for connecting MCP2515 (in external univerzal PCB) by SPI interface.

Connect LCD display 16x4 PC-1604 series  to Z8E dev. kit.

 

LCD 1604 Connector JP2
1 GND 10
2 Vcc 5V 58 (original n.c.) Wire to 5V from Power (dev.kit)
3 Contrast  (resistor 200R to Vcc)  
4 RS 5 PE3
5 RW 7 PE1
6 E 6 PE2
7-10 n.c.  
11 D4 4 PE4
12 D5 3 PE5
13 D6 2 PE6
14 D7 1 PE7

This software ( AN0143-SC01 ) for LCD 16x2  I modified for 16x4 .

file    LCD_API.H

// Type of LCD
#define LCD_16x4			// Choose either 'LCD_16x4' or 'LCD_40x2'

// Parameters of LCD and Pin connections
#ifdef	LCD_16x4
#define rows				4				// Number of lines in LCD
#define columns				16				// Number of characters in a line
#define start_address_0		0x80			// Start address of first line
#define start_address_1		0xC0			// Start address of second line (if any)
#define start_address_2		0x90			// Start address of 3. line
#define start_address_3		0xD0			// Start address of 4. line
#define LCD_RW_port			PE
#define	LCD_RW_pin			P1
#define LCD_E_port			PE
#define	LCD_E_pin			P2
#define LCD_RS_port			PE
#define	LCD_RS_pin			P3
#define LCD_D4_port			PE
#define	LCD_D4_pin			P4
#define LCD_D5_port			PE
#define	LCD_D5_pin			P5
#define LCD_D6_port			PE
#define	LCD_D6_pin			P6
#define LCD_D7_port			PE
#define	LCD_D7_pin			P7
#endif

 

file    LCD_API_PORT.C     

 function LCD_init
	LCD_command(0x4C);	// Function set (4-bit, 4-lines, 5x10 dots) 0x2C
	LCD_off();
	LCD_clear();
	LCD_on();
	LCD_home();
	LCD_blink();
}	/* LCD_init */
LCD_setposition 
switch (row_number)
{
case 0 :
calc_position = start_address_0 ;
break;
case 1 :
calc_position = start_address_1 ;
break;
case 2 :
calc_position = start_address_2 ;
break;
default :
calc_position = start_address_3 ;
}
LCD_scroll
		LCD_clear();
		while ((count < columns) && (*long_text != 0)) // 14.01.2006
		{
			LCD_printc(*long_text++);
			count++ ;
		}
		LCD_setposition(1,0);
		count = 0 ;
		while ((count < columns) && (*long_text != 0))// 14.01.2006
		{
			LCD_printc(*long_text++);
			count++ ;
		}
		LCD_setposition(2,0);
		count = 0 ;
		while ((count < columns) && (*long_text != 0))// 14.01.2006
		{
			LCD_printc(*long_text++);
			count++ ;
		}
		LCD_setposition(3,0);
		count = 0 ;
		while ((count < columns) && (*long_text != 0))// 14.01.2006
		{
			LCD_printc(*long_text++);
			count++ ;
		}
 

 

CAN bus and some description  (11.2.2006)

Délka vedení (Length of wire) Resistance Ohm / 1m Max. Baud rate
< 40m <70mO/m  1Mbits/sec
< 300m <60 mO/m  500kbits/sec
< 600m <40 mO/m 100kbits/sec
< 1000m <26 mO/m 50kbits/sec

 

CAN topology 

18.10.2008 Connected to Itron display 20x4 Noritake CU20045SCPB-W5J

Pin 3 as Reset., see LCD 1604 table

 

 

This is all , today .