/************************************************** ***
This program was produced by the
CodeWizardAVR V2.04.4a Advanced
Automatic Program Generator
© Copyright 1998-2009 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project : N96 lcd
Version : 1
Date : 9/11/2010
Author : Am.As
Company : black-8
Comments: >>>>>>>>>>>>&g t;>>>>>>>>>>> LCD TEST <<<<<<<<<<<<&l t;<<<<<<<<<<<< <
Chip type : ATmega16
Program type : Application
AVR Core Clock frequency: 16.000000 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 512
************************************************** ***/
#include <mega16.h>
#include <delay.h>
// Standard Input/Output functions
#include <stdio.h>
//================================ LCD CONFIGURATIONS =======================================
#define LCD_CONTROLPORT_DDR DDRD
#define LCD_CONTROLPORT_PORT PORTD
#define LCD_CONTROLPORT_PIN PIND
#define LCD_RST_DDR DDRD
#define LCD_RST_PORT PORTD
#define LCD_RST_PIN 2
#define LCD_RS_DDR DDRD
#define LCD_RS_PORT PORTD
#define LCD_RS_PIN 3
#define LCD_CS_DDR DDRD
#define LCD_CS_PORT PORTD
#define LCD_CS_PIN 4
#define LCD_RD_DDR DDRD
#define LCD_RD_PORT PORTD
#define LCD_RD_PIN 5
#define LCD_WR_DDR DDRD
#define LCD_WR_PORT PORTD
#define LCD_WR_PIN 6
#define LCD_DATAPORT_MSB_DDR DDRB
#define LCD_DATAPORT_MSB_PORT PORTB
#define LCD_DATAPORT_MSB_PIN PINB
#define LCD_DATAPORT_LSB_DDR DDRC
#define LCD_DATAPORT_LSB_PORT PORTC
#define LCD_DATAPORT_LSB_PIN PINC
//================================================== ==============
#include "tftlcd_functions.h"
// Declare your global variables here
int i=0;
char color[20]="Am.As";
//char gps[30];
void main(void)
{
// Declare your local variables here
// Input/Output Ports initialization
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x67;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
lcd_init();
#define PORTRAIT
lcd_background_color(GREEN );
while (1)
{
//#define PORTRAIT
//lcd_clear_screen();
//#define LANDSCAPE
lcd_gotoxy(2,1);
lcd_putsf(" Amin.Askari@gmail.com ",0x0000,0,RED);
lcd_gotoxy(3,3);
lcd_putsf(" IT WORKS !!! ",0x0000,0,BLUE);
lcd_gotoxy(8,5);
lcd_putsf(" YEAH ",0x0000,0,YELLOW);
lcd_gotoxy(1,8);
sprintf(color,"COLOR >> 0x%x ",i);
lcd_puts(color,0x0000,0,i);
//delay_ms(5);
i+=1;
//gets(gps,20);
//printf("hello honey"
;
//lcd_gotoxy(1,10);
//lcd_puts(gps,0x0000,0,WHITE);
};
}
This program was produced by the
CodeWizardAVR V2.04.4a Advanced
Automatic Program Generator
© Copyright 1998-2009 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project : N96 lcd
Version : 1
Date : 9/11/2010
Author : Am.As
Company : black-8
Comments: >>>>>>>>>>>>&g t;>>>>>>>>>>> LCD TEST <<<<<<<<<<<<&l t;<<<<<<<<<<<< <
Chip type : ATmega16
Program type : Application
AVR Core Clock frequency: 16.000000 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 512
************************************************** ***/
#include <mega16.h>
#include <delay.h>
// Standard Input/Output functions
#include <stdio.h>
//================================ LCD CONFIGURATIONS =======================================
#define LCD_CONTROLPORT_DDR DDRD
#define LCD_CONTROLPORT_PORT PORTD
#define LCD_CONTROLPORT_PIN PIND
#define LCD_RST_DDR DDRD
#define LCD_RST_PORT PORTD
#define LCD_RST_PIN 2
#define LCD_RS_DDR DDRD
#define LCD_RS_PORT PORTD
#define LCD_RS_PIN 3
#define LCD_CS_DDR DDRD
#define LCD_CS_PORT PORTD
#define LCD_CS_PIN 4
#define LCD_RD_DDR DDRD
#define LCD_RD_PORT PORTD
#define LCD_RD_PIN 5
#define LCD_WR_DDR DDRD
#define LCD_WR_PORT PORTD
#define LCD_WR_PIN 6
#define LCD_DATAPORT_MSB_DDR DDRB
#define LCD_DATAPORT_MSB_PORT PORTB
#define LCD_DATAPORT_MSB_PIN PINB
#define LCD_DATAPORT_LSB_DDR DDRC
#define LCD_DATAPORT_LSB_PORT PORTC
#define LCD_DATAPORT_LSB_PIN PINC
//================================================== ==============
#include "tftlcd_functions.h"
// Declare your global variables here
int i=0;
char color[20]="Am.As";
//char gps[30];
void main(void)
{
// Declare your local variables here
// Input/Output Ports initialization
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x67;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
lcd_init();
#define PORTRAIT
lcd_background_color(GREEN );
while (1)
{
//#define PORTRAIT
//lcd_clear_screen();
//#define LANDSCAPE
lcd_gotoxy(2,1);
lcd_putsf(" Amin.Askari@gmail.com ",0x0000,0,RED);
lcd_gotoxy(3,3);
lcd_putsf(" IT WORKS !!! ",0x0000,0,BLUE);
lcd_gotoxy(8,5);
lcd_putsf(" YEAH ",0x0000,0,YELLOW);
lcd_gotoxy(1,8);
sprintf(color,"COLOR >> 0x%x ",i);
lcd_puts(color,0x0000,0,i);
//delay_ms(5);
i+=1;
//gets(gps,20);
//printf("hello honey"

//lcd_gotoxy(1,10);
//lcd_puts(gps,0x0000,0,WHITE);
};
}
واقعا عجب دردسری این ال سی دی N96 .
دیدگاه