Gast
#279135
Hallo! Ich möchte mir eine eigene RCU für den VDR (www.cadsoft.de/vdr) mit einem AT90S2313 bauen. Alles funktioniert soweit, nur die Kommunikation zwischen PC und dem µC nicht, da der VDR mit dem IrDA-Protokoll zu arbeiten scheint. Die Befehle werden zwischen PC und µC über dein IrDA-Port übertragen. DAfür besitzt Bascom aber keine Routinen. In C sieht das für einen PIC so aus: // --- IrDA interface: char ch; bool ByteReceived = FALSE; #int_rb void GetIrdaByte(void) { int i; if (port_b.rxd) { ch = 0x00; for (i = 8; i--;) { // detect one bit: delay_us(99); // actually it's 104us, but the rest is loop overhead ch >>= 1; if (!port_b.rxd) ch |= 0x80; // lsb comes in first } delay_us(100); // wait for stop bit if (!port_b.rxd) // must be '1' (i.e. low signal) ByteReceived = TRUE; } } void PutIrdaByte(char ch) { int i; disable_interrupts(RB_CHANGE); port_b.txd = 1; delay_us(20); // start bit port_b.txd = 0; for (i = 8; i--;) { delay_us(77); // actually it's 84us, but the rest is loop overhead port_b.txd = ~ch & 1; delay_us(20); port_b.txd = 0; ch >>= 1; } enable_interrupts(RB_CHANGE); delay_us(124); // stop bit } Kann das jemand auf Bascom übertragen oder mir einen Tipp geben? Ich habe die genaue Spezifikation des Protokolls mit low/high und Zeitangaben nirgends gefunden. Danke für Eure Hilfe im voraus. Grüße Niel