|
Tài trợ cho PIC Vietnam |
Giao tiếp USB, CAN, I2C, SPI, USART... Những giao tiếp được tích hợp trên PIC |
|
Ðiều Chỉnh | Xếp Bài |
|
24-07-2010, 11:17 PM | #1 |
Đệ tử 5 túi
Tham gia ngày: Jan 2008
Bài gửi: 97
: |
Cho tôi hỏi. Trong cấu hình LCD ta chon giao tiếp 16bit,với PMD[0:7]== DB[0:7] và PMA[0:7]==DB[10:17]. Trong hàm GetPixel { GetPixel(SHORT x, SHORT y) } có đoạn này tôi không hiểu:
SetAddress(address.v[2],address.v[1],address.v[0]); // Temporary change wait cycles for reading (250ns = 4 cycles) PMMODE = 0x0210; PMADDR = 0x0001; // First RD cycle to move data from GRAM to Read Data Latch result.v[1] = PMDIN1; // For reading there's 4 wait cycles > 250ns /RD pulse. // Only 4 instruction cycles are needed for PMP. Nop(); Nop(); Nop(); Nop(); // Second RD cycle to move data from GRAM to Read Data Latch result.v[1] = PMDIN1; // For reading there's 4 wait cycles > 250ns /RD pulse. // Only 4 instruction cycles are needed for PMP. Nop(); Nop(); Nop(); Nop(); // First RD cycle to get data from Read Data Latch // Read previous dummy value result.v[1] = PMDIN1; // For reading there's 4 wait cycles > 250ns /RD pulse. // Only 4 instruction cycles are needed for PMP. Nop(); Nop(); Nop(); Nop(); // Second RD cycle to get data from Read Data Latch // Read MSB result.v[1] = PMDIN1; // For reading there's 4 wait cycles > 250ns /RD pulse. // Only 4 instruction cycles are needed for PMP. Nop(); Nop(); Nop(); // Disable LCD (it will not accept extra /RD pulse) CS_LAT_BIT = 1; // Read LSB result.v[0] = PMDIN1; // For reading there's 4 wait cycles > 250ns /RD pulse. // Only 4 instruction cycles are needed for PMP. Nop(); Nop(); Nop(); Nop(); Theo nguyên tắc với cấu hình như thế thì ta không thể nào đọc được 16bit(RGB) trong GRAM được. Và đoạn code của bạn tôi đọc không hiểu, bạn có thể giải thích cho tôi không. Bởi vì theo tôi hiểu khi đọc ta chỉ cần đọc lần đầu là giả còn từ lần kế tiếp là dữ liệu thật, còn trong code của bạn lại có rất nhiều lệnh đọc . Xin cảm ơn |
|
|