H
Hasher
Guest
Saya bekerja dengan PIC18F2420 (8 Mhz & HS-PLL) & Hi-Tech PICC-18 compiler.
Aku sedang melakukan proyek untuk menerima karakter serial data & tampilan karakter-karakter di Sytem PAL TV.
Untuk melihat data karakter yang disimpan dalam ROM PIC sempurna aku o / p di TV.
Untuk komunikasi serial dengan PC saya punya bagus o / p pada hyper-terminal
NAMUN
ketika saya mencoba untuk menggabungkan dua bagian aku tak punya kesalahan tapi aku tak punya o / p di TV.
Apakah karena aku sedang memindahkan data pada port C dan pada saat yang sama Saya menggunakan TX & RC pada pin 6 & 7 di port C?
apa pendapatmu?
Catatan: beberapa kode tidak ada di sini.
//------------------------------------------------ ------
/ / PORT B Setup
//------------------------------------------------ ------
TRISB = 0; / / configure PortB sebagai output
PORTB = 0x00;
//------------------------------------------------ ------
/ / PORT C Setup
//------------------------------------------------ ------
TRISC = 0; / / configure PortC sebagai output
PORTC = 0x00;
//------------------------------------------------ ------
/ / Shift karakter untuk o / p di TV
//------------------------------------------------ ------
void chrShift (unsigned char chr)
(
PORTC = chr;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
)
//------------------------------------------------ ------
void drawChar (int baris)
(
if (lineCount == 5)
(
if (RCIF)
(
serData = RCREG;
)
if (serData> = 65 & & serData <= 90)
(
chrOrder [ptr] = serData - 65;
)
else if (serData> = 97 & & serData <= 122)
(
chrOrder [ptr] = serData - 97 26;
)
else if (serData> = 48 & & serData <= 57)
(
chrOrder [ptr] = serData - 48 52;
)
ptr ;
chrOrder [ptr] = -1;
if (ptr == 9) ptr = 0;
j = 0;
while (chrOrder [j]! = -1)
(
k = chrOrder [j];
screen1 [j] = chrTable [k] [0];
screen2 [j] = chrTable [k] [1];
screen3 [j] = chrTable [k] [2];
screen4 [j] = chrTable [k] [3];
screen5 [j] = chrTable [k] [4];
screen6 [j] = chrTable [k] [5];
j ;
)
)if (lineCount baris == 2) / / line1
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 4) / / line2
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 6) / / line3
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris == lineCount
<img src="http://www.edaboard.com/images/smiles/icon_cool.gif" alt="Dingin" border="0" />
/ / line4
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 10) / / line5
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 12) / / line6
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
) / / end drawChar
//************************************************ *************************************
/ / * Main
//************************************************ *************************************
main (void)
(
PAL_Init ();
while (1)
(
if (HSync == 1 & & VSync == 0)
(
drawChar (9
<img src="http://www.edaboard.com/images/smiles/icon_cool.gif" alt="Dingin" border="0" />
;
HSync = 0;
) / / end if
) / / end sementara
) / / end main
Aku sedang melakukan proyek untuk menerima karakter serial data & tampilan karakter-karakter di Sytem PAL TV.
Untuk melihat data karakter yang disimpan dalam ROM PIC sempurna aku o / p di TV.
Untuk komunikasi serial dengan PC saya punya bagus o / p pada hyper-terminal
NAMUN
ketika saya mencoba untuk menggabungkan dua bagian aku tak punya kesalahan tapi aku tak punya o / p di TV.
Apakah karena aku sedang memindahkan data pada port C dan pada saat yang sama Saya menggunakan TX & RC pada pin 6 & 7 di port C?
apa pendapatmu?
Catatan: beberapa kode tidak ada di sini.
//------------------------------------------------ ------
/ / PORT B Setup
//------------------------------------------------ ------
TRISB = 0; / / configure PortB sebagai output
PORTB = 0x00;
//------------------------------------------------ ------
/ / PORT C Setup
//------------------------------------------------ ------
TRISC = 0; / / configure PortC sebagai output
PORTC = 0x00;
//------------------------------------------------ ------
/ / Shift karakter untuk o / p di TV
//------------------------------------------------ ------
void chrShift (unsigned char chr)
(
PORTC = chr;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
PORTC>> = 1;
)
//------------------------------------------------ ------
void drawChar (int baris)
(
if (lineCount == 5)
(
if (RCIF)
(
serData = RCREG;
)
if (serData> = 65 & & serData <= 90)
(
chrOrder [ptr] = serData - 65;
)
else if (serData> = 97 & & serData <= 122)
(
chrOrder [ptr] = serData - 97 26;
)
else if (serData> = 48 & & serData <= 57)
(
chrOrder [ptr] = serData - 48 52;
)
ptr ;
chrOrder [ptr] = -1;
if (ptr == 9) ptr = 0;
j = 0;
while (chrOrder [j]! = -1)
(
k = chrOrder [j];
screen1 [j] = chrTable [k] [0];
screen2 [j] = chrTable [k] [1];
screen3 [j] = chrTable [k] [2];
screen4 [j] = chrTable [k] [3];
screen5 [j] = chrTable [k] [4];
screen6 [j] = chrTable [k] [5];
j ;
)
)if (lineCount baris == 2) / / line1
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
chrShift (screen1 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 4) / / line2
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
chrShift (screen2 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 6) / / line3
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
chrShift (screen3 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris == lineCount
<img src="http://www.edaboard.com/images/smiles/icon_cool.gif" alt="Dingin" border="0" />
/ / line4
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
chrShift (screen4 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 10) / / line5
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
chrShift (screen5 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
if (baris lineCount == 12) / / line6
(
/ / # asm delay10 ();
/ / # endasm
delay20 ();
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
chrShift (screen6 [i ]);
PORTC = 0;
i = 0;
HSync = 0;
)
) / / end drawChar
//************************************************ *************************************
/ / * Main
//************************************************ *************************************
main (void)
(
PAL_Init ();
while (1)
(
if (HSync == 1 & & VSync == 0)
(
drawChar (9
<img src="http://www.edaboard.com/images/smiles/icon_cool.gif" alt="Dingin" border="0" />
;
HSync = 0;
) / / end if
) / / end sementara
) / / end main