410 likes | 885 Views
Hardware Kentaro Yamamoto Daniel Fischer. Software Quy Nguyen Cris Thompson Tam Nguyen Mai Loan Mutombo Simphorien. NIDA TEST CONSOLE PROJECT. NIDA TEST Console.
E N D
Hardware Kentaro Yamamoto Daniel Fischer Software Quy Nguyen Cris Thompson Tam Nguyen Mai Loan Mutombo Simphorien NIDA TEST CONSOLE PROJECT
NIDA TEST Console Project objective: Minimize operator interaction by using a visual basic program to guide the operator through basic electronic circuit analysis. Implementation: Design an interface circuit to recognize ASCII characters received from visual basic program to mimic the NIDA console manual keyboard commands. These instructions will simulate program instructions previously generated by manual keyboard commands.
Specific Approaches NIDA console keyboard operation Hardware configuration Software application Lab View/Visual Basic
DLAB • DLAB: Divisor Latch Access Bit • The UART (Universal Asynchronous Receiver/ Transmitter) have crystal oscillator produces around 1.8432 MHz • The UART incorporates by 16 counter. Maximum BPS: 115200 Hz For example, we want to communicate at 2400 BPS
DLAB (con’t) • The divisor 48 is stored in the two registers controlled by the “Divisor Latch Access Bit”. • The divisor can be any number which can be stored in 16 bits ( 0 to 65535)
Interrupt Enable Register • D0 (RxRDY): Received data available • D1(TBE): Transmitter Buffer empty • D2(Error): Receiver Line Status • D3 (IN): MODEM status
Programming • Microsoft Visual C++ support function: • Inp(port#, byte) to read byte from port • Outp(port#, byte) to send byte to port
Com2 program using Polling • #define PORT2 0x2F8 • When polling, need to turn off the interrupt • Outp(PORT2 + 1, 0); • Set line control register • Outp(PORT2, 0x80); • Set baud rate • Outp(PORT2 + 0, 0x30); • Outp(PORT2+ 1, 0x00); • Communicate with 8 bit, no parity, 1 stop bit • Outp(PORT2 + 3, 0x03);
Specific Functionality Schematic Diagram of Interface box
Wiring interconnect diagram controller Internal Connector Relay Driver Relay External Connector NIDA Console pin # pin # in/out pin # NO/C/NC J1 or J2 /pin # J9/pin # NA NA NA NA J2/5 ground NA 14 NA NA NA J2/3 (Tx) NA 15 NA NA NA J2/2 (Rx) NA 16 19 7/12 energize low NA NA 17 20 5/14 energize low NA NA 18 21 8/11 energize low NA NA 19 22 6/13 energize low NA NA 20 23 NA NA J1/25 KBI uc15 pin 6 21 24 NA NA J1/13 PDELAY J9A/5 22 9 NA NO J1/14 J9/8 23 10 NA NO J1/15 J9/7 24 11 NA NO J1/16 J9/6 25 12 NA NO J1/17 J9/5 26 13 NA NO J1/18 J9/4 27 14 NA NO J1/19 J9/3 28 15 NA NO J1/20 J9/2 29 16 NA NO J1/21 J9/1 NA NA NA NC J1/14 J9/8 keyboard output NA NA NA NC J1/15 J9/7 keyboard output NA NA NA NC J1/16 J9/6 keyboard output NA NA NA NC J1/17 J9/5 keyboard output NA NA NA NC J1/18 J9/4 keyboard output NA NA NA NC J1/19 J9/3 keyboard output NA NA NA NC J1/20 J9/2 keyboard output NA NA NA NC J1/21 J9/1 keyboard output NA NA NA NC J1/1 J9/8 controller input NA NA NA NC J1/2 J9/7 controller input NA NA NA NC J1/3 J9/6 controller input NA NA NA NC J1/4 J9/5 controller input NA NA NA NC J1/5 J9/4 controller input NA NA NA NC J1/6 J9/3 controller input NA NA NA NC J1/7 J9/2 controller input NA NA NA NC J1/8 J9/1 controller input
Hardware constructionParts list:Qty-Nomenclature1 -- Futurelec development board, AT90S8535 micro- controller4 -- AGN2004H NAIS mfg company DPDT relays1 -- ULN2803 Relay driver1 -- 18 pin dip socket1 -- Cable 36 pin (floppy ribbon cable)3 -- D-Sub 9 pin connectors 1 male two female with associated hoods4 -- D-Sub 25 pin connectors two male, two female with associated hoods1 -- plastic experiment box
Microcontroller Programming(Atmel AT90S8535) Objective: Mimicking the keyboard to be able to virtually push any button of the console according to commands from a PC through RS232C interface. Status: Programming firmware (in assembly language) is almost finished. Size of the program is about 700 lines. This will be reduced after further optimization.
Development Environment • Atmel AVRStudio - Original Development Environment provided at no charge from Atmel (http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725) - Provides a sophisticated simulator of many kinds of Atmel AVR microcontrollers
Programmer • Program is written on Flash ROM in the microcontroller • Handmade programmer was used • PonyProg 2000 was used to send firmware to the programmer (http://www.lancos.com)
NRNC codes • In order to emulate the keyboard, program must know where the corresponding key is located in terms of row and column. Key chart
NRNC codes contain row number (NR), column number (NC), and a shift flag. Corresponding NRNC code is stored in the program memory at address of Offset + ASCII Code.
Wave generation The program controls waveforms of rows according to NRNC codes. The program lowers the row that a key belongs to. The program send various length of pulse to the selected row according to the column number.