int main() { uint32 Count1=0, Count2=0, Count3=0; CyGlobalIntEnable; /* Enable global interrupts. */ /* Place your initialization/startup code here (e.g. MyInst_Start()) */ PWM_1_WritePeriod(1); PWM_1_Start(); isr_1_Start(); Comp_1_Start(); Comp_2_Start(); Counter_1_Start(); Counter_2_Start(); Counter_3_Start(); IIC_4LCD_Char_1_Start(); I2C_1_Start(); IIC_4LCD_Char_1_Position(0,0); IIC_4LCD_Char_1_PrintString("counting"); for(;;) { if (flag == 1) { flag = 0; Count1=Counter_1_ReadCapture(); Count2=Counter_2_ReadCapture(); Count3=Counter_3_ReadCapture(); IIC_4LCD_Char_1_Position(1,0); IIC_4LCD_Char_1_PrintU32Number(Count1); IIC_4LCD_Char_1_Position(2,0); IIC_4LCD_Char_1_PrintU32Number(Count2); IIC_4LCD_Char_1_Position(3,0); IIC_4LCD_Char_1_PrintU32Number(Count3); } } } Experiment The experiment we are going to use the counter for is a simple one in which we use reverse bias LED’s as single photon detectors. We can do a simple random source (another LED) and look at the coincidences as a function of intensity. The LED we use is an 870 nm fast LED from Liteon. This LED is part number 859-HSDL-4250 from Mouser. It costs about $0.30 per LED. The LED is as follows:
int main() { uint32 Count1=0, Count2=0, Count3=0; CyGlobalIntEnable; /* Enable global interrupts. */ /* Place your initialization/startup code here (e.g. MyInst_Start()) */ PWM_1_WritePeriod(1); PWM_1_Start(); isr_1_Start(); Comp_1_Start(); Comp_2_Start(); Counter_1_Start(); Counter_2_Start(); Counter_3_Start(); IIC_4LCD_Char_1_Start(); I2C_1_Start(); IIC_4LCD_Char_1_Position(0,0); IIC_4LCD_Char_1_PrintString("counting"); for(;;) { if (flag == 1) { flag = 0; Count1=Counter_1_ReadCapture(); Count2=Counter_2_ReadCapture(); Count3=Counter_3_ReadCapture(); IIC_4LCD_Char_1_Position(1,0); IIC_4LCD_Char_1_PrintU32Number(Count1); IIC_4LCD_Char_1_Position(2,0); IIC_4LCD_Char_1_PrintU32Number(Count2); IIC_4LCD_Char_1_Position(3,0); IIC_4LCD_Char_1_PrintU32Number(Count3); } } } Experiment The experiment we are going to use the counter for is a simple one in which we use reverse bias LED’s as single photon detectors. We can do a simple random source (another LED) and look at the coincidences as a function of intensity. The LED we use is an 870 nm fast LED from Liteon. This LED is part number 859-HSDL-4250 from Mouser. It costs about $0.30 per LED. The LED is as follows:
workshopdirections.docx