Noritake itron CU24043-Y1A Скачать руководство пользователя страница 7

 

DOCUMENT NUMBER :E-M-0001-00

 

C++ Sample Code                                                                                                       Y-Series  

 

                                                                                             7/18                                                                        E2

5008

00 

3.1.3 Sample Code 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

Example 3-1 is a C++ sample code for Fig. 3-2 (Asynchronous Serial Interface). It initializes the module and executes 
a demonstration (displaying all Common Font Set characters). The code has been compiled with the CCS C++ 
Complier only and may need minor editing to work with other compilers. Refer to your specific module specification 
“Serial Interface” and “Jumper Setting”. 

 
#include <16F877.h>           

 

 

 

 

//for PIC16F877 

#fuses HS,NOWDT,NOPROTECT,PUT,BROWNOUT,NOLVP 
#use delay(clock = 20000000)   

 

 

 

//for 20MHz clock 

//use EUSART module, baud rate = 38,400bps, format: Start (1bit) + Data (8bit) + Stop (1bit) 
#use rs232(BAUD = 38400, XMIT = PIN_C6, RCV = PIN_C7) 
#use fast_io(D)                

 

 

 

 

//use D port fast I/O 

 
//define output ports 
#define SBUSY  PIN_D3 
 
//Variable declaration 
int n, data; 
 
//Prototype of functions 
void executing_demo( ); 
void asynchro_out(int data); 
 
void main( ) 

   //Initialize a PIC and a display. 
   delay_ms(1000);         

//warmup delay 

   set_tris_d(0x04);       

//D3 = input 

   asynchro_out(0x1B);  //display 

initialization 

   asynchro_out(0x40); 
   //Execute a demonstration. 
   executing_demo( ); 

 
void executing_demo( ) 

   for(data = 0x20; data <= 0x7F; data++) 
      asynchro_out(data); 

 
void asynchro_out(int data) 

   //if SBUSY == 1, wait until SBUSY == 0 
   while(input(SBUSY) == 1) 
   { 
   } 
   putc(data);   

 

//send 8-bit Asynchronous Serial data 

}    

Example 3-1 

Содержание itron CU24043-Y1A

Страница 1: ...e Code Control VFD Module with Host System DOCMENT NO E M 0001 00 DATE OF ISSUE Jan 29 2009 REVISION Jan 29 2009 Noritake Co Inc 2635 Clearbrook Drive Arlington Height IL 60005 www noritake elec com T...

Страница 2: ...2 Synchronous Serial Communications 8 3 2 1 Sample Circuit 8 3 2 2 Accessories 8 3 2 3 Sample Code 9 4 Sample Command Sets 10 4 1 Displaying Characters 10 4 2 Blinking Characters 10 4 3 Underlining C...

Страница 3: ...cause a VFD module uses high voltage exceeding 30 50 volts Do not unplug the power and or data cables of a VFD module during operating condition because unrecoverable damage may result A VFD module ne...

Страница 4: ...Pin 5 Pin 3 Pin 1 Host System VFD Module PBUSY WR D0 D7 Fig 2 2 Fig 2 1 Fig 2 2 shows a sample circuit containing the PIC microcontroller PIC16F877 Noritake provides these parallel interface accessori...

Страница 5: ..._ms 1000 warm up delay set_tris_b 0x00 B0 B7 output set_tris_c 0x40 C6 input C7 output output_b 0x00 B0 B7 0 output_high WR WR 1 parallel_out 0x1B display initialization parallel_out 0x40 Execute a de...

Страница 6: ...rial 5VDC CMOS level interface Either the asynchronous or synchronous mode is selectable by the jumper setting The CUXXXXX Y100 model has an asynchronous serial RS232 level interface Pin 1 Pin 2 Pin 3...

Страница 7: ...delay clock 20000000 for 20MHz clock use EUSART module baud rate 38 400bps format Start 1bit Data 8bit Stop 1bit use rs232 BAUD 38400 XMIT PIN_C6 RCV PIN_C7 use fast_io D use D port fast I O define ou...

Страница 8: ...n 4 Pin 5 Pin 6 Host System VFD Module SBUSY SCK SIN Fig 3 7 Fig 3 8 Noritake provides these serial interface accessories For further information please contact your local sales representative Fig 3 9...

Страница 9: ...ecuting_demo for data 0x20 data 0x7F data synchro_out data void synchro_out int data if SBUSY 1 wait until SBUSY 0 while input SBUSY 1 output_low CLK CLK 0 if data 0x01 0x01 if bit_0 LSB 1 D0 1 output...

Страница 10: ...t 60 0x31 0x78 0x31 Character Code 0x1F 0x28 0x67 0x40 0x01 0x02 Character Size 0x31 0x78 0x32 Character Code 0x1F 0x28 0x67 0x40 0x02 0x02 Character Size 0x32 0x78 0x32 Character Code 0x1F 0x24 0x0C...

Страница 11: ...d_set 123 0x1F 0x58 0x08 Display Brightness 0x1F 0x24 0x07 0x00 0x00 0x00 Cursor Position 0x1F 0x28 0x67 0x50 0x03 0x00 0x00 Character Brightness 0x4D 0x41 0x49 0x4E Character Code 0x1F 0x24 0x0D 0x00...

Страница 12: ...cation of Fig 4 6 and Fig 4 7 are 50h and 51h respectively in this example 0x05 The Number of bytes for a Character 0x82 BYTE 1 DATA 0x24 BYTE 2 DATA 0xA5 BYTE 3 DATA 0x12 BYTE 4 DATA 0x11 BYTE 5 DATA...

Страница 13: ...DATA Example 4 7 User definable font Flash ROM is stored 224 characters 20h FFh and displayed in a horizontal orientation All 224 character data has to be defined at once so dummy blank data is store...

Страница 14: ...02 Alternative 5 7 Matrix Font Fig 4 12 void alternative_magnified_font const int command_set 36 0x1F 0x28 0x67 0x40 0x02 0x02 Character Size 0x21 0x31 0x3F 0x59 0x66 0x69 0x74 Character Code 0x1F 0x2...

Страница 15: ...on 0x1B 0x74 0x01 Character Type Code 0x80 0x81 0x82 0x83 0x84 0x85 0x94 0x8F 0x8E 0x8D 0x8C Character Code 0x1F 0x24 0x08 0x00 0x01 0x00 Cursor Position 0x97 0x98 0x99 0x9A 0xE8 0xE9 0xEA 0xEB Charac...

Страница 16: ...Power Save Mode minimizes the standby power The mode is cancelled when the next command is received void displaying_firmware_version const int command_set 17 0x1F 0x28 0x65 0x01 0x49 0x4E User Setup M...

Страница 17: ...Green Filter Fig 5 3 With Blue Filter The original color of illumination is blue green Fig 5 1 and it has a wide range of the color spectrum Therefore the color can be changed with optional color fil...

Страница 18: ...DOCUMENT NUMBER E M 0001 00 C Sample Code Y Series 18 18 E2 5008 00 6 Revision History Version Date Revision Description Prepared Approved 00 01 29 09 Initial Issued M S A N...

Отзывы: