Автор: Пользователь скрыл имя, 04 Ноября 2012 в 09:58, курсовая работа
Электронные светодиодные технологии активно внедряются в визуальный мир вокруг нас. С их помощью создаются разные виды электронных табло и бегущие информационные строки, которые используются для:
-рекламирования всевозможных товаров и услуг;
-отображения полезной информации в автотранспорте, на входных группах, в спортивных, медицинских, учебных и прочих заведениях;
-вывода точного времени, даты, температуры воздуха, воды, влажности и других атмосферных параметров.
Техническое задание……………………………………….2
Введение…………………………………………………….6
Функциональная схема…….…………………………….…7
Принципиальная схема………………………………….…9
Программное обеспечение………………………….……..11
Заключение…………………………………………………18
Список литературы…………………………………………19
Модуль
процессора выполнен на
Модуль процессора потребляет по цепи +5В – максимум 160мА.
4.3 Блок питания: модуль питания
Каждый модуль питания включает: два предохранителя, микросхемы U1 и U2, два конденсатора. Предохранители обеспечивают защиту от перегрузки сети питания 220В 50Гц. Конденсаторы предназначены для сглаживания пульсаций постоянного напряжения +5В. Микросхемы обеспечивают преобразование напряжения переменного тока 220В 50Гц в стабилизированные напряжения постоянного тока +15В и +5В. Каждый модуль питания поддерживает нагрузку до 2А по +15В и до1,5А по +5В.
Программное обеспечение
#include <iom128.h>
#include <inavr.h>
#include <comp_a90.h>
#define CPU_FREQ 2450000L
#define size 8 /длина табло
//================ШРИФТ=======
const unsigned char Pixel[][] = {
{0x03,0x00,0x03,0x00}, // (34) "
{0x14,0x3E,0x14,0x3E,0x14,
{0x24,0x2A,0x7F,0x2A,0x12,
{0x63,0x13,0x08,0x64,0x63,
{0x36,0x49,0x55,0x22,0x50,
{0x03,0x00}, // (39) '
{0x3E,0x41,0x00}, // (40) (
{0x41,0x3E,0x00}, // (41) )
{0x2A,0x1C,0x08,0x1C,0x2A,
{0x10,0x10,0x7C,0x10,0x10,
{0xC0,0x00}, // (44) ,
{0x08,0x08,0x08,0x08,0x00}, // (45) -
{0x40,0x00}, // (46) .
{0x60,0x10,0x08,0x06,0x00}, // (47) /
{0x3E,0x51,0x49,0x45,0x3E,
{0x42,0x7F,0x40,0x00}, // (49) 1
{0x62,0x51,0x49,0x49,0x46,
{0x22,0x41,0x49,0x49,0x36,
{0x18,0x14,0x12,0x7F,0x10,
{0x27,0x45,0x45,0x45,0x39,
{0x3E,0x49,0x49,0x49,0x32,
{0x01,0x01,0x79,0x05,0x03,
{0x36,0x49,0x49,0x49,0x36,
{0x26,0x49,0x49,0x49,0x3E,
{0x44,0x00}, // (58) :
{0xC4,0x00}, // (59) ;
{0x08,0x14,0x22,0x00}, // (60) <
{0x14,0x14,0x14,0x00}, // (61) =
{0x22,0x14,0x08,0x00}, // (62) >
{0x02,0x01,0x51,0x09,0x06,
{0x3E,0x41,0x5D,0x55,0x4D,
{0x7C,0x12,0x11,0x12,0x7C,
{0x7F,0x49,0x49,0x49,0x36,
{0x3E,0x41,0x41,0x41,0x22,
{0x7F,0x41,0x41,0x41,0x3E,
{0x7F,0x49,0x49,0x49,0x41,
{0x7F,0x09,0x09,0x09,0x01,
{0x3E,0x41,0x49,0x29,0x7A,
{0x7F,0x08,0x08,0x08,0x7F,
{0x41,0x7F,0x41,0x00}, // (73) I
{0x20,0x40,0x40,0x40,0x3F,
{0x7F,0x08,0x08,0x14,0x63,
{0x7F,0x40,0x40,0x40,0x40,
{0x7F,0x02,0x0C,0x02,0x7F,
{0x7F,0x02,0x04,0x08,0x7F,
{0x3E,0x41,0x41,0x41,0x3E,
{0x7F,0x09,0x09,0x09,0x06,
{0x3E,0x41,0x41,0x41,0xBE,
{0x7F,0x09,0x09,0x09,0x76,
{0x26,0x49,0x49,0x49,0x32,
{0x01,0x01,0x7F,0x01,0x01,
{0x3F,0x40,0x40,0x40,0x3F,
{0x1F,0x20,0x40,0x20,0x1F,
{0x3F,0x40,0x40,0x3F,0x40,
{0x63,0x14,0x08,0x14,0x63,
{0x07,0x08,0x70,0x08,0x07,
{0x61,0x51,0x49,0x45,0x43,
{0x7F,0x41,0x00}, // (91) [
{0x03,0x04,0x08,0x10,0x60,
{0x41,0x7F,0x00}, // (93) ]
{0x02,0x01,0x02}, // (94) ^
{0x40,0x40,0x40,0x40,0x40,
{0x03,0x00}, // (96) `
{0x20,0x54,0x54,0x54,0x78,
{0x7F,0x48,0x44,0x44,0x38,
{0x38,0x44,0x44,0x44,0x00}, // (99) c
{0x38,0x44,0x44,0x24,0x7F,
{0x38,0x54,0x54,0x54,0x48,
{0x04,0x7E,0x05,0x00}, // (102) f
{0x38,0x44,0x44,0x24,0xFC,
{0x7F,0x08,0x04,0x04,0x78,
{0x7D,0x00}, // (105) i
{0x00,0xFD,0x00}, // (106) j
{0x7F,0x10,0x28,0x44,0x00}, // (107) k
{0x7F,0x00}, // (108) l
{0x7C,0x04,0x04,0x78,0x04,
{0x7C,0x04,0x04,0x04,0x78,
{0x38,0x44,0x44,0x44,0x38,
{0xFC,0x24,0x44,0x44,0x38,
{0x38,0x44,0x44,0x24,0xF8,
{0x7C,0x08,0x04,0x04,0x00}, // (114) r
{0x48,0x54,0x54,0x54,0x24,
{0x04,0x3E,0x44,0x44,0x00}, // (116) t
{0x3C,0x40,0x40,0x40,0x7C,
{0x1C,0x20,0x40,0x20,0x1C,
{0x3C,0x40,0x40,0x38,0x40,
{0x44,0x28,0x10,0x28,0x44,
{0x3C,0x40,0x40,0x40,0xFC,
{0x44,0x64,0x54,0x4C,0x44,
{0x10,0xEE,0x01,0x00}, // (123) {
{0xFF,0x00}, // (124) |
{0x01,0xEE,0x10,0x00}, // (125) }
{0x10,0x08,0x10,0x08,0x00}, // (126) ~
{0x03,0x00,0x03,0x00}, // (147) “
{0x03,0x00,0x03,0x00}, // (148) ”
{0x7E,0x53,0x52,0x53,0x42,
{0x38,0x56,0x54,0x4A,0x00}, // (184) ё
{0x7C,0x12,0x11,0x12,0x7C,
{0x7F,0x49,0x49,0x49,0x31,
{0x7F,0x49,0x49,0x49,0x36,
{0x7F,0x01,0x01,0x01,0x01,
{0xC0,0x7F,0x41,0x41,0x7F,
{0x7F,0x49,0x49,0x49,0x41,
{0x73,0x0C,0x7F,0x0C,0x73,
{0x22,0x41,0x49,0x49,0x36,
{0x7F,0x10,0x08,0x04,0x7F,
{0x7E,0x11,0x0A,0x05,0x7E,
{0x7F,0x08,0x08,0x14,0x63,
{0x7C,0x02,0x01,0x02,0x7C,
{0x7F,0x02,0x0C,0x02,0x7F,
{0x7F,0x08,0x08,0x08,0x7F,
{0x3E,0x41,0x41,0x41,0x3E,
{0x7F,0x01,0x01,0x01,0x7F,
{0x7F,0x09,0x09,0x09,0x06,
{0x3E,0x41,0x41,0x41,0x22,
{0x4F,0x50,0x50,0x50,0x3F,
{0x0E,0x11,0x7F,0x11,0x0E,
{0x63,0x14,0x08,0x14,0x63,
{0x7F,0x40,0x40,0x7F,0xC0,
{0x0F,0x10,0x10,0x10,0x7F,
{0x7F,0x40,0x7F,0x40,0x7F,0x00
{0x7F,0x40,0x7F,0x40,0x7F,
{0x01,0x7F,0x48,0x48,0x48,
{0x7F,0x48,0x48,0x48,0x30,
{0x7F,0x48,0x48,0x48,0x30,
{0x22,0x41,0x49,0x49,0x3E,0x00
{0x7F,0x08,0x3E,0x41,0x41,
{0x76,0x09,0x09,0x09,0x7F,
{0x20,0x54,0x54,0x54,0x78,
{0x7C,0x54,0x54,0x20,0x00}, // (225) б
{0x7C,0x54,0x54,0x28,0x00}, // (226) в
{0xC0,0x7C,0x44,0x7C,0xC0,
{0x38,0x54,0x54,0x48,0x00}, // (229) е
{0x44,0x28,0x7C,0x28,0x44,
{0x28,0x44,0x54,0x54,0x28,
{0x7C,0x20,0x10,0x08,0x7C,
{0x7C,0x21,0x12,0x09,0x7C,
{0x7C,0x10,0x28,0x44,0x00}, // (234) к
{0x70,0x08,0x04,0x7C,0x00}, // (235) л
{0x7C,0x08,0x10,0x08,0x7C,
{0x7C,0x10,0x10,0x7C,0x00}, // (237) н
{0x38,0x44,0x44,0x44,0x38,0x00
{0x7C,0x04,0x04,0x7C,0x00}, // (239) п
{0xFC,0x24,0x24,0x18,0x00}, // (240) р
{0x38,0x44,0x44,0x44,0x00}, // (241) с
{0x04,0x04,0x7C,0x04,0x04,
{0x9C,0xA0,0xA0,0x7C,0x00}, // (243) у
{0x08,0x14,0x7C,0x14,0x08,
{0x44,0x28,0x10,0x28,0x44,
{0x7C,0x40,0x40,0x7C,0xC0,
{0x1C,0x20,0x20,0x7C,0x00}, // (247) ч
{0x7C,0x40,0x7C,0x40,0x7C,
{0x7C,0x40,0x7C,0x40,0x7C,
{0x04,0x7C,0x50,0x50,0x20,
{0x7C,0x50,0x50,0x20,0x7C,
{0x7C,0x50,0x50,0x20,0x00}, // (252) ь
{0x28,0x44,0x54,0x54,0x38,
{0x7C,0x10,0x38,0x44,0x38,
{0x68,0x14,0x14,0x7C,0x00}, // (255) я
//============================
void data_tablo(int data)
{PORTA=data;
__delay_cycles(0.000005*CPU_
PORTC |= (1<<PC0); //считываем данные
__delay_cycles(0.000005*CPU_
PORTC &= ~(1<<PC0);
__delay_cycles(0.000005*CPU_
PORTC |= (1<<PC1); //выводим данные
__delay_cycles(0.000005*CPU_
PORTC &= ~(1<<PC1);
__delay_cycles(0.000005*CPU_
}
void symb_data(unsigned char symb)
{int i=0;
do
{data_tablo(Pixel[symb][i]);
__delay_cycles(0.5*CPU_FREQ);
i++;
}
while(Pixel[symb][i]!=0x00)
}
void stroka_symb(unsigned char stroka)
{int i=0;
while(stroka[i]!='\0')
{symb_data(stroka[i]);
i++;
}
void rs_232_in(int k)
{if(k==1){ PORTE |= (1<<PE0);
__delay_cycles(0.0001*CPU_
else {PORTE &= ~(1<<PE0);
__delay_cycles(0.0001*CPU_
}
void main(void)
{ DDRA=0xFF;
DDRC=0xFF;
DDRE=0x01;
int i,j;
unsigned char data[][9];
unsigned char stroka='NOVIKOV IVAN PS-441';
c1:
while(1)
{stroka_symb(stroka);
for(i=size;i>0;i--)
{tablo(0x00);}
PE_S=PORTE&2;
if(PE_S==0){goto c2;}
}
c2: //готовность процессора
{rs_232_in(0); //стартовый бит
rs_232_in(0); // 8 бит команды
rs_232_in(1);
rs_232_in(0);
rs_232_in(1);
rs_232_in(0);
rs_232_in(1);
rs_232_in(0);
rs_232_in(1);
for(i=0;i<8;i++)
{data[1][i]=PE1;
__delay_cycles(0.0001*CPU_
if(data[j]=0x55){goto c4;} //распознание команды
if((data[j]=0xCC)
{j=1;
c3:
for(i=1;i<9;i++)
{data[j][i]=PE1;
__delay_cycles(0.0001*CPU_
if(data[j]!=0xCC) {j++;goto c3;}
else do{data[j-1][9]='/0';stroka[j-
while(j>0)
goto c1;}
c4:
for(i=1;i<9;i++)
{data[j][i]=PE1;
__delay_cycles(0.0001*CPU_
if(data[j]!=0xCC)
{rs_232_in(0); //стартовый бит
rs_232_in(0); // 8 бит команды Xoff- оставновить передачу
rs_232_in(0);
rs_232_in(0);
rs_232_in(1);
rs_232_in(0);
rs_232_in(0);
rs_232_in(1);
rs_232_in(1);
symb_data(data[j]);
rs_232_in(0); //стартовый бит
rs_232_in(0); // 8 бит команды Xon- возобновить передачу передачу
rs_232_in(0);
rs_232_in(0);
rs_232_in(1);
rs_232_in(0);
rs_232_in(0);
rs_232_in(0);
rs_232_in(1);
j++;goto c4;}
else do{data[j]-1[9]='/0';stroka[j-
while(j>0)
goto c1;}
}
Заключение
В курсовом проекте были рассмотрены описание функциональной, принципиальной схемы, программного обеспечения информационного табло с бегущей строкой с интерфейсом RS232, а также приведены принципиальная схема и перечень элементов.
Литература