infrared pinball
2021-01-03 20:09:06 UTC
Hello,
i dont know if this is the right place to ask this
I have a Stern MPU in the bench that working perfect and i want with a pic microcontroller to read the bcd signal from mpu J1 connector and pins
25=A,26=B,27=C,28=D
I use port B of pic B0,B1,B2,B3 and set that pins as input.
After the seven flash i set the pinball mpu to first test by ground j3 pin to ground for a moment to set the display to count from 0 to 9.
The problem is that the bcd code i get is only 0000 or 1111
As i know the mpu bcd codes is only from 0 to 9 but the 1111 is 15.
this is the code in mikroc
unsigned int bcd;
ANSELB = 0; // Configure PORTB pins as digital
TRISB0_bit = 1; // input BCD A
TRISB1_bit = 1; // input BCD B
TRISB2_bit = 1; // input BCD C
TRISB3_bit = 1; // input BCD D
do
{
bcd = PORTB & 0b00001111;
// code for display bcd value
Delay_ms(50);
} while(1);
Does anyone knows if that is correct.
Regards
Michael
i dont know if this is the right place to ask this
I have a Stern MPU in the bench that working perfect and i want with a pic microcontroller to read the bcd signal from mpu J1 connector and pins
25=A,26=B,27=C,28=D
I use port B of pic B0,B1,B2,B3 and set that pins as input.
After the seven flash i set the pinball mpu to first test by ground j3 pin to ground for a moment to set the display to count from 0 to 9.
The problem is that the bcd code i get is only 0000 or 1111
As i know the mpu bcd codes is only from 0 to 9 but the 1111 is 15.
this is the code in mikroc
unsigned int bcd;
ANSELB = 0; // Configure PORTB pins as digital
TRISB0_bit = 1; // input BCD A
TRISB1_bit = 1; // input BCD B
TRISB2_bit = 1; // input BCD C
TRISB3_bit = 1; // input BCD D
do
{
bcd = PORTB & 0b00001111;
// code for display bcd value
Delay_ms(50);
} while(1);
Does anyone knows if that is correct.
Regards
Michael