Download Linux-driver development for components of the UAV-based
Transcript
I. R EPORT § 3. D EVELOPMENT OF THE L INUX - DRIVER Desired baud rate 50 75 110 134.5 150 300 600 1200 1800 2000 2400 3600 4800 7200 9600 19200 38400 56000 Divisor used to generate 16 clock 2304 1536 1047 857 768 384 192 96 64 58 48 32 24 16 12 6 3 2 Percent error difference between desired and actual 0 0 0.026 0.058 0 0 0 0 0 0.69 0 0 0 0 0 0 0 2.86 Table 3.3: Baud rates of the SC16IS740 using a 1.8432 MHz crystal [SC1, 2011] Parity None Stop bits 1 Flow control None Using the programmable baud rate generator, to obtain the desired baud rate of 57600 Bd for the thermal camera’s port, a divisor with value 2 is required, what results, with a prescaler of 1, a baud rate of 56000 Bd with an error difference of 2,86%, this makes the desired 57600 Bd. Before setting the divisor in the SC16IS740, it is necessary to enable the divisor latch first by setting the bit 7 of the register LCR (0x3) at high logic and then writing the LSB of the divisor at register DLL (0x0) and the MSB at DLH(0x1). As the prescaler stays with its default value 1, it is not necessary to set it. According to Table 3.4, in SC16IS740 the register address for LCR is 0x18, the one for register DLL is 0x00, and the address for DLH is 0x08. #Bit Value DLL 0x0 DLH 0x1 FCR 0x2 LCR 0x3 7 0 0 0 0 6 A3 0 0 0 0 5 A2 0 0 0 0 4 A1 0 0 1 1 3 A0 0 1 0 1 2 CH1 0 0 0 0 1 CH0 0 0 0 0 0 0 0 0 0 0x00 0x08 0x10 0x18 Table 3.4: This table set the register address of the different registers used in this section, according to table 3.2 and the register id. In section 3.1.1 it was established that the address for the SC16IS740 connected to the camera is 1001 001 R/W. As the aim now is to write in the registers and W takes the value 1 in order to Linux-driver development for components of the UAV-based fawn detection system Carmen Eva Ballesteros González 41