Hallo
Entschuldigung, das war natürlich Quatsch gewesen, 5V sind am Pin3.
Meine ISR in "RP6RobotBaseLib.c" sieht so aus:
MitCode:ISR (TIMER2_COMP_vect) { #define Servo on #ifdef Servo extern unsigned char servo_winkel; static unsigned int servo_zyklus=0; if (servo_winkel) { if (servo_zyklus>servo_winkel) PORTC &= ~1; else PORTC |= 1; if (servo_zyklus>servo_winkel) extIntOFF(); else extIntON(); if (servo_zyklus<1440) servo_zyklus++; else servo_zyklus=0; } //else if (0) { #endif static uint8_t ircomm_pulse; if(acs_state < 2) { // If ACS is not active, perform IRCOMM transmissions if(ircomm_pulse) { // Do we have IR pulses to send? if(ircomm_pulse < 60) { // Bi-Phase encoding... if(ircomm_data & 0x4000) // check current bit PORTD ^= (1<<PIND7); // Toggle IRCOMM port else PORTD &= ~(1<<PIND7); // deactivate IRCOMM port } else if(ircomm_data & 0x4000) // The same as above, but the other way round: PORTD &= ~(1<<PIND7); // deactivate IRCOMM port else PORTD ^= (1<<PIND7); // Toggle IRCOMM port ircomm_pulse--; } else if(ircomm_send) { // Do we still have data? PORTD &= ~(1<<PIND7); ircomm_data <<= 1; // Next Bit! ircomm_pulse = 120; ircomm_send--; } else PORTD &= ~(1<<PIND7); // no more pulses - IR LEDs off! } else if(acs_pulse) { // Send ACS IR pulses? if(sysStatACS.channel == ACS_CHANNEL_LEFT) // which channel? PORTB ^= ACS_L; else PORTC ^= ACS_R; acs_pulse--; } else { // no more pulses - IR LEDs off! PORTB |= ACS_L; PORTC |= ACS_R; } #ifdef Servo } #endif }
//else
if (0)
wird die orginale ISR nicht mehr abgearbeitet. Wie geschrieben ist das noch in der Entwicklung und soll nur zeigen, wie man es machen könnte. Möglichkeiten gibt es sicher mehrere, aber ich mag Lösungen, die keinen großen Aufwand bedeuten.
Gruß
mic







Zitieren

Lesezeichen