내가 직접이 기법을 사용하여 PC 병렬 포트에 연결된 pc1602f의 파워 팁을 사용하고 있습니다 : http://www.beyondlogic.org/parlcd/parlcd.htm프로그래밍 RS232 (리눅스)
모든 아니라 LCD 에너지를 공급하고 검은 색 블록으로 나에게 앞줄 같이, 그때까지는 괜찮지 만 지금은 병렬 포트를 통해 정보를 보내고 싶습니다. 당신이 페이지를 보면
당신이 액정 화면에 정보를 보낼 수있는 소스이지만, 윈도우 라이브러리를 사용하는 것을 볼 수 있습니다 : 응 :
내가 내 코드는 리눅스되기 위해 시도 둡니다.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#define PORTADDRESS 0x3f8
#define DATA PORTADDRESS+0
#define STATUS PORTADDRESS+1
#define CONTROL PORTADDRESS+2
main(int argc, char **argv)
{char string[] = {"Testing 1,2,3"};
int count;
int len;
char init[10];
init[0] = 0x0F; /* Init Display */
init[1] = 0x01; /* Clear Display */
init[2] = 0x38; /* Dual Line/8 Bits */
if (ioperm(PORTADDRESS,1,1))
fprintf(stderr, "No se puede acceder al: %x\n", PORTADDRESS), exit(1);
outb(CONTROL, inb(CONTROL) & 0xDF);
outb(CONTROL, inb(CONTROL) & 0x08);
for (count = 0; count <= 2; count++)
{
outb(DATA, init[count]);
outb(CONTROL,inb(CONTROL) | 0x01);
sleep(20);
outb(CONTROL,inb(CONTROL) & 0xFE);
sleep(20);
}
outb(CONTROL, inb(CONTROL) & 0xF7);
len = strlen(string);
for (count = 0; count < len; count++)
{
outb(DATA, string[count]);
outb(CONTROL,inb(CONTROL) | 0x01);
sleep(2);
outb(CONTROL,inb(CONTROL) & 0xFE);
sleep(2);
}
}
완벽하게 컴파일하지만 루트로 그것을 시도하고 실행할 때 내가이 찾을 dmesg를 보면 나에게
media/E80C-30D5/LCD/build #./lcd
Segmentation fault (`core 'generated)
[email protected]: /media/E80C-30D5/LCD/build #
가 발생합니다.
나는 * 가[3176.691837] lcd [3867] general protection ip: 400cb4 sp: 7fff887ad290 error: 0 in lcd [+2000 400 000][email protected]:/media/E80C-30D5/LCD/build #
root @ ubuntu:/media/E80C-30D5/LCD/build # dmesg | grep ttyS
[2.335717] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[2.335817] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[2.336100] 00:0 b: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[2.336207] 00:0 c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
root @ ubuntu:/media/E80C-30D5/LCD/build #
그것을 실행하지 마세요, 당신은 제발 도움이 될 수 있습니다 터미날 dmesg를 로그를 넣어?
이 모듈은 작동하도록 모듈을 디자인하는 데 필요합니다. 항구의 다양한 부분을 완벽하게 활성화합니까? – Backglass
누군가가 이미 드라이버를 작성했습니다. http://lcd-linux.sourceforge.net/가 좋은지보십시오. 또한 내 제안이 문제를 해결합니까? – Artelius