Hallo,
ich benutze einen ATmega16 auf einem Olimex
Board(http://www.olimex.com/dev/avr-p40-usb-8535.html) und hab das UART
Beispiel auf meinem ATmega, wenn ich allerdings per D2XX Zeichen an den
chip sende kommt immer nur 0 zurück. die programmierung die zeichen
sendet und ausliest ist so:
1 | FT_HANDLE ftHandle;
|
2 | FT_STATUS ftStatus;
|
3 | ftStatus = FT_Open(0, &ftHandle);
|
4 | if (ftStatus != 0) {
|
5 | cout << ftStatus << endl;
|
6 | FT_Close(ftHandle);
|
7 | return 1;
|
8 | }
|
9 |
|
10 | FT_SetBaudRate(ftHandle, 9600);
|
11 | FT_SetDataCharacteristics(ftHandle, FT_BITS_8, FT_STOP_BITS_1,FT_PARITY_NONE);
|
12 | FT_SetFlowControl(ftHandle, FT_FLOW_NONE, 0, 0);
|
13 | FT_SetRts(ftHandle);
|
14 |
|
15 | char a = 42;
|
16 | char b;
|
17 |
|
18 | ULONG bytesWritten;
|
19 | ULONG bytesRet;
|
20 |
|
21 | cout << "Sending:" <<(int)a << endl;
|
22 | FT_Write(ftHandle, &a, 1, &bytesWritten);
|
23 | FT_Read(ftHandle, &b, 1, &bytesRet);
|
24 | cout << "Getting:" <<(int)b << endl;
|
25 |
|
26 | FT_Close(ftHandle);
|
hab ich irgendwelche Variablen falsch gesetzt oder liegt das Problem wo
anders?