Other Parts Discussed in Thread: HALCOGEN,
Tool/software: Code Composer Studio
Hello,
I am using CCS 9.0.0 and Halcogen 04.07.01 to start off..
I am trying to capture two different signals on two seperate HET-Pins, but i can only capture Pin0 with cap0 and not Pin2 with cap1.
These are my Halcogen settings for the HET:
The other capture are set to low level and no other pin uses the HR share.
And here is my code:
int main(void)
{
/* USER CODE BEGIN (3) */
uint8 NumberOf_Chars; //Anzahl der Chars für die SCI-Übermittlung
hetSIGNAL_t signal,signal2;
uint32 duty = 0;
float period = 0.0;
float signal_frequency=0.0;
uint32 duty2 = 0;
float period2 = 0.0;
float signal_frequency2=0.0;
sciInit();
hetInit();
while(1)
{
capGetSignal(hetRAM1, cap0, &signal);
capGetSignal(hetRAM1, cap1, &signal2);
duty = signal.duty;
period = signal.period;
signal_frequency = 1000000/period;
duty2 = signal2.duty;
period2 = signal2.period;
signal_frequency2 = 1000000/period2;
NumberOf_Chars = ltoa(duty, (char*) period_inChars); //Pin-Nummer in Chars umwandeln
sciSend(scilinREG, NumberOf_Chars, period_inChars); //AD-Pin Nummer ausgeben
sciSend(scilinREG, 2, (unsigned char *) ", ");
NumberOf_Chars = ltoa(signal_frequency, (char*) period_inChars); //Pin-Nummer in Chars umwandeln
sciSend(scilinREG, NumberOf_Chars, period_inChars); //AD-Pin Nummer ausgeben
sciSend(scilinREG, 2, (unsigned char *) "\r\n");
NumberOf_Chars = ltoa(duty2, (char*) period_inChars); //Pin-Nummer in Chars umwandeln
sciSend(scilinREG, NumberOf_Chars, period_inChars); //AD-Pin Nummer ausgeben
sciSend(scilinREG, 2, (unsigned char *) ", ");
NumberOf_Chars = ltoa(signal_frequency2, (char*) period_inChars); //Pin-Nummer in Chars umwandeln
sciSend(scilinREG, NumberOf_Chars, period_inChars); //AD-Pin Nummer ausgeben
sciSend(scilinREG, 2, (unsigned char *) "\r\n");
_delay_cycles(16000000-1); //delay
}
/* USER CODE END */
return 0;
}
The results that I get:
duty1: correct
frequency1: correct
duty2 = 0
frequency2 = frequency1
can you solve my problem?
Best Regards
Christian