Pianola

The PIC

 

Why a PIC: to drive the transmitting circuit

In the conditioning circuits suggested by Murata for the transmitter, it is sufficient to build an oscillator by using the integrated circuit HEF 4049B to have continuous transmission at 40 kHz; or to use one NE555, which generates a square wave of an appropriate frequency, put in AND with an oscillation at 40 kHz generated by using an integrated circuit such as 4011B, to transmit pulse packets.

Yet in our case it was necessary to use a PIC to drive the transmitter alternatively at two different frequencies, in the neighborhood of 40 kHz, according to a regular and periodic rythm.

We used for this purpose Microchip PIC18F4550.

Programming the PIC

The PIC program generates the transmission of 105 pulses at 38.2 kHz frequency, followed by the transmission of 20 pulses at 41.5 kHz frequency, for a total time of
105 * 26.178 μs + 20 * 24.096 μs= 3.231 ms.
This PIC output is sent to the transmitter conditioning circuit and allows MA40S4-S to emit ultrasounds precisely according to this scheme.

At the transition from the lowest frequency to the highest, another output of the PIC generates an impulse that is supplied as input to the DSP. This impulse is used to start the timer count and allows to measure the time between the frequency change at the transmitter and the change at the receiver, thus estimating the distance between the two sensors.