Home
BirdBox-A™ Technical Manual
Contents
1. Var ml SCC691 MR1 m2 SCC691 MR2 b baud rate Table below for 8MHz Clock ibuf pointer to input buffer array isiz input buffer size obuf pointer to output buffer array osiz ouput buffer size cC pointer to serial port structure See AE H for COM structure ml bit Definition 7 RxRTS receiver request to send control O no l yes 6 RxINT receiver interrupt select O RxRDY 1 FIFO FULL g Error Mode Error Mode Select 0 Char 1 Block 4 3 Parity Mode 00 with Ol Force 10 No 11 Special 2 Parity Type O Even 1 Odd 1 0 bits 00 5 01 6 10 7 11 8 m2 bit Definition 7 6 Modes 00 Normal O1 Echo 10 Local loop 11 Remote loop 5 TxRTS Transmit RTS control O No 1 Yes 4 CTS Enable Tx O No 1 Yes 3 0 Stop bit 0111 1 1111 2 b baud 8MHz scc h sccl h BirdBox A Appendix E Software Glossary 110 150 300 600 1200 2400 4800 9600 19200 10 31250 11 62500 12 125000 13 250000 CO SI OD OB GW NM A ie Reference s0_echo c s1_echo c s1_0 c int putserO unsigned char ch COM c ser0 h int putserl unsigned char ch COM c serl h int putser_scc unsigned char ch COM c scc h int putser_sccl unsigned char ch COM c sccl h Output 1 character to serial port Character will be sent to serial output with interrupt isr Var ch character to output c pointer to serial port structure Reference s
2. 3 620 3 720 Figure 1 5 Side view A of the enclosure F 5 BirdBox A Appendix F Enclosure Side view B dimensions VIEW B Figure 1 6 Side view B of the enclosure F 6 Appendix G RJ11 DB9 Cable BirdBox A Appendix G RJ11 DB9 Cable RED edge of serial cable W white B black R red G green Y yellow blue YGRB Blue wW 398us 8661 p snbny HOS NVH VEE a esua A Ed e 1SaqQUA Uaunoo aztT nas QUAN 2 alezts E oza EL a ie Lay Va TAN A a E A SAS TY ROGUA ES A zta DOR STE Ocea BOE eT EMV eT S TITL 25137 7 S S zaxi bor L NM PETER ASS ZINIS L ya NUaL 31S le ene dd Seo ENN Soe N Toy NMA EF MAT SEPT ANI BATEAS zgezsan si DOT StI E DIT
3. 1 4 2 Step 2 STEP 2 Standalone Field Test Set the jumper on J2 pins 38 40 on the BirdBox A Figure 1 4 At power on or reset if J2 pin 38 P4 is low the CPU will run the code that resides in the battery backed SRAM If a jumper is on J2 pins 38 40 at power on or reset the BirdBox A will operate in Step Two mode If the jumper is off J2 pins 38 40 at power on or reset the BirdBox A will operate in Step One mode The status of J2 pin 38 signal P4 of the Am188ES is only checked at power on or at reset Ha O Step Two Jumper ron vi J2 pins 38 40 3 y paaa Figure 1 4 Location of Step Two jumper on the BirdBox A 1 4 3 Step 3 STEP 3 Generate the application BIN or HEX file make production ROMs or download your program to FLASH via ACTF If you are happy with your Step Two test you can go back to your PC to generate your application ROM to replace the DEBUG ROM TDREM_AE You need to change DEBUG 1 to DEBUG 0 in the makefile You need to have the DV Kit to complete Step Three Please refer to the Tutorial of the Technical Manual of the EV DV Kit for further details on programming the BirdBox A 1 5 Minimum Requiremen
4. The DAC is installed in U11 on the BirdBox A and the outputs are routed to J6 pin 20 for DAC channel A and J6 pin 19 for DAC channel B The DAC uses P12 as CLK P26 as DI and P29 as LD CS Please refer to the LT1446 technical data sheets from Linear Technology 1 408 432 1900 for further information See also the sample program ae_da c in the samples ae directory 3 5 7 High Voltage Current Drivers The high voltage drivers on the BirdBox A can be configured for either sourcing or sinking operation Two different components are used to provide these operations and must be specified when ordering The sinking driver ULN2003 provides seven channels of sinking output while the UDS2982 provides eight channels of sourcing output Installed by default the sinking driver ULN2003 U15 has high voltage high current Darlington transistor arrays consisting of seven silicon NPN Darlington pairs on a common monolithic substrate All channels feature open collector outputs for sinking 350 mA at 50V and integral protection diodes for driving inductive loads Peak inrush currents of up to 600 mA sinking are allowed These outputs may be paralleled to achieve high load capability although each driver has a maximum continuous collector current rating of 350 mA at 50V The maximum power dissipation allowed is 2 20 W per chip at 25 degrees Celsius C In this configuration pin 9 must be connected to ground for the current to return This can be done b
5. This function can be used to retrieve data from components in I O space You will find that most hardware options added to TERN controllers are mapped into I O space since memory space is valuable and is reserved for uses related to the code and data Using I O mappings the address is output over the address bus and the returned 16 or 8 bit value is the return value For a further discussion of I O and memory mappings please refer to the Hardware chapter of this technical manual 4 1 AE LIB BB LIB AE LIB is a C library for basic A Engine A Engine based controller operations It includes the following modules AE OBJ SERO OBJ SER1 0BJ SCC OBJ and AEEE OBJ You need to link AE LIB in your applications and include the corresponding header files The following is a list of the header files PPI timer counter ADC DAC RTC Watchdog Internal serial port 0 Internal serial port 1 External UART SCC2691 on board EEPROM BB LIB is a library for BirdBox A specific functions This library must be linked in to your applications as well It includes drivers for various input output functions BB H High voltage driver SCC1 H Special BB A SCC2691 U02 4 2 BirdBox A Chapter 4 Software 4 2 Functions in AE OBJ 4 2 1 BirdBox A Initialization ae_init This function should be called at the beginning of every program running on A Engine based core controllers It provides default initialization and configuration of the vario
6. void outportb int portid int value Writes 8 bit value to I O address portid Var portid I O address value 8 bit value Reference ae_ppi c int inport int portid Reads from an I O address portid Returns 16 bit value Var portid I O address Reference ae_ppi c dos h dos h E 3 Appendix E Software Glossary BirdBox A int inportb int portid dos h Reads from an I O address portid Returns 8 bit value Var portid I O address Reference ae_ppi c int ee_wr int addr unsigned char dat aeee h Writes to the serial EEPROM Var addr EEPROM data address dat data Reference ae_ee c int ee_rd int addr aeee h Reads from the serial EEPROM Returns 8 bit data Var addr EEPROM data address Reference ae_ee c int ae_ad12 unsigned char c ae h Reads from the 11 channel 12 bit ADC Returns 12 bit AD data of the previous channel In order to operate ADC 120 121 122 must be output and P11 must be input P11 is shared by RTC EE It must left high at power on reset Unipolar Vref 0x000 Vref Oxfff Use 1 wait state for Memory and I O without RDY lt 300 us execution time Use 0 wait state for Memory and I O with VEPO10 lt 270 us execution time Var c ADC channel c 0 a input ch 0 10 c b input ch vref vref 2 c C input ch vref c d input ch vref c e software power down Reference ae_ad12 c int ae_da
7. HLDA HOLD RD 5V power supply Ground Am188ES pin 16 system clock 40 MHz 25 ns as default data receive of UART SCC2691 U8 data transmit of UART SCC2691 U8 Multi Purpose Output of SCC2691 U8 Multi Purpose Input of SCC2691 U8 real time clock output of RTC72423 U4 open collector Am188ES 8 bit external data lines Am188ES address lines Power failure input signal of MAX691 reset signal active low reset signal active high PCSO Am188ES pin 66 Am188ES pin 44 Am188ES pin 45 Am188ES pin 5 Am188ES pin 6 3 16 BirdBox A Chapter 3 Hardware VBAT 3V lithium battery positive pin VRAM Power for backing up SRAM and RTC Signal definitions for J2 VCC 5V power supply lt 200 mA GND Ground Pxx Am188ES PIO pins WR Am188ES pin 5 TxDO Am188ES pin 2 transmit data of serial channel 0 RxDO Am188ES pin 1 receive data of serial channel 0 TxD1 Am188ES pin 98 transmit data of serial channel 1 RxD1 Am188ES pin 99 receive data of serial channel 1 CTSO Am188ES pin 100 Clear to Send signal for SERO CTS1 Am188ES pin 63 Clear to Send signal for SER1 RTSO Am188ES pin 3 Request to Send signal for SERO RTS1 Am188ES pin 62 Request to Send signal for SER1 AINTO 4 Schmitt trigger inputs 3 6 2 Jumpers The following table lists the jumpers and connectors on the BirdBox A and some possible applications Name Size Function Possible Configuration
8. The user can call any of the interrupt init functions listed below for this purpose The first argument indicates whether the particular interrupt should be enabled and the second is a function pointer to an appropriate interrupt service routine that should be used to handle the interrupt The TERN libraries will set up the interrupt vectors correctly for the specified external interrupt line At the end of interrupt handlers the appropriate in service bit for the IR signal currently being handled must be cleared This can be done using the Nonspecific EOI command At initialization time interrupt priority was placed in Fully Nested mode This means the current highest priority interrupt will be handled first and a higher priority interrupt will interrupt any current interrupt handlers So if the user chooses to clear the in service bit for the interrupt currently being handled the interrupt service routine just needs to issue the nonspecific EOI command to clear the current highest priority IR To send the nonspecific EOI command you need to write the EOI register word with 0x8000 outport 0xff22 0x8000 void intx_init Arguments unsigned char i void interrupt far intx_isr Return value none These functions can be used to initialize any one of the external interrupt channels for pin locations and other physical hardware details see the Hardware chapter The first argument i indicates whether this 4 4 BirdBox A Chapt
9. none Turns the on board LED on or off according to the value of ledd Real Time Clock The real time clock can be used to keep track of real time Backed up by a lithium coin battery the real time clock can be accessed and programmed using two interface functions The real time clock only allows storage of two digits of the year code as reflected below As a result application developers should be careful to account for a roll over in digits in the year 2000 One solution might be to store an offset value in non volatile storage such as the EEPROM There is a common data structure used to access and use both interfaces typedef struct nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig TIM int rtc_rd Arguments TIM r Return value int error_code 4 8 ned ned ned ned ned ned ned ned ned ned ned ned ned Cc 0 500 4 0 0 0 0 0O 0 00 nar nar nar nar nar nar nar nar nar nar nar nar nar 1 10 minl min10 hourl dayl day10 monl mon10 yearl One second digit Ten second digit One minute digit Ten minute digit One hour digit hour10 Ten hour digit One day digit Ten day digit One month digit Ten month digit One year digit yearl0 Ten year digit wk Day of the week BirdBox A Chapter 4 Software This function places the current value of the real time clock within the argument r structure The
10. 0 through 6 and NMI Non Maskable Interrupt Var i 1 enable 0 disable int _isr pointer to interrupt service Reference intx c void s0_init unsigned char b unsigned char ibuf int isiz ser0 h unsigned char obuf int osiz COM c void void s1_init unsigned char b unsigned char ibuf int isiz serl h unsigned char obuf int osiz COM c void Serial port 0 1 initialization Var b baud rate Table below for 40MHz and 20MHz Clocks E 7 Appendix E Software Glossary ibuf pointer to input buffer array isiz input buffer size obuf pointer to output buffer array osiz ouput buffer size cC pointer to serial port structure structure b baud 40MHz baud 20MHz 1 110 55 2 150 110 2 300 150 4 600 300 5 1200 600 6 2400 1200 7 4800 2400 8 9600 4800 9 19200 9600 10 38400 19200 11 57600 38400 12 115200 57600 13 23400 115200 14 460800 23400 15 921600 460800 Reference s0_echo c s1_echo c s1_0 c BirdBox A See AE H for COM void scc_init unsigned char m1 unsigned char m2 unsigned char b unsigned char ibuf int isiz unsigned char obuf int osiz COM c void sccl_init unsigned char m1 unsigned char m2 unsigned char b unsigned char ibuf int isiz unsigned char obuf int osiz COM c SCC2691 UART initializations
11. 2 6 Power save Mode ceeeeeeeeeeee 3 3 3 3 Am188ES PIO lines ocoooccconcconncnonnccnnns 3 4 3 4 I O Mapped Devices cccooccconcconncnonnccnnns 3 6 3 4 1 VO Space issen oep i 3 6 3 4 2 Programmable Peripheral Interface PPI S2CO55A coconooconocccnononannnnnnoso 3 7 3 4 3 Real time Clock RTC72423 3 8 3 4 4 UART SCC2691 Serial Ports 3 8 3 4 5 Parallel Port 2 0 eee eeeeeeeeeeeeeeee 3 9 3 4 6 SER1 MODEM Interface 3 9 3 5 Other Devices cocococnooccnonccconccinnnconnnnnn 3 10 3 5 1 Interrupt Driven Keypad 3 10 3 5 2 LCD Display oooonoccccocccconcninnnccnnns 3 11 3 5 3 On board Supervisor with Watchdog Table of Contents Chapter page 3 5 4 EEPROM cocococccconcononnnconcninnnninnncnnn 3 11 3 5 5 12 bit ADC TLC2543 oe 3 12 3 5 6 Dual 12 bit DAC eee 3 12 3 5 7 High Voltage Current Drivers 3 13 3 5 8 Switching Power Supply 3 14 3 5 9 LED Beeper ririri isisa 3 15 3 6 Headers and Connectors coooocccocccnonncnnne 3 15 3 6 1 Expansion Headers J1 and J2 3 15 3 6 2 JUMP Soon 3 17 A Software cccvisicavisdi re E 4 1 4 1 AE LIB BB LIB 00 eee eeeeeseeneeenees 4 2 4 2 Functions in AE OBJ sece 4 3 4 2 1 BirdBox A Initialization 4 3 4 2 2 External Interrupt Initialization 4 4 4 2 3 T O Initialization oes 4 5 4 2 4 Timer Units ooeec 4 6 4 2 5 Analog to Digital Conversion 4 7 4 2 6 Digital to Analo
12. 7 5 from the top of the FIFO together with bits 4 0 These bits are cleared by a reset error status command In character mode they are reset when the corresponding data character is read from the FIFO B 2 Appendix B UART SCC2691 BirdBox A ACR Auxiliary Control Register BRG Set Counter Timer Mode and Source MPO Pin Function Select Select 0 Baud 0 counter MPI pin 0 on 0 RTSN rate set 1 1 counter MPI pin divided by power 1 C TO see CSR 16 down 2 TxC 1x bit format 2 counter TxC 1x clock of the active 3 TxC 16x transmitter 1 off 4 RxC 1x 1 Baud 3 counter crystal or external normal 5 RxC 16x rate set 2 clock x1 CLK 6 TxRDY see CSR 4 timer MPI pin 7 RxRDY FFULL bit format 5 timer MPI pin divided by 16 6 timer crystal or external clock x1 CLK 7 timer crystal or external clock x1 CLK divided by 16 ISR Interrupt Status Register MPI Pin Not Used Counter Delta RxRDY TxEMT TxRDY Current Ready Break FFULL State 0 low 0 no 0 no 0 no 0 no 0 no 1 high l yes l yes l yes l yes l yes IMR Interrupt Mask Register MPI MPI Counter Delta RxRDY TxEMT TxRDY Change Level S Ready Break FFULL Interrupt Interrupt Interrupt Interrupt Interrupt Interrupt Interrupt CTUR Counter Timer Upper Register CTLR Counter Timer Lower Register CTI CIT 6 CT 5 CIT IA CTB CT 2 OTH C TIO BirdBox A Appendix C RTC72421 72423 Appendix C
13. 82C55 with outportb 0x320 dat The call to inportb 0x320 will activate PCS3 as well as putting the address 0x320 over the address bus The decoder will select the 82C55 based on address lines A5 7 and the data bus will be used to read the appropriate data from the off board component 3 4 2 Programmable Peripheral Interface PPI 82C55A The PPI 82C55 is a low power CMOS programmable parallel interface unit for use in microcomputer systems It provides 24 I O pins that may be individually programmed in two groups of 12 and used in three major modes of operation 7 6 5 4 3 2 1 0 Port 2 0 Output Lower 1 Input Port 1 0 Output 1 Input Mode 0 Mode 0 1 Mode 1 GROUP 2 Port 2 0 Output Upper 1 Input Port 0 0 Output 1 Input Mode 00 Mode 0 01 Mode 1 1X Mode 2 Command 0 Bit Select manipulation 1 Mode Select Figure 3 3 Mode Select Command Word In MODE 0 the two groups of 12 pins can be programmed in sets of 4 and 8 pins to be inputs or outputs In MODE 1 each of the two groups of 12 pins can be programmed to have 8 lines of input or output Of the 4 remaining pins 3 are used for handshaking and interrupt control signals MODE 2 is a strobed bi directional bus configuration For most applications and in almost all TERN sample files MODE 0 is 3 7
14. D 1 BirdBox A Appendix E Software Glossary Appendix E Software Glossary The following is a glossary of library functions for the BirdBox A void ae_init void ae h Initializes the AM188ES processor The following is the source code for ae_init outport Oxffa0 OxcObf UMCS 256K ROM 3 wait states disable AD15 0 outport Oxffa2 0x7fbc 512K RAM 0 wait states outport Oxffa8 0xa0bf 256K block 64K MCSO PCS I O outport Oxffa6 Ox81ff MMCS base 0x80000 outport Oxffa4 0x007f PACS base 0 15 wait outport Oxff78 0xe73c PDIR1 TxDO RxDO TxD1 RxD1 PI6 PCS0 P17 PCS1 PPI outport Oxff76 0x0000 PIOMI outport Oxff72 0xec7b PDIRO P12 A19 A18 A17 P2 PCS6 RTC outport Oxff70 0x1000 PIOMO P12 LED outportb 0x0103 0x9a all pins are input 120 23 output outportb 0x0100 0 outportb 0x0101 0 outportb 0x0102 0x01 120 ADCS high clka_en 0 enable Reference led c void ae_reset void ae h Resets AM188 processor void delay_ms int m ae h Approximate microsecond delay Does not use timer Var m Delay in approximate ms Reference led c void led int i ae h Toggles P12 used for led Var i Led on or off Reference led c E 1 Appendix E Software Glossary BirdBox A void delayO unsigned int t ae h Approximate loop delay Does not use timer Var m Delay using simple for loop up to t Reference void pwr_save_en int i ae h Enables powe
15. E DZT E DOA TSIo _z Ttd_Z iaoa z isa z W_OT So er ESA wate i a daa Ed DATE G55 ie OTHOT NU OTMOT ENA OTOL ZNA Osea OAH TT 71 8 07 T oo O33 OT qu I 23A 23A DOA 23A TNA LAH ZI 90 91 L KE het zZ Gla Z T aM TT 030 Nod zan Et co op 9 et gt baer Ta ec INA ZI ao One EAH bT 56 57 EET m 18 SOT ET 5am 23A Aor Axor aitiau LT8SNT bAH GT or 2 vt OM bE tou oa 4 SAH or So sr est ETH isa ST io Ga DON ERIT ERT San eo el e aT o m Ise oT S8vo17 SA 8t TOM ZyYTOHbL gto sto T69XVH a E Dee Oe Sta w p on S19 aq ocak ORI VY CORE I7 Xy 7 TINTE E Po FED 51979 ZOAN TENI7 6 ZE FS 7INT zio JA 23 Na ZOT AOT my O 0n EINI OT sd xe co OLNT7 WZETXVH GSTOHPL ga 224 Ou H zaxa 6 ZaXE 6 axa oo ELNI TE 55 Gz Y ZINI Bou TA LO BID 23A vTOn 2508 08 oda SU IAZTF Z TOA TWN TT 9 hi ETINI aa e ler der pe 0x7 TT ee 65 5 PST 1537 otoga 9H Inns et y St Z PINI XI Or pi xn EKI BI 7 USLa A S8POLT aa 089 OND Q 21887 ae en na TIR Or gt OF POr 28 Tez mn e id Parr A vee TOR Ita 22 H O TS Y aq e Tda Sto7 et ort ile ET OSS o Y CT YS aay E O TOT ZON ODA Sty PT Gna ga ED Ed o TOW axz Z_ 5 34 ean SL itesnt gt s00 ca a saa tto Le FA TSR ag 8 TOUR er o L aw TTY a OT TER OT y t od DOA vIn LS 8 a e Z 8 L L 29A ETA stn 4 TT YM OOK anavo T Siu7_9 axu 9 Lax 82 O O O O SID o SEGX17 Tb o SE TXI za cea Ser LZI A eo o zZ T zZ T Gea Ow Ger 0 NET ZTSYUOH gu cH ved TY ber TV
16. High impedance Input operation 4 5 BirdBox A Chapter 4 Software e 1 Open drain output operation e 2 output e 3 peripheral mode unsigned int pio_rd Arguments char port Return value byte indicating PIO status Each bit of the returned 16 bit value indicates the current I O value for the PIO pins in the selected port void pio_wr Arguments char bit char dat Return value none Writes the passed in dat value either 1 0 to the selected PIO 4 2 4 Timer Units The three timers present on the BirdBox A can be used for a variety of applications All three timers run at Y4 of the processor clock rate which determines the maximum resolution that can be obtained Be aware that if you enter power save mode that means the timers will operate at a reduced speed as well These timers are controlled and configured through a mode register which is specified using the software interfaces The mode register is described in detail in chapter 8 of the AMD AM188ES User s Manual Pulse width demodulation is done by setting the PWD bit in the SYSCON register Before doing this you will want to specify your interrupt service routines which are used whenever the incoming digital signal switches from high to low and low to high The timers can be used to time execution of your user defined code by reading the timer values before and after execution of any piece of code For a sample file demonstrating this application see the sampl
17. I O pins on this parallel port are mapped to a PPI U5 at address 0x100 This parallel port can be used for general purpose I O A printer driver is also provided to interface to most dot matrix printers in the sample file samples bb bba_prt c If you have detailed specifications for your printer you can create your own parallel port driver 3 4 6 SERI MODEM Interface The SER1 serial channel of the BirdBox has two connectors one is J10 and the other J5 a DB9 connector is configured as a DTE device This connector is compatible with a PC AT DB9 serial port A cable connecting the DB9 connector of the BirdBox A to the DB25 connector of an external MODEM RS232C can be constructed as shown in Figure 3 4 3 9 BirdBox A Chapter 3 Hardware MODEM RS232C DB25 BirdBox JS DB9 TxD WANG 9648 24e Data Fax Modem Figure 3 4 Connection between BirdBox A J5 DB9 and MODEM RS232C DB25 3 5 Other Devices A number of other devices are also available on the BirdBox A Some of these are optional and might not be installed on the particular controller you are using For a discussion regarding the software interface for these components please see the Software chapter 3 5 1 Interrupt Driven Keypad A telephone keypad 3x4 is provided as part of the optional BB Pack for user inputs As part of the package the keypad fits into the metal box enclosure provided for the BirdBox The keypad matrix is shown below Three output lines are us
18. If used with MemCard this chip select line is used for the I O window Sets up PCS5 6 lines as chip select lines with three wait state operation outport Oxffa8 Oxa0bf s8 3 wait states outport Oxffa6 0x81ff CSOMSKH e Initialize PACS so that PCS0 PCS3 are configured so that Sets up PCSO 3 lines as chip select lines with fifteen wait state operation The chip select lines starts at I O address 0x0000 with each successive chip select line addressed 0x100 higher in I O space outport Oxffa4 Ox007f CSOMSKL 512K enable CSO for RAM e Configure the two PIO ports for default operation All pins are set up as default input except for P12 used for driving the LED and peripheral function pins for SERO and SER1 as well as chip selects for the PPI outport 0xff78 0xe73c PDIRI TxDO RxDO TxD1 RxD1 P16 PCSO P17 PCS1 PPI outport Oxf 76 0x0000 PIOM1 outport 0xff72 0xec7b PDIRO P12 A19 A18 A17 P2 PCS6 RTC outport Oxf 70 0x1000 PIOMO P12 LED 4 3 BirdBox A Chapter 4 Software e Configure the PPI 82C55 to all inputs except for lines 120 23 which are used as output for the ADC You can reset these to inputs if not being used for that function outportb 0x0103 0x9a all pins are input 120 23 output outportb 0x0100 0 outportb 0x0101 0 outportb 0x0102 0x01 120 ADCS high The chip select lines are by default set to 15 wait state This makes it possib
19. J12 O J05 O J11 Ha E Power e 2 E E jack He di ge PPI ieS o ute o u02 UART H10 a J8 Js J4 Ja H8 Or 14 HC Pee U7 RTC h ADC TLC2543 se uo N u uwe RS232 g oo0oo EH 13 lt lt ON Ol s Ne Red o ooo 00 0 K H3 LED Figure 2 2 The red LED blinks twice after the BirdBox A is powered on or reset BirdBox A Chapter 3 Hardware Chapter 3 Hardware 3 1 Birdbox A Am188ES Introduction The BirdBox A is based on a combination of the A Engine and BirdBox designs and combines the best features of both It is based on Am188ES processor architecture The Am188ES is based on the industry standard x86 architecture The Am188ES controllers are higher performance more integrated versions of the 80C188 microprocessors In addition the Am188ES has new peripherals The on chip system interface logic can minimize total system cost The Am188ES has two asynchronous serial ports 32 PIOs a watchdog timer additional interrupt pins a pulse width demodulation option DMA to and from serial ports a 16 bit reset configuration register and enhanced chip select functionality 3 2 Am188ES Features 3 2 1 Clock Due to its integrated clock generation circuitry the Am188ES microcontroller allows the use of a times one crystal frequ
20. P1 J2 pin 29 J1 pin 4 Timer input PO J2 pin 20 These two timers can be used to count or time external events or they can generate non repetitive or variable duty cycle waveforms Timer2 is not connected to any external pin It can be used as an internal timer for real time coding or time delay applications It can also prescale timer O and timer 1 or be used as a DMA request source The maximum rate at which each timer can operate is 10 MHz since each timer is serviced once every fourth clock cycle Timer output takes up to six clock cycles to respond to clock or gate events See the sample programs timer0 c and ae_cnt0 c in the samples ae directory 3 2 5 PWM outputs and PWD The TimerO and Timer outputs can also be used to generate non repetitive or variable duty cycle waveforms The timer output takes up to 6 clock cycles to respond to the clock input Thus the minimum timer output cycle is 25 ns x 6 150 ns at 40 MHz Each timer has a maximum count register that defines the maximum value the timer will reach Both Timer0 and Timerl have secondary maximum count registers for variable duty cycle output Using both the primary and secondary maximum count registers lets the timer alternate between two maximum values MAX COUNT A MAX COUNT B Pulse Width Demodulation can be used to measure the input signal s high and low phases on the AINT2 J2 pin 19 3 2 6 Power save Mode The power save mode of the Am188ES reduces
21. RTC72421 72423 Function Table Address Data ee Value oe os 0 9 Teco date ls Ce Fo of fo pm mig mis mip 0 9 ria dig regir Ee ea Ca pe a E E PM AM ho 22 PM AM 10 hour digit register rpo a a a a oo e Dic oe eed 7 E E oe a fo o o momo mos mos moy 0 9 month ig register afo fo mos pp me 0 10 moni ii region ppp a Ta 0 carge EAU E re E EE E CA EE Pu 06 Wes regiser A AA Adj Flag Nil ca CO ol oca STD 1 fi 1 1 Regr Test 24 12 Stop Rest ControlregisterF Note 1 INT STD Interrupt Standard Rest Reset 2 Mask AM PM bit with 10 s of hours operations 3 Busy is read only IRQ can only be set low 0 4 INT 05 gt AM gt STD 5 Test bit should be 0 Appendix D Serial EEPROM Map BirdBox A Appendix D Serial EEPROM Map Part of the on board serial EEPROM locations are used by system software Application programs must not use these locations 0x00 Node Address for networking 0x01 Board Type 00 VE 10 CE 01 BB 02 PD 03 SW 04 TD 05 MC 0x02 0x03 0x04 SERO_receive used by ser0 c 0x05 SERO_transmit used by ser0 c 0x06 SER1_receive used by serl c 0x07 SER1_transmit used by serl c 0x10 CS high byte used by ACTR 0x11 CS low byte used by ACTR 0x12 IP high byte used by ACTR 0x13 IP low byte used by ACTR 0x18 MM page register O 0x19 MM page register 1 Oxla MM page register 2 Ox1b MM page register 3
22. Since it allows you to monitor the current value of the buffer and associated pointer values you can watch the transmission process The two serial ports have similar software interfaces Any interface that makes reference to either s0 or ser can be replaced with s1 or ser1 for example Each serial port should use its own COM structure as defined in ae h typedef struct unsigned char ready TRUE when ready nsigned char baud nsigned char mode nsigned char iflag interrupt status nsigned char xin_buf Input buffer nt in_tail Input buffer TAIL ptr nt in_head Input buffer HEAD ptr nt in_size Input buffer size nt in_crent Input lt CR gt count nsigned char in_mt Input buffer FLAG nsigned char in_full input buffer full nsigned char out_buf Output buffer nt out_tail Output buffer TAIL ptr nt out_head Output buffer HEAD ptr nt out_size Output buffer size unsigned char out_full Output buffer FLAG unsigned char out_mt Output buffer MI unsigned char tmso transmit macro service operation u u u u i i i L u u u i i i 4 12 BirdBox A Chapter 4 Software nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig nsig COM hat rts har dtr har en485 har err har node har cr scc CR register xf har slave nt in_segm input buffer segment nt in_offs input b
23. The TLC2543 is a 12 bit switched capacitor successive approximation 11 channels serial interface analog to digital converter Three PPI I O lines from US are used to handle the ADC with CS I20 CLK I22 and DIN I21 The ADC digital data output communicates with a host through a serial tri state output DOUT P11 If I20 CS is low the TLC2543 will have output on P11 If I20 CS is high the TLC2543 is disabled and P11 is free 120 and P11 are pulled high by 10K resistors on board The TLC2543 has an on chip 14 channel multiplexer that can select any one of 11 inputs or any one of three internal self test voltages The sample and hold function is automatic At the end of conversion the end of conversion EOC output is not connected although it goes high to indicate that conversion is complete TLC2543 features differential high impedance inputs that facilitate ratiometric conversion scaling and isolation of analog circuitry from logic and supply noise A switched capacitor design allows low error conversion over the full operating temperature range The analog input signal source impedance should be less than 50Q and capable of slewing the analog input voltage into a 60 pf capacitor A reference voltage less than VCC 5V can be provided for the TLC2543 if additional precision is required A voltage above 2 5V and less than 5V can be used for this purpose and can be connected to the REF pin The CLK signal to the ADC is toggled throug
24. The high voltage drivers have outputs at header H5 and HV1 HV4 are also available at RJ11 jack J15 3 5 8 Switching Power Supply A switching power supply voltage regulator LM2575 is on board to provide 5V regulated power The input voltage provided to the voltage regulator from the signal 12VI should be in the range of 8 5V to 35V This component has high efficiency and dramatically reduces excess heat produced on the voltage regulator The VOFF pin on the switching power supply can also be used to power on off the controller This is particularly useful in battery powered applications where power consumption is especially sensitive and the controller can be powered off for long periods of time In this mode power consumption is reduced to 3 uA When this pin is pulled high the voltage regulator will power down the controller You can pull this pin low manually by using a jumper to connect header H7 If this pin is instead connected to another source such as an external digital signal or the real time clock the controller can be turned on off automatically The unregulated voltage supply can be connected to header H4 If you have a regulated 5V voltage supply source it can be connected to any of the VCC GND pins on headers J1 and J2 3 14 BirdBox A Chapter 3 Hardware 3 5 9 LED Beeper An optional beeper provided as part of the BB Pack is available connected to PIO line P26 Oscillating this pin high and low will cause the b
25. Y 20x2 main expansion port J2 20x2 main expansion port J3 3x1 SRAM selection pin 2 3 SRAM 256KB 512KB pin 1 2 SRAM 32KB 128KB J4 3x1 ROM Flash size selection pin 1 2 ROM or Flash size 32KB 128KB pin 2 3 ROM or Flash size 256KB 512KB JOS DB9 SER1 modem communication lines J5 3x1 ROM 512KB selection pin 1 2 ROM size 512KB pin 2 3 Flash 128KB 512KB or ROM lt 512 KB J6 20x2 DB25 Parallel Port with PPI US lines J8 12x1 High address lines A8 A19 J9 2x1 Watchdog timer Enabled if Jumper is on Disabled if jumper is off J11 Jack6 RS232 RS485 output for SCC2691 U02 J12 Jack6 RS232 output for SERO J15 Jack6 High voltage drivers HV1 4 GK and VS signals for high voltage drivers N2 Jack6 RS485 output for SCC2691 U8 RT Remote Reset and VI Remote Voltage Input 3 17 BirdBox A Chapter 3 Hardware Name Size Function Possible Configuration HO 5x2 11 channels of analog inputs ADO AD10 ADC Reference H1 5x2 RS232 output for SERO H2 5x2 RS232 output for SER1 H3 5x2 RS232 RS485 output for SCC2691 U8 H03 5x2 RS232 RS485 output for SCC2691 U02 H4 2x1 Power connector H5 10x1 High voltage output HV0 HV7 H6 2x2 High voltage sink source voltage supply ground H7 2x1 VOFF short to ground H8 3x1 If LCD installed potentiometer installed to configure contrast H10 13x2 PPI U16 output Pins 5 18 used for LCD
26. eza ee o GQ ve pea ams EZ 55 gay zaxa quy Ed 50 TOTS OTI T Wee TTH GZ 9z Ota vz t dY4 T aa DOA ota fe TE SudH EL ESHIH pe SudH sc asin on Boa NN
27. if installed 3 18 BirdBox A Chapter 4 Software Chapter 4 Software Please refer to the Technical Manual of the C C Development Kit for TERN 16 bit Embedded Microcontrollers for details on debugging and programming tools For details regarding software function prototypes and sample files demonstrating their use please refer to the Software Glossary in Appendix E Guidelines awareness and problems in an interrupt driven environment Although the C C Development Kit provides a simple low cost solution to application engineers some guidelines must be followed If they are not followed you may experience system crashes PC hang ups and other problems The debugging of interrupt handlers with the Remote Debugger can be a challenge It is possible to debug an interrupt handler but there is a risk of experiencing problems Most problems occur in multi interrupt driven situations Because the remote kernel running on the controller is interrupt driven it demands interrupt services from the CPU If an application program enables interrupt and occupies the interrupt controller for longer than the remote debugger can accept the debugger will time out As a result your PC may hang up In extreme cases a power reset may be required to restart your PC For your reference be aware that our system is remote kernel interrupt driven for debugging The run time environment on TERN controllers consists of an I O a
28. of success and zero in any other case putsersn Arguments char str COM c Return value int return_value This function places a null terminated character string into the transmit buffer The return value returns one in case of success and zero in any other case DMA transfer automatically places incoming data into the inbound buffer serhitr should be called before trying to retrieve data serhitn Arguments COM c Return value int value This function returns 1 as value if there is anything present in the in bound buffer for this serial port 4 13 BirdBox A Chapter 4 Software getsern Arguments COM c Return value unsigned char value This function returns the current byte from sm_in_buf and increments the in_tail pointer Once again this function assumes that serhitn has been called and that there is a character present in the buffer getsersn Arguments COM c int len char str Return value int value This function fills the character buffer str with at most len bytes from the input buffer It also stops retrieving data from the buffer if a carriage return ASCII 0x0d is retrieved This function makes repeated calls to getser and will block until len bytes are retrieved The return value indicates the number of bytes that were placed into the buffer Be careful when you are using this function The returned character string is actually a byte array terminated by a null character This means that there
29. such as the 20x4 are also available but require a different metal enclosure For details regarding the metal enclosure please see Appendix F The LCD display also has a detailed sample file bba_Icd c demonstrating its use which provides documentation for basic write functions to the LCD If this is insufficient for your application you can also find standard technical documentation from Hantronix Inc http www hantronix com 408 252 1100 for your specific LCD module 3 5 3 On board Supervisor with Watchdog Timer The MAX691 LTC691 U6 is a supervisor chip With it installed the BirdBox A has several functions watchdog timer battery backup power on reset delay power supply monitoring and power failure warning These will significantly improve system reliability Watchdog Timer The watchdog timer is activated by setting a jumper on J9 of the BirdBox A The watchdog timer provides a means of verifying proper software execution In the user s application program calls to the function hitwd a routine that toggles the P12 HWD pin of the MAX691 should be arranged such that the HWD pin is accessed at least once every 1 6 seconds If the J9 jumper is on and the HWD pin is not accessed within this time out period the watchdog timer pulls the WDO pin low which asserts RESET This automatic assertion of RESET may recover the application program if something is wrong After the BirdBox A is reset the WDO remains low until a tran
30. to J1 pin 3 and J1 pin 21 For more detailed technical specifications refer to Appendix B U8 may be used as a network 9 bit UART for the TERN NT Kit RxD J1 pin 5 TxD J1 pin 7 MPO J1 pin 3 and MPI J1 pin 21 are TTL level signals for the first SCC2691 serial port US The second SCC2691 serial port U02 uses signal pins RxD2 TxD2 CTS2 and RTS2 which are on header J11 RS 232 and RS 485 drivers are provided to bring the UART serial 3 8 BirdBox A Chapter 3 Hardware outputs to RS 232 or RS 485 signal levels Both of the SCC UARTs can be configured for either RS232 or RS485 operation Two serial ports SERO and SER 1 are internal to the Am188ES processor These are both configured for RS 232 operation on the BirdBox A as well Below is a functional diagram of all of the serial ports available on this unit SCC2691 N2 RJ11 6 6 SCC U8 5 T O Addr 0x0500 H3 HDRD10 J3 HDRD10 SERO J12 RJ11 6 6 Am188ES CPU RS232C Drivers SER1 TxD2 RS232C RS485 SCC2691 Driver H03 HDRD10 RTS2 485 J11 RJ11 6 6 T O Addr 0x0200 CTS2 485 The default connector configuration for the serial ports is 5x2 pin headers for each as shown in the functional diagram above As part of the BirdBox A Package BB Pack these headers are replaced with three optional RJ 11 phone jacks and a DB9 connector 3 4 5 Parallel Port A DB25 pin compatible parallel port is provided at J6 It is configured using standard I O pins The
31. 0_echo c s1_echo c s1_0 c int putsersO unsigned char str COM c ser0 h int putsers l unsigned char str COM c serl h int putsers_scc unsigned char ch COM c scc h int putsers_sccl unsigned char ch COM c sccl h Output a character string to serial port Character will be sent to serial output with interrupt isr Var str pointer to output character string cC pointer to serial port structure Reference ser1_sin c int serhitd0 COM c ser0 h int serhitl COM c serl h int serhit_scc COM c scc h int serhit_sccl COM c sccl h Checks input buffer for new input characters Returns 1 if new character is in input buffer else 0 Var c pointer to serial port structure Reference s0_echo c s1_echo c s1_0 c Appendix E Software Glossary BirdBox A unsigned char getser0 COM c ser0 h unsigned char getserl COM c serl h unsigned char getser_scc COM c scc h unsigned char getser_sccl COM c sccl h Retrieve 1 character from the input buffer Assumes that serhit routine was evaluated Var c pointer to serial port structure Reference s0_echo c s1_echo c s1_0 c int getsersO COM c int len unsigned char str ser0 h int getsersI COM c int len unsigned char str serl h int getsers_scc COM c int len unsigned char str scc h int getsers_sccl COM c int len unsigned char str sccl h Retrieves a fixed length character string from the input buffer If the buffer contains les
32. 8 400 57 600 115 200 250 000 500 000 1 250 000 Table 4 1 Baud rate values After initialization by calling s1_init SER1 is configured as a full duplex serial port and is ready to transmit receive serial data at one of the specified 15 baud rates An input buffer serl_in buf whose size is specified by the user will automatically store the receiving serial data stream into the memory by DMA operation In terms of receiving there is no software overhead or interrupt latency for user application programs even at the highest baud rate DMA transfer allows efficient handling of incoming data The user only has to check the buffer status with serhit1 and take out the data from the buffer with getser1 if any The input buffer is used as a circular ring buffer as shown in Figure 4 1 However the transmit operation is interrupt driven ibuf in_tail in_head ibuf isiz Y oso y y TT i 1111 A Figure 4 1 Circular ring input buffer The input buffer ibuf buffer size isiz and baud rate baud are specified by the user with s1_init with a default mode of 8 bit 1 stop bit no parity After s1_init you can set up a new mode with different numbers for data bit stop bit or parity by directly accessing the Serial Port 0 1 Control Register SPOCT SP1CT if necessary as described in chapter 10 of the Am188ES manual for asynchronous serial ports Due to the nature of high speed baud rates and possible effects from the exte
33. 8 ZTA ASEANOT Z0 loa oy PET Ta tore 2 AND pe Cec wo ea zt 8 TTA zto Ll Od 6T 9 1INI1 zI oT LA zz z S IZ IAN zint S A ISa OZ TSR ane oo zazor 75 9a 02 5 SL Std CINI to 5 GS ZHN8 aaor T Ta 20 tz Je oy LZ DOA LoTs ver LT So 8t SL isu Sta 2 g o im OTO ZHN8 4401 ASEANOT FTO cali ey ed 01 G vd _9T 7 g lt ISl IND SZ 5 2 Taxed aaor IX LJ ZX aaot zex 3 Ilex 09 TIO We Celi an ae ta aANDOTAW 81 sd vt ET UND 0514 Lz Be TAXI TIVIX ETVLX ex vx WEA vz T 130A ra toro Jo za zi OTT oa Tee Soria ZIWLX FT va ano aa TI ta or Sos em e L Qeon AS 1692008 sa or L 1 9 oa s Ou axi rini ce Ope oax ano wa oz 2 ana o 2 Qe ara ga ce 2 Sic 0819 1iNI ET Re Cs eT oiNIZ A 1 erm 94 301 8 O ans e O 9 DOA tar 2 Ge osa bra ve 2 Oge pa TS19 vt TTISY Tr isu GO TT ano dav t2z1 ov sza L 2 2 3 eta msz O O goo Doa ee 9 Oor AND Ta GT a zx OT ZEX ES zx OL EX N zI La LOI 6 Sa aot iza 6 gt o OTGZE um te ODA 9d 91 2a ri 6 ZoX 24 Les 6 PX AND T ano gay zz tod It e G21008 Sait FG Ty SOW Ba o fs OW taaa vt xov ETT oTi o god ET e grrzos a fo Py pote MG Pe Le Ty omic AND LAY z Sod st OL vod 7AO WWUANWEA DIA dLTW O0A EM am M v gd 61 9 N 9 ZW Tiai 91 ASGZTI TT oe LO LT 2 S 81908 LTY WVHA CTY DOA aM BTW ZA oz ae aati ZIAN a aah GIAN Tel Lt ano OND BZ y eld et 5 G02 oza El Z T El z T ENEJ T HA 4g ax Zoan 6d ax 2 Oam Zzr_8t aar zt oy Tea te S Gee ccd 0d 22 ou oxy EZOXL Suge Sax ES I 61 SDA SZ 1G
34. Again this function is highly dependent upon the processor speed unsigned int crc16 Arguments unsigned char wptr unsigned int count Return value unsigned int value This function returns a simple 16 bit CRC on a byte array of count size pointed to by wptr void ae_reset Arguments none BirdBox A Chapter 4 Software Return value none This function is similar to a hardware reset and can be used if your program needs to re start the board for any reason Depending on the current hardware configuration this might either start executing code from the DEBUG ROM or from some other address 4 3 Functions in BB LIB Up to eight high voltage drivers either sourcing or sinking are available on the BirdBox A Depending on the specific hardware configuration you have purchased certain software functions may not apply void bba_hv Arguments char ch char dat Return value none This function outputs the value in dat either 1 0 to the channel ch range 0 7 For details regarding the resulting output signals and more detailed hardware details you should refer to the Hardware chapter 4 4 Functions in SERO OBJ SER1 OBJ The functions described in this section are prototyped in the header file ser0 h and ser1 h in the directory tern 186 include The internal asynchronous serial ports are functionally identical SERO is used by the DEBUG ROM provided as part of the TERN EV DV software kits for communication with the P
35. BirdBox A C C Programmable 16 bit Microprocessor Module Based on the Am188ES With 4 UARTs LCD keypad and enclosure Technical Manual Q A o AA IS D A O o Wo Wo WoMoMo Me Mo Mo Me aga I TERN TDREM _ 1115 200 40MH or 57 600 20MHz j ze ETT tasa raddrnd A pa SIS aa ES ie o MES ziii N Sea Un be tetist D 1724 Picasso Avenue Suite A Davis CA 95616 USA Tel 530 758 0180 Fax 530 758 0181 COPYRIGHT BirdBox A BirdBox L BirdBox A Engine A Engine P 1386 Engine NT Kit and ACTF are trademarks of TERN Inc Am188ES and Am186ES are trademarks of Advanced Micro Devices Inc Borland C C is a trademark of Borland International Microsoft MS DOS Windows Windows95 and Windows98 are trademarks of Microsoft Corporation IBM is a trademark of International Business Machines Corporation Version 2 00 May 12 1999 No part of this document may be copied or reproduced in any form or by any means without the prior written consent of TERN Inc O 1998 1999 TE RN 1724 Picasso Avenue Suite A Davis CA 95616 USA Tel 530 758 0180 Fax 530 758 0181 Internet Email tern netcom com http www tern com Important Notice TERN is developing complex high technology integration systems These systems are integrated with software and hardware that are not 100 defect free TERN products are not designed intended authorized or warranted to be suitable for use in life support applications
36. BirdBox A Chapter 3 Hardware the appropriate setting for the PPI ports That gives you the maximum number of additional digital I O pins There are two separate PPIs available on the BirdBox A The first PPI U16 is mapped at base I O address 0x0000 and supports the LCD via header H10 The second PPI U5 is mapped to address 0x0100 and drives the parallel printer port J6 The ports registers are offsets of this I O base address The Command Register 0x0 03 Port 0 0x0 00 Port 1 0x0 01 and Port 2 0x0 02 where the refers to the appropriate I O address based on the PPI being used The following code example will set all ports to output mode on the PPI US outportb 0x0103 0x80 Mode 0 all output selection outportb 0x0100 0x55 Sets port 0 to alternating high low 1 0 pins outportb 0x0101 0x55 Sets port 1 to alternating high low 1 0 pins outportb 0x0102 0x55 Sets port 2 to alternating high low 1 0 pins To set all ports to input mode outportb 0x0103 0x9f Mode 0 all input selection You can read the ports with inportb 0x0100 Port 0 inportb 0x0101 Port 1 inportb 0x0102 Port 2 This returns a 8 bit value for each port with each bit corresponding to the appropriate line on the port You will find that numerous on board components are controlled using PPI lines only You will need to use PPI access methods to control these as well 3 4 3 Real time Cl
37. C As a result you will not be able to debug code directly written for serial port 0 Two asynchronous serial ports are integrated in the Am188ES CPU SERO and SER1 Both ports have baud rates based on the 40 MHz clock and can operate at a maximum of 1 16 of that clock rate By default SERO is used by the DEBUG ROM for application download debugging in STEP and STEP 2 We will use SER as the example in the following discussion any of the interface functions which are specific to SER1 can be easily changed into function calls for SERO While selecting a serial port for use please realize that some pins might be shared with other peripheral functions This means that in certain limited cases it might not be possible to use a certain serial port with other on board controller functions For details you should see both chapter 10 of the Am188ES Microprocessor User s Manual and the schematic of the BirdBox A provided at the end of this manual TERN interface functions make it possible to use one of a number of predetermined baud rates These baud rates are achieved by specifying a divisor for 1 16 of the processor frequency The following table shows the function arguments that express each baud rate to be used in TERN functions These are based on a 40 MHz system clock a 20 MHz system clock would have the baud rates halved 1 110 2 150 3 300 4 10 BirdBox A Chapter 4 Software 600 1200 2400 4800 9600 19 200 default 3
38. O Input with pull up J2 pin 34 TxDO P23 RxD0 Input with pull up J2 pin 32 RxDO P24 MCS2 Input with pull up J2 pin 17 Input with pull up P25 MCS3 Input with pull up J2 pin 18 Input with pull up P26 UZI Input with pull up J2 pin 4 Input with pull up P27 TxDl Input with pull up J2 pin 28 TxD1 P28 RxD1 Input with pull up J2 pin 26 RxD1 P29 CLKDIV2 Input with pull up J2 pin 3 Input with pull up P30 INT4 Input with pull up 32 pin 33 Input with pull up P31 INT2 Input with pull up J2 pin 19 Input with pull up Note P26 P29 must NOT be forced low during power on or reset Table 3 1 I O pin default configuration after power on or reset Three external interrupt lines are not shared with PIO pins INTO J2 pin 2 3 4 BirdBox A Chapter 3 Hardware INT1 J2 pin 6 INT3 J2 pin 21 The 32 PIO lines PO P31 are configurable via two 16 bit registers POMODE and PIODIRECTION The settings are as follows MODE PIOMODE reg PIODIRECTION reg PIN FUNCTION 0 0 0 Normal operation 1 0 1 INPUT with pull up pull down 2 1 0 OUTPUT 3 1 1 INPUT without pull up pull down BirdBox A initialization on PIO pins in ae_init is listed below outport Oxff78 0xe73c PDIR1 TxDO RxDO TxD1 RxD1 P16 PCSO P17 PCS1 PPI outport Oxff76 0x0000 PIOM1 outport Oxff72 0xec7b PDIRO P12 A19 A18 A17 P2 PCS6 RTC outport Oxff70 0x 1000 PIOMO P12 LED The C function in the library ae_lib can be used to initialize PI
39. O pins void pio_init char bit char mode Where bit 0 31 and mode 0 3 see the table above Example pio_init 12 2 will set P12 as output pio_init 1 0 will set P1 as Timer output void pio_wr char bit char dat pio_wr 12 1 set P12 pin high if P12 is in output mode pio_wr 12 0 set P12 pin low if P12 is in output mode unsigned int pio_rd char port pio_rd 0 return 16 bit status of PO P15 if corresponding pin is in input mode pio_rd 1 return 16 bit status of P16 P31 if corresponding pin is in input mode Some of the I O lines are used by the BirdBox A system for on board components Table 3 2 We suggest that you not use these lines unless you are sure that you are not interfering with the operation of such components i e if the component is not installed You should also note that the external interrupt PIO pins INT2 4 5 and 6 are not available for use as output because of the inverters attached The input values of these PIO interrupt lines will also be inverted for the same reason As a result calling pio_rd to read the value of P31 INT2 will return 1 when pin 19 on header J2 is pulled low with the result reversed if the pin is pulled high Signal Pin Function P2 PCS6 U4 RTC72423 chip select at base I O address 0x0600 P3 PCS5 U8 SCC2691 UART chip select at base I O address 0x0500 P4 DT STEP 2 jumper Pil TimerO input Shared with U19 TLC2543 ADC and U7 24C04 EE data input The ADC and EE da
40. RN provides a Borland C C compiler TASM LOC31 Turbo Remote Debugger I O driver libraries sample programs and batch files These kits also include a DEBUG ROM TDREM_AE to communicate with Turbo Debugger a PC V25 cable to connect the controller to the PC and a 9 volt wall transformer See your Evaluation Development Kit Technical Manual for more information on these kits After you debug your program you can test run the BirdBox A in the field away from the PC by changing a single jumper with the application program residing in the battery backed SRAM When the field test is complete application ROMs can be produced to replace the DEBUG ROM The HEX or BIN file can be easily generated with the makefile provided You may also use the DV Kit or ACTF Kit to download your application code to on board Flash The three steps in the development of a C C application program are explained in detail below 1 4 BirdBox A Chapter 1 Introduction 1 4 1 Step 1 STEP 1 Debugging Write your C C application program in C C Connect your controller to your PC via the PC V25 serial link cable Use the batch file m bat to compile link and locate or use t bat to compile link locate download and debug your C C application program RED edge of cable connects to pin 1 of SERO H1 Wall transformer 9V 500 mA center negative Figure 1 3 Step 1 connections for the BirdBox A 1 5 Chapter 1 Introduction BirdBox A
41. Zz OT 3401 cab ow A zaudH Oca AND Ozt TND LH aNawo ot ZO O Sato Teo slvelzlrlob jej 259 Tole irlolslep so A HR 6 pp PH e 9 500 811 010 550181918 ele s EY O 6 sau 2 Sak zo Lae OES 6 amp IN b rart7 aN Lopsg9oLotas TOPS9IDLOTAS anavo 5 pee Bao E pp ERES le DOXT zea TZLZZZNE NANO qyy zza CCCCENZYYND qyy Uh TIY 9 GS Ode ZAR DAXE Zed et ddddd 9 9 day Zz oI ddddd ad 9 o a7 7 Pp y 2 SH oax17 Be zsto E eza ot scg 205 Soom ect S 001 19 g 31 z SA o cta oz S15 DoS tos o Y TOI PTY TH ZIP Ite TZ E cod TII E ZOT E 31 e Sta E9S _E08 ETT Z EOT Br a za yO SETA oe aca Ela tod rroa E bp vor 2 Otay lt t e S tran 95 zae 0S 50 e zakas vta sz te ssestda oq etsoa vtr Ev GOL YZEZXYN pce RTS o ee ce er e Staa Staa lea EE H aie ee 0z9 TL 9 Le Ty Tv 8 la s Oii car aa CTY 25 CEA ez AA 3M rams LIT Dv uM L0X17 3 oan E Qe e So sio er Ot axa E 9 A R TAH ota Se sa rions TO fE Z0 S ZAH TN eto OND et Sor 41 VE peo 2 Star 59 SOT T eat BG PAH 5 OSA Tin Z FA GAH G T FES E O SAN 2 opauau oe toe de on ZT Tp z OY OF S S 6 OA TADA T NOT oS ETHEL ZA SH e Tw 8 5 GLEN 67d aN5 any 3 ZN 9 Ge IVIA Zia S 9PPTOLT um ET ZI aszad N ZN ev re O t nwwaa THN7 089 NS eqpt St Y a als IZI T w a LT INAWO Wig Pi pro we wast a ey or Ev CTA O SUE LAA TOS a o fa Tat 5 SN te zy odor z oy see Sue A E er 2 DIAL e igh TA ETIN y E wud ptr ST Io ta o2 Saa ER 1587 aA
42. ain used to hold state information for the serial port The in bound and out bound buffers operate as before and must be provided upon initialization scc_init sccl_init Arguments unsigned char m1 unsigned char m2 unsigned char b unsigned char ibuf int isiz unsigned char obuf int osiz COM c Return value none This initializes the SCC2691 serial port to baud rate b as defined in the table above The values in m1 and m2 specify the values to be stored in to MR1 and MR2 As discussed above these values are normally 0x57 and 0x07 as shown in TERN sample programs ibuf and isiz define the input buffer characteristics and obuf and osiz define the output buffer After initializing the serial port you must also set up the interrupt service routine The first SCC2691 UART US takes up external interrupt INTO on the CPU the second UART U02 takes up external interrupt INT1 and you must set up the appropriate interrupt vector to handle this Interrupt service routines scc_isr sec1_isr has been written to handle each of the interrupts and it enables disables the interrupt as needed to transmit and receive data with the data buffers So after initialization you will need to make a call to do this int0_init 1 scc_isr U8 UART Interrupt Initialization inei init 1 scc_isr U02 UART Interrupt Initialization By default the SCC is disabled for both transmit and receive Before using the port you will need to
43. available modes Before selecting pins for this purpose make sure that the peripheral mode operation of the pin is not needed for a different use within the same application You should also confirm the PIO usage that is described above within ae_init During initialization several lines are reserved for TERN usage and you should understand that these are not available for your application There are several PIO lines that are used for other on board purposes These are all described in some detail in the Hardware chapter of this technical manual For a detailed discussion toward the I O ports please refer to Chapter 11 of the AMD Am188ES User s Manual Please see the sample program ae_pio c in tern 186 samples ae You will also find that these functions are used throughout TERN sample files as most applications do find it necessary to re configure the PIO lines The function pio_wr and pio_rd can be quite slow when accessing the PIO pins Depending on the pin being used it might require from 5 10 us The maximum efficiency you can get from the PIO pins occur if you instead modify the PIO registers directly with an outport instruction Performance in this case will be around 1 2 us to toggle any pin The data register is Oxff74 for PIO port 0 and Oxff7a for PIO port 1 void pio_init Arguments char bit char mode Return value none bit refers to any one of the 32 PIO lines 0 31 mode refers to one of four modes of operation e 0
44. c ae h BirdBox A Appendix E Software Glossary int rtc_rd TIM r ae h Reads from the real time clock Var r Struct type TIM for all of the RTC data typedef struct unsigned char secl secl0 minl min10 hourl1 hour10 unsigned char day1 day10 mon1 mon10 yearl year10 unsigned char wk TIM Reference rtc c void t2_init int tm int ta void interrupt far t2_isr ae h void tI_init int tm int ta int tb void interrupt far tl_isr void t0_init int tm int ta int tb void interrupt far tO_isr Timer 0 1 2 initialization Var tm Timer mode S pg 8 3 and 8 5 of the AMD CPU Manual ta Count time a 1 4 clock speed tb Count time b for timer 0 and 1 only 1 4 clock Time a and b establish timer duty cycle PWM See hardware chapter t _isr pointer to timer interrupt routine Reference timer c timer1 c timer02 c timer2 c timer0 c timer12 c void nmi_init void interrupt far nmi_isr ae h void int0_init unsigned char i void interrupt far intO_isr void intl _init unsigned char i void interrupt far intl_isr void int2_init unsigned char i void interrupt far int2_isr void int3_init unsigned char i void interrupt far int3_isr void int4_init unsigned char i void interrupt far int4_isr void int5_init unsigned char i void interrupt far int5_isr void int6_init unsigned char i void interrupt far int6_isr Initialization for interrupts
45. cts See sn_cts sec_rts secl_rts See sn_rts Other SCC functions are similar to those for SERO and SER1 scc_close ser1_close See sn_close serhit_scc serhit_sccl See sn_hit clean_ser_scc clean_ser_sccl See clean_sn BirdBox A Chapter 4 Software Occasionally it might also be necessary to check the state of the SCC for information regarding errors that might have occurred By calling see_err you can check for framing errors parity errors if parity is enabled and overrun errors scc_err sccl_err Arguments none Return value unsigned char val The returned value val will be in the form of VABC000O0 in binary Bit A is 1 to indicate a framing error Bit Bis 1 to indicate a parity error and bit C indicates an over run error 4 6 Functions in AEEE OBJ The 512 byte serial EEPROM 24C04 provided on board allows easy storage of non volatile program parameters This is usually an ideal location to store important configuration values that do not need to be changed often Access to the EEPROM is quite slow compared to memory access on the rest of the controller Part of the EEPROM is reserved for TERN use specifically for this purpose Addresses 0x00 to 0x1f on the EEPROM is reserved for system use including configuration information about the controller itself jump address for Step 2 and other data that is of a more permanent nature The rest of the EEPROM memory space 0x20 to Ox1ff is availab
46. d from channel 0 chn_0_data ae_ad12 0 Start the next conversion retrieve valu 4 2 6 Digital to Analog Conversion An LTC 1446 chip is available on the BirdBox A in position U11 The chip offers two channels A and B for digital to analog conversion Details regarding hardware such as pin outs and performance specifications can be found in the Hardware chapter A sample program demonstrating the DAC can be found in ae_da c in the directory tern 186 samples ae void ae_da Arguments int datl int dat2 Return value none Argument datl is the current value to drive to channel A of the chip while argument dat2 is the value to drive channel B of the chip These argument values should range from 0 4095 with units of millivolts This makes it possible to drive a maximum of 4 906 volts to each channel 4 7 BirdBox A Chapter 4 Software 4 2 7 Other library functions On board supervisor MAX691 or LTC691 The watchdog timer offered by the MAX691 or LTC691 offers an excellent way to monitor improper program execution If the watchdog timer J9 is connected the function hitwd must be called every 1 6 seconds of program execution If this is not executed because of a run time error such as an infinite loop or stalled interrupt service routine a hardware reset will occur void hitwd Arguments none Return value none Resets the supervisor timer for another 1 6 seconds void led Arguments int ledd Return value
47. ddress space and a memory address space I O address space ranges from 0x0000 to Oxffff or 64 KB Memory address space ranges from 0x00000 to Oxfffff in real mode or 1 MB These are accessed differently and not all addresses can be translated and handled correctly by hardware I O and memory mappings are done in software to define how translations are implemented by the hardware Implicit accesses to I O and memory address space occur throughout your program from TERN libraries as well as simple memory accesses to either code or global and stack data You can however explicitly access any address in I O or memory space and you will probably need to do so in order to access processor registers and on board peripheral components which often reside in I O space or non mapped memory This is done with four different sets of similar functions described below poke pokeb Arguments unsigned int segment unsigned int offset unsigned int unsigned char data Return value none These standard C functions are used to place specified data at any memory space location The segment argument is left shifted by four and added to the offset argument to indicate the 20 bit address within memory space poke is used for writing 16 bits at a time and pokeb is used for writing 8 bits The process of placing data into memory space means that the appropriate address and data are placed on the address and data bus and any memory space mappings in place for this par
48. devices or systems or in other critical applications TERN and the Buyer agree that TERN will not be liable for incidental or consequential damages arising from the use of TERN products It is the Buyer s responsibility to protect life and property against incidental failure TERN reserves the right to make changes and improvements to its products without providing notice BirdBox A Table of Contents Chapter page 1 Introduction ocoocccnnccconaccnonacinnncnnnnnnonanononcnno 1 1 1 1 Functional Description coooooccnnnnnncccno o 1 1 152 POTES uta ts ets 1 2 1 3 Physical Description ooocconoccnnonncnnnncnnne 1 3 1 4 BirdBox A Programming Overview 1 4 TATStep ri 1 5 141 Step 2ecics tea pectin ten eieniietes 1 6 O A EN 1 6 1 5 Minimum Requirements oooconocccnocncnonncinnos 1 6 1 5 1 Minimum Hardware Requirements 1 6 1 5 2 Minimum Software Requirements 1 7 2 Installation vecsie 2 1 2 1 Software Installation 0 0 0 0 eee 2 1 2 2 Hardware Installation ooooononcccnnnnnccc 2 1 2 2 1 Connecting the BirdBox A to A e E EEE 2 1 2 2 2 Powering on the BirdBox A 2 2 Bi Hardware A IS 3 1 3 1 BirdBox A Am188ES Introduction 3 1 3 2 Am188ES Features oe 3 1 3 21 Clock anat is 3 1 3 2 2 External Interrupts and Schmitt Trigger Input Buffer 0 0 3 1 3 2 3 Asynchronous Serial Ports 3 2 3 2 4 Timer Control Unit ee 3 3 3 2 5 PWM outputs and PWD 3 3 3
49. diagram of BirdBox A The two PPIs provide 24x2 bi directional I O lines Eleven digital outputs and five digital inputs connect to a DB25 connector that can be used as a printer port The BB A has seven channels of solenoid drivers on board that have the capability to sink up to 350 mA at 50V per channel by default or an optional eight channels of sourcing solenoid drivers may be installed instead The connectors available with the optional BB Pack consist of a DB9 connector for the SER1 RS232 serial port a DB25 connector for a parallel printer port and RJ11 phone jacks for the SERO RS232 port and the two SCC RS232 RS485 UARTs Offered with these connectors are a 16x2 character LCD an interrupt driven 3x4 keypad a reset push button red and green LEDs a beeper and a DC power jack all packaged in a 4 80 x 3 72 x 1 5 inch aluminum sheet enclosure You may connect the BB A to computers control systems and external MODEMS via the RS 232 serial ports You may also connect a printer via the parallel port The BB A can be used to convert protocols into different formats to check passwords and PIN code entry and to translate messages for communication among different systems or machines Seven high voltage drivers and 11 TTL outputs and 5 TTL inputs at the DB25 printer port are also available Up to 250 BirdBox As may be networked together via an RS 485 multi drop system with twisted pair wires using the NT Kit 1 1 Chapter 1 Introduction Bi
50. e file timer c in the directory tern 186 samples ae Two of the timers Timer and Timerl can be used to do pulse width modulation with a variable duty cycle These timers contain two max counters where the output is high until the counter counts up to maxcount A before switching and counting up to maxcount B It is also possible to use the output of Timer2 to pre scale one of the other timers since 16 bit resolution at the maximum clock rate specified gives you only 150 Hz Only by using Timer2 can you slow this down even further Sample files demonstrating this are timer02 c and timer12 c in the A Engine sample file directory tern 186 samples ae The specific behavior that you might want to implement is described in detail in chapter 8 of the AMD AM188ES User s Manual void t0_init void t1_init Arguments int tm int ta int tb void interrupt far t_isnO Return values none Both of these timers have two maximum counters MAXCOUNTA B available These can all be specified using ta and tb The argument tm is the value that you wish placed into the TOCON T1CON mode registers for configuring the two timers The interrupt service routine t_isr specified here is called whenever the full count is reached with other behavior possible depending on the value specified for the control register 4 6 BirdBox A Chapter 4 Software void t2_init Arguments int tm int ta void interrupt far t_isnO Return values none T
51. ecific on board usage as well These configurations as well as the processor internal peripheral usage configurations are listed below in Table 3 1 PI Function Power On Reset status BirdBox A Pin No BirdBox A Initial O PO Timerl in Input with pull up J2 pin 20 Input with pull up Pl Timer 1 out Input with pull down J2 pin 29 JI pin 16 CLK_1 P2 PCS6 A2 Input with pull up J2 pin 24 RTC select P3 PCSS A1 Input with pull up J2 pin 15 SCC2691 U8 select P4 DT R Normal J2 pin 38 Input with pull up Step 2 PS DEN DS Normal 32 pin 30 Input with pull up P6 SRDY Normal 32 pin 35 Input with pull down P7 A17 Normal J8 pin 3 A17 P8 A18 Normal J8 pin 2 A18 P9 A19 Normal J8 pin 1 A19 P10 Timer O out Input with pull down J2 pin 12 Input with pull down P11 Timer0 in Input with pull up J2 pin 14 Input with pull up P12 DRQO INTS Input with pull up J2 pin 5 Output for LED EE HWD P13 DRQIANT6 Input with pull up J2 pin 11 Input with pull up P14 MCSO Input with pull up J2 pin 37 Input with pull up P15 MCS1 Input with pull up J2 pin 23 Input with pull up P16 PCSO Input with pull up Jl pin 19 PPI 82C55 U16 chip select P17 PCS1 Input with pull up J2 pin 13 PPI 82C55 U5 chip select P18 CTS1 PCS2 Input with pull up J2 pin 22 Input with pull up P19 RTS1 PCS3 Input with pull up 32 pin 31 Input with pull up P20 RTSO Input with pull up J2 pin 27 Input with pull up P21 CTSO Input with pull up J2 pin 36 Input with pull up P22 TxD
52. ed for each of the columns and four inputs are provided to read values from each row of the keypad ROW 1 P23 ROW2 120 ROW3 121 ROW4 122 COL1 116 COL2 117 COL3 115 3 10 BirdBox A Chapter 3 Hardware By pulling one of the column output pins low the resulting input row pin for the pressed key will be set low as well By reading these input pin values you can decode the value of the pressed key The keypad is interfaced at header K1 and the signals are all from the PPI US I O pins The keypad can also be used to generate external interrupts Choose one of the keys to be used as your interrupt key By pulling its column low its row input can be connected to one of the active low external interrupts and will raise an interrupt if the key is ever pressed For a sample program showing how to read and decode the signals from the keypad please see the sample file bba_kpad c 3 5 2 LCD Display A 16x2 alphanumeric character based LCD is also available as part of the BirdBox A Package It is connected to header H10 and uses PPI U16 I O pins to drive the LCD Pins 5 through 18 on the header are used to connect to the LCD The LCD is mounted on the back side of the board If you have purchased an LCD pin 8 on this header is disconnected from PPI signal B12 and connected to a potentiometer pot for adjustable contrast This default LCD fits inside the metal enclosure provided as part of the BB Pack Larger LCDs
53. eeper to sound A sample file showing its use bba_beep c is found in 186 samples bb Two LEDs one green and one red are also available on the BirdBox A These are turned on using lines P26 and P12 respectively Pulling either low will turn the corresponding LED on 3 6 Headers and Connectors 3 6 1 Expansion Headers J1 and J2 There are two 20x2 0 1 spacing headers for BirdBox A expansion Most signals are directly routed to the Am188ES processor These signals are 5V only and any out of range voltages will most likely damage the board 3 6 4 5 nn lo E Esa 0 00 0 00 Figure 3 6 Pin 1 locations for J1 and J2 3 15 BirdBox A Chapter 3 Hardware J1 Signal J2 Signal VCC 1 2 GND GND 40 39 VCC MPO 3 4 Pl P4 38 37 P14 RxD 5 6 GND CTSO 36 35 P6 TxD 7 8 DO TxDO 34 33 INT4 VOFF 9 10 Dl RxDO 32 31 RTS1 PFI 11 12 D2 P5 30 29 P1 GND 13 14 D3 TxD1 28 27 RTSO RST 15 16 D4 RxD1 26 25 GND RST 17 18 D5 P2 24 23 P15 P16 19 20 D6 CTS1 22 21 INT3 MPI 21 22 D7 PO 20 19 INT2 CLK 23 24 GND P25 18 17 P24 HLDA 25 26 A7 WR 16 15 P3 HOLD 27 28 A6 P11 14 13 P17 WR 29 30 A5 P10 12 11 P13 RD 31 32 A4 VCC 10 9 VRAM 33 34 A3 INTO 8 7 NMI VBAT 35 36 A2 JINT1 6 5 P12 GND 37 38 Al P26 4 3 P29 VCC 39 40 AO GND 2 1 DCD1 Table 3 3 Signals for J1 and J2 20x2 expansion ports Signal definitions for J1 VCC GND CLK RxD TxD MPO MPI VOFF D0 D7 A0 A7 PFI RST RST P16
54. enable these functionalities When using RS232 in full duplex mode transmit and receive functions should both be enabled Once this is done you can transmit and receive data as needed If you do need to do limited flow control the MPO pin on the Jl header can be used for RTS For a sample file showing RS232 full duplex communications using the first SCC please see ae_scc c in the directory tern 186 samples ae The second SCC is demonstrated in the sample file bba_scel c in the directory tern 186 samples bb RS4835 is slightly more complex to use than RS232 RS485 operation is half duplex only which means transmission does not occur concurrently with reception The RS485 driver will echo back bytes sent to the SCC As a result assuming you are using the RS485 driver installed on another TERN peripheral board you will need to disable receive while transmitting While transmitting you will also need to place the RS485 driver in transmission mode as well This is done by using sec_rts 1 This uses pin MPO multi purpose output found on the J1 header While you are receiving data the RS485 driver will need to be placed in receive mode using sec_rts 0 For a sample file showing RS485 communication please see ae_rs485 c in the directory tern 186 samples ae en485 sccl_en4835 Arguments int i Return value none This function sets the pin MPO either high i 1 or low i 0 The function scc_rts actually has a similar function by pullin
55. ency The design achieves 40 MHz CPU operation while using a 40 MHz crystal The system CLKOUTA signal is routed to J1 pin 23 default 40 MHz The CLKOUTB signal is not connected in the BirdBox A CLKOUTA remains active during reset and bus hold conditions The initialization function ae_init disables CLKOUTA and CLKOUTB with clka_en 0 You can use clka_en 1 to enable the signal CLKOUTA CLK at header J1 pin 23 3 2 2 External Interrupts and Schmitt Trigger Input Buffer There are eight external interrupts INTO INT6 and NMI INTO J2 pin 8 is used by the UART SCC2691 US if it is installed INT1 J2 pin 6 is used by the other optional UART SCC2691 U02 AINT2 J2 pin 19 INT3 J2 pin 21 INTA J2 pin 33 INT5 P12 DRQO J2 pin 5 used by BirdBox A as output for LED EE HWD INT6 P13 DRQ1 J2 pin 11 NML J2 pin 7 Six of these external interrupt inputs INTO 4 and NMI are buffered by Schmitt trigger inverters U9 in order to increase noise immunity and transform slowly changing input signals to fast changing and jitter free signals As a result of this buffering these pins are capable of only acting as input 3 1 BirdBox A Chapter 3 Hardware INT4 32 33 INT4 U2 52 U9A O INT2 J2 19 INT2 U2 54 U9B O INTO 32 8 INTO U2 56 U9C O IINT1 2 6 INT1 U2 55 U9D O INT3 J2 21 INT3 U2 53 U9E O NMI J2 7 NMI U2 47 U9F O Figure 3 1 External interrupt in
56. er 4 Software particular interrupt should be enabled or disabled The second argument is a function pointer which will act as the interrupt service routine By default the interrupts are all disabled after initialization To disable them again you can repeat the call but pass in 0 as the first argument The NMI Non Maskable Interrupt is special in that it can not be masked disabled The default ISR will return on interrupt t0_ini igned t1 ini igned t2 ini igned t3_ini igned t4 ini igned t5_ini igned ned void void void void void A har i void i de i i void i i i i i n har i void har i void har i void interru i i i har i void i i i i i p terrup terrup terrup terrup har i void terrup har i void p ned char i void p ned char i void terrup ned char i void interrup terrupt far nmi_isr void void void void void terru terru Q0 050 0 0 0 gt 0 0 00 H H H H H H H H H H n n n n n n n n n n 999292292 e A S 4 2 3 I O Initialization Two ports of 16 I O pins each are available on the BirdBox A Hardware details regarding these PIO lines can be found in the Hardware chapter Several functions are provided for access to the PIO lines At the beginning of any application where you choose to use the PIO pins as input output you will probably need to initialize these pins in one of the four
57. er to your PC Overview e Connect PC V25 cable For debugging Step One place ICD connector on SERO with red edge of cable at pin 1 e Connect wall transformer Connect 9V wall transformer to power and plug into power jack 2 2 1 Connecting the BirdBox A to the PC The following diagram Figure 2 1 illustrates the connection between the BirdBox A and the PC The BirdBox A is linked to the PC via a serial cable PC V25 The TDREM_AE DEBUG ROM communicates through SERO by default Install the 5x2 IDC connector to the SERO header IMPORTANT Note that the red side of the cable must point to pin I of the H1 header The DB9 connector should be connected to one of your PC s COM Ports COM1 or COM2 power jack RED side of serial To SERO cable corresponding for debugging to pin of headers for SERO SER 1 To COM1 or COM2 connector BirdBox A Pin 1 of 9 pin connector SERO Figure 2 1 Connecting the BirdBox A to the PC 2 1 Chapter 2 Installation BirdBox A 2 2 2 Powering on the BirdBox A Connect a wall transformer 9V DC output to the DC power jack at H4 The red on board LED located on the bottom side of the board should blink twice and remain on after the BirdBox A is powered on or reset Figure 2 2 Wall transformer 1 e H2 J15
58. g Conversion 4 7 4 2 7 Other Library Functions 4 7 4 3 Functions in BB LIB oseere 4 9 4 4 Functions in SERO OBJ SER1 OBJ 4 10 4 5 Functions in SCC OBJ SCCI OBJ 4 14 4 6 Functions in AEEE OBJ eee 4 17 Appendices A BirdBox A Layout A 1 B UART SCC2691 cococnccccnocnconnnonanncnanan nne B 1 C RTC7242 1 72423 iii iaa C 1 D Serial EEPROM Map oee D 1 E Software Glossary s E 1 E mr i saciid ae eE F 1 G RJ11 DB9 Cable ooonocconocccnocccnonncconccnnno G 1 Schematics BirdBox A BirdBox A Chapter 1 Introduction Chapter 1 Introduction 1 1 Functional Description The BirdBox A BB A is a low cost universal communication unit The system supports up to four serial ports Two UARTs from the CPU Am188ES SERO and SER1 and two optional SCC2691 UARTs are provided on the BB A RS232 drivers are provided for the two CPU UARTs The SCC2691 UARTs can be supported separately with either RS232 or RS 485 drivers All four UARTs have 10 pin headers as default or RJ 11 DB9 connectors can optionally be installed as part of the BB Pack Keypad Telephone i 7 a Chai wel RS232C qe SCC2691 U8 Am188ES 40 MHz y RS232C RS232C SERI SCC2691 U02 PPI US PPI U16 High Voltage Outputs 7 LCD interface 12 bit ADC 11 12 bit DAC 2 Print Port Figure 1 1 Functional block
59. g the same pin high or low but is intended for use in flow control scc_send_e scc_rec_e sccl_send_e scc1_rec_e Arguments none 4 16 BirdBox A Chapter 4 Software Return value none This function enables transmission or reception on the SCC2691 UART After initialization both of these functions are disabled by default If you are using RS485 only one of these two functions should be enabled at any one time scc_send_reset scc_rec_reset sccl_send_reset sccl_rec_reset Arguments none Return value none This function resets the state of the send and receive function of the SCC2691 One major use of these functions is to disable transmit and receive If you are using RS485 you will need to use this feature when transitioning from transmission to reception or from reception to transmission Transmission and reception of data using the SCC is in most ways identical to SERO and SER1 The functions used to transmit and receive data are similar For details regarding these functions please refer to the previous section putser_scc putser_sccl See putsern putsers_scc putsers_sccl See putsersn getser_scc getser_sccl See getsern getsers_scc getsers_sccl See getsersn Flow control is also handled in a mostly similar fashion The CTS pin corresponds to the MPI pin which is not connected to either one of the headers The RTS pin corresponds to the MPO pin found on the J1 header scc_cts secl_
60. h an I O pin and serial access allows a conversion rate of up to approximately 10 KHz In order to operate the TLC2543 five I O lines are used as listed below ICS Chip select PPI 120 high to low transition enables DOUT DIN and CLK Low to high transition disables DOUT DIN and CLK DIN PPI 121 serial data input DOUT P11 of Am188ES 3 state serial data output EOC Not Connected End of Conversion high indicates conversion complete and data is ready CLK T O clock PPI 122 REF Upper reference voltage normally VCC REF Lower reference voltage normally GND VCC Power supply 5 V input GND Ground The analog inputs ADO to AD10 REF GND and VCC are available at HO The inputs AD7 to AD10 are also available at the DB25 connector J6 3 5 6 Dual 12 bit DAC The LTC1446 LTC1446L is a dual 12 bit digital to analog converter DAC in an SO 8 package It is complete with a rail to rail voltage output amplifier an internal reference and a 3 wire serial interface 3 12 BirdBox A Chapter 3 Hardware The LTC1446 outputs a full scale of 4 096V making 1 LSB equal to 1 mV The LTC1446L outputs a full scale of 2 5 V making 1 LSB equal to 0 61 mV The buffered outputs can source or sink 5 mA The outputs swing to within a few millivolts of supply rail when unloaded They have an equivalent output resistance of 40 Q when driving a load to the rails The buffer amplifiers can drive 1000 pf without going into oscillation
61. imer2 behaves like the other timers except it only has one max counter available 4 2 5 Analog to Digital Conversion The ADC unit provides 11 channels of analog inputs based on the reference voltage supplied to REF For details regarding the hardware configuration see the Hardware chapter In order to operate the ADC lines 120 121 122 from the PPI must be configured as output P11 must also be configured to be input This line is also shared with the RTC and EEPROM and left high at power on reset You should be sure not to re program these pins for your own use Be careful when using the EEPROM concurrently with the ADC If the ADC is enabled the line P11 will be reserved for its use and any attempt to access the EEPROM will time out after some time For a sample file demonstrating the use of the ADC please see ae_ad12 c in tern 186 samples ae int ae_ad12 Arguments char c Return values int ad_value The argument c selects the channel from which to do the next Analog to Digital conversion A value of 0 corresponds to channel ADO 1 corresponds to channel AD1 and so on The return value ad_value is the latched in conversion value from the previous call to this function This means each call to this function actually returns the value latched in from the previous analog to digital conversion For example this means the first analog to digital conversion done in an application will be similar to the following ae_ad12 0 Rea
62. int datl int dat2 ae h Sets output of channel A of DAC to datl and channel b of DAC to dat2 value These data values range from 0 4095 each unit representing 1 mV 4 905 V maximum output Reference ae_da c E 4 Appendix E Software Glossary void bba_hv char ch char dat BirdBox A bba h Setup high voltage output for channel 0 7 to either high dat 1 or low dat 0 Reference void io_wait char wait ae h Setup I O wait states for I O instructions Var wait wait duration 0 7 wait 0 wait states 0 I O enable for 100 ns wait 1 wait states 1 I O enable for 100 25 ns wait 2 wait states 2 I O enable for 100 50 ns wait 3 wait states 3 I O enable for 100 75 ns wait 4 wait states 5 I O enable for 100 125 ns wait 5 wait states 7 1 0 enable for 100 175 ns wait 6 wait states 9 I O enable for 100 225 ns wait 7 wait states 15 I O enable for 100 375 ns Reference void rtc_init unsigned char time Sets real time clock date year and time Var time time and date string String sequence is the following time 0 weekday time 1 yearl0 time 2 yearl time 3 mon10 time 4 monl time 5 dayl0 time 6 dayl time 7 hourl0 time 8 hourl time 9 min10 time 10 minl time 11 secl10 time 12 secl unsigned char time 2 9 8 0 7 0 1 1 3 1 0 2 0 Tuesday July 01 1998 13 10 20 Reference rtc_init
63. irectional and having 3 State ICEN Chip enable active low input WRN Write strobe active low input RDN Read strobe active low input A0 A2 Address input active high address input to select the UART registers RESET Reset active high input INTRN Interrupt request active low output X1 CLK Crystal 1 crystal or external clock input X2 Crystal 2 the other side of crystal RxD Receive serial data input TxD Transmit serial data output MPO Multi purpose output MPI Multi purpose input Vec Power supply 5 V input GND Ground 2 Register Addressing i N i Note ACR Auxiliary control register BRG Baud rate generator CR Command register CSR Clock select register CTL Counter timer lower CTLR Counter timer lower register CTU Counter timer upper CTUR Counter timer upper register MR Mode register SR Status register RHR Rx holding register THR Tx holding register 3 Register Bit Formats MRI Mode Register 1 BirdBox A RxINT Error _ Parity Mode___ Parity Type Bits per Character 0 RxRDY 0 char 00 with parity 0 Even 1 FFULL 1 block 01 Force parity 1 Odd 10 No parity 11 Special mode In Special mode 0 Data 1 Addr B 1 00 5 01 6 10 7 11 8 BirdBox A Appendix B UART SCC2691 MR2 Mode Register 2 Channel Mode TxRTS CTS Enable Stop Bit Length Tx add 0 5 to cases 0 7 if channel is 5 bits character 00 Normal 0 0 563 4 0 813 8 1 563 C 1 813 01 Aut
64. le for your application use The EEPROM shares line P11 with the ADC If the ADC is enabled it can interfere with the EEPROM The ADC is enabled if 120 is low In the init function it is brought high so that you can access the EEPROM Be aware that if you modify the PPI control register by calling outportb 0x0103 xx then all of the output lines on the PPI are brought low including 120 which enables the ADC and disables the EEPROM If you need to use the EEPROM be sure to bring 120 high again to disable the ADC refer to the section on the EEPROM in chapter 3 ee_wr Arguments int addr unsigned char dat Return value int status This function is used to write the passed in dat to the specified addr The return value is 0 in success ee_rd Arguments int addr Return value int data This function returns one byte of data from the specified address 4 18 BirdBox A Appendix A BirdBox A Layout Appendix A BirdBox A Layout The layout of the BirdBox A is shown below All dimensions are in inches 3 46 3 69 3 33 3 59 0 62 3 08 329 y S RS232 U17 U014 Ga u02 3 42 2 27 0 22 2 09 fo oooooo 3 07 2 09 0 04 2 05 3 26 2 05 0 52 2 08 0 06 0 15 3 36 0 15 0 00 0 00 ee p 3 33 0 00 0 11 0 22 0 01 0 43 0 12 0 81 ats Appendix B UART SCC2691 Appendix B UART SCC2691 1 Pin Description D0 D7 Data bus active high bi d
65. le to interface with many slower external peripheral components If you require faster I O access you can modify this number down as needed Some TERN components such as the Real Time Clock might fail if the wait state is decreased too dramatically A function is provided for this purpose void io_wait Arguments char wait Return value none This function sets the current wait state depending on the argument wait wait 0 wait states 0 I O enable for 100 ns wait 1 wait states 1 I O enable for 100 25 ns wait 2 wait states 2 I O enable for 100 50 ns wait 3 wait states 3 I O enable for 100 75 ns wait 4 wait states 5 I O enable for 100 125 ns wait 5 wait states 7 1 0 enable for 100 175 ns wait 6 wait states 9 I O enable for 100 225 ns wait 7 wait states 15 I O enable for 100 375 ns 4 2 2 External Interrupt Initialization There are up to eight external interrupt sources on the BirdBox A consisting of seven maskable interrupt pins INT6 INTO and one non maskable interrupt NMI There are also an additional eight internal interrupt sources not connected to the external pins consisting of three timers two DMA channels both asynchronous serial ports and the NMI from the watchdog timer For a detailed discussion involving the ICUs the user should refer to Chapter 7 of the AMD Am188ES Microcontroller User s Manual TERN provides functions to enable disable all of the 8 external interrupts
66. low If your application requires a higher standard baud rate 115 200 for example it is possible to replace this crystal with a custom 3 6864 MHz crystal A sample file demonstrating how the software would be changed for this application is ae_scel c found in the tern 186 samples ae directory 150 300 600 1200 2400 4800 9600 default 19 200 31 250 62 500 125 000 250 000 ER 2 3 4 5 6 7 8 9 Unlike the other serial ports DMA transfer is not used to fill the input buffer for SCC Instead an interrupt service routine is used to place characters into the input buffer If the processor does not respond to the interrupt because it is masked for example the interrupt service routine might never be able to complete this process Over time this means data might be lost in the SCC as bytes overflow Special control registers are used to define how the SCC operates For a detailed description of registers MRI and MR2 please see Appendix B of this manual In most TERN applications MR1 is set to 0x57 4 15 BirdBox A Chapter 4 Software and MR2 is set to 0x07 This configures the SCC for no flow control RTS CTS not used checked no parity 8 bit normal operation Other configurations are also possible providing self echo even odd parity up to 2 stop bits 5 bit operation as well as automatic hardware flow control Initialization occurs in a manner otherwise similar to SERO and SER1 A COM structure is once ag
67. might actually be multiple null characters in the byte array and the returned value is the only definite indicator of the number of bytes read Normally we suggest that the getsers and putsers functions only be used with ASCII character strings If you are working with byte arrays the single byte versions of these functions are probably more appropriate Miscellaneous Serial Communication Functions One thing to be aware of in both transmission and receiving of data through the serial port is that TERN drivers only use the basic serial port communication lines for transmitting and receiving data Hardware flow control in the form of CTS Clear To Send and RTS Ready To Send is not implemented There are however functions available that allow you to check and set the value of these I O pins appropriate for whatever form of flow control you wish to implement Before using these functions you should once again be aware that the peripheral pin function you are using might not be selected as needed For details please refer to the Am188ES User s Manual char sn_cts void Retrieves value of CTS pin void sn_rts char b Sets the value of RTS to b Completing Serial Communications After completing your serial communications there are a few functions that can be used to reset default system resources sn_close Arguments COM c Return value none This closes down the serial port by shutting down the hardware as well as disabling
68. o echo 1 0 625 5 0 875 9 1 625 D 1 875 10 Local loop 2 0 688 6 0 938 A 1 688 E 1 938 11 Remote loop 3 0 750 7 1 000 B 1 750 F 2 000 CSR Clock Select Register Receiver Clock Select Transmitter Clock Select when ACR 7 0 when ACR 7 0 0 50 1 110 2 134 5 3 200 0 50 1 110 2 134 5 3 200 4 300 5 600 6 1200 7 1050 4 300 5 600 6 1200 7 1050 8 2400 9 4800 A 7200 B 9600 8 2400 9 4800 A 7200 B 9600 C 38 4k D Timer E MPI 16x F MPI 1x C 38 4k D Timer E MPI 16x F MPI 1x when ACR 7 1 when ACR 7 1 0 75 1 110 2 134 5 3 150 0 75 1 110 2 134 5 3 150 4 300 5 600 6 1200 7 2000 4 300 5 600 6 1200 7 2000 8 2400 9 4800 A 7200 B 1800 8 2400 9 4800 A 7200 B 1800 C 19 2k D Timer E MPI 16x F MPI 1x C 19 2k D Timer E MPI 16x F MPI 1x CR Command Register Miscellaneous Commands Disable Enable Disable Enable Tx Tx Rx Rx 0 no command 8 start C T 0 no 0 no 0 no 0 no 1 reset MR pointer 9 stop counter l yes 2 reset receiver A assert RTSN 3 reset transmitter B negate RTSN 4 reset error status C reset MPI 5 reset break change change INT INT D reserved 6 start break E reserved 7 stop break F reserved SR Channel Status Register Received Framing Parity Overrun TxEMT TxRDY FFULL RxRDY Break Error Error Error Note These status bits are appended to the corresponding data character in the receive FIFO A read of the status register provides these bits
69. ock RTC72423 If installed a real time clock RTC72423 EPSON U4 is mapped in the I O address space at 0x0600 It must be backed up with a lithium coin battery The RTC is accessed via software drivers rtc_init or rtc_rd see Appendix C and the Software chapter for details It is also possible to configure the real time clock to raise an output line attached to an external interrupt at 1 64 second second minute or hour intervals This can be used in a time driven application or the VOFF signal can be used to turn on off the controller using the switching power supply Details regarding the switching power supply can be found in section 3 5 8 An example of a program showing a similar application can be found in tern v25 samples ve poweroff c 3 4 4 UART SCC2691 Serial Ports There are two UART SCC2691s Signetics U8 U02 mapped into the I O address space The first U8 is mapped into I O space at 0x0500 The second UART is mapped into I O space at 0x0200 Software interfaces for both are provided and are described in the Software chapter The SCC2691 has a full duplex asynchronous receiver transmitter a quadruple buffered receiver data register an interrupt control mechanism programmable data format selectable baud rate for the receiver and transmitter a multi functional and programmable 16 bit counter timer an on chip crystal oscillator and a multi purpose input output including RTS and CTS mechanism MPO and MPI are routed
70. power consumption and heat dissipation thereby extending battery life in portable systems In power save mode operation of the CPU and internal peripherals continues at a slower clock frequency When an interrupt occurs it automatically returns to its normal operating frequency The RTC72423 on the BirdBox A has a VOFF signal routed to J1 pin 9 VOFF is controlled by the battery backed RTC72423 The VOFF signal can be programmed by software to be in tri state or to be active low The RTC72423 can be programmed in interrupt mode to drive the VOFF pin at 1 64 second 1 second minute or hour intervals The user can use the VOFF line to control the external switching power supply that turns the power supply on off More details are available in the sample file poweroff c in the 186 samples ae sub directory 3 3 BirdBox A Chapter 3 Hardware 3 3 Am188ES PIO lines The Am188ES has 32 pins available as user programmable I O lines Each of these pins can be used as a user programmable input or output signal if the normal shared function is not needed A PIO line can be configured to operate as an input or output with or without a weak pull up or pull down or as an open drain output A pin s behavior either pull up or pull down is pre determined and shown in the table below After power on reset PIO pins default to various configurations The initialization routine provided by TERN libraries reconfigures some of these pins as needed for sp
71. puts The BirdBox A uses vector interrupt functions to respond to external interrupts Refer to the Am188ES User s manual for information about interrupt vectors 3 2 3 Asynchronous Serial Ports The Am188ES CPU has two asynchronous serial channels SERO and SER1 Both asynchronous serial ports support the following Full duplex operation 7 bit 8 bit and 9 bit data transfers Odd even and no parity One stop bit Error detection Hardware flow control DMA transfers to and from serial ports Transmit and receive interrupts for each port Multidrop 9 bit protocol support Maximum baud rate of 1 16 of the CPU clock speed Independent baud rate generators The software drivers for each serial port implement a ring buffered DMA receiving and ring buffered interrupt transmitting arrangement See the samples files s1_echo c s0_echo c for details There are two optional external SCC2691 UARTs located on the BB A One U8 is located underneath the U3 ROM socket The other is at location U02 There are software interfaces given for interfacing to both For more information about the external UART SCC2691 please refer to section 3 4 4 and Appendix B 3 2 BirdBox A Chapter 3 Hardware 3 2 4 Timer Control Unit The timer counter unit has three 16 bit programmable timers Timer0 Timerl and Timer2 TimerO and Timer are connected to four external pins Timer0 output P10 J2 pin 12 Timer0 input P11 J2 pin 14 Timer output
72. r save mode which reduces clock speed Timers and serial ports will be effected Disabled by external interrupt Var i 1 enables power save only Does not disable Reference ae_pwr c void clka_en int i ae h Enables signal CLK respectively for external peripheral use Var i 1 enables clock output 0 disables saves current when disabled Reference void hitwd void ae h Hits the watchdog timer using P03 P03 must be connected to WDI of the MAX691 supervisor chip Reference See Hardware chapter of this manual for more information on the MAX691 void pio_init char bit char mode ae h Initializes a PIO line to the following mode 0 Normal operation mode 1 Input with pullup down mode 2 Output mode 3 input without pull Var bit PIO line 0 31 Mod above mode select Reference ae_pio c E 2 BirdBox A Appendix E Software Glossary void pio_wr char bit char dat Writes a bit to a PIO line PIO line must be in an output mode mode 0 Normal operation mode 1 Input with pullup down mode 2 Output mode 3 input without pull Var bit PIO line 0 31 dat 1 0 Reference ae_pio c unsigned int pio_rd char port Reads a 16 bit PIO port Vats pont 04 RIO 0 15 Ls PTO I6 31 Reference ae_pio c ae h ae h void outport int portid int value Writes 16 bit value to I O address portid Var portid I O address value 16 bit value Reference ae_ppi c dos h
73. ransmit a character string You can put data into the transmit ring buffer s1_out_buf at any time using this method The transmit ring buffer address obuf and buffer length osiz are also specified at the time of initialization The transmit interrupt service will check the availability of data in the transmit buffer If there is no more data the head and tail pointers are equal it will disable the transmit interrupt Otherwise it will continue to take out the data from the out buffer and transmit After you call putserl and transmit functions you are free to do other tasks with no additional software overhead on the transmitting operation It will automatically send out all the data you specify After all data has been sent it will clear the busy flag and be ready for the next transmission The sample program ser1_0 c demonstrates how a protocol translator works It would receive an input HEX file from SER1 and translate every character to The translated HEX file is then transmitted out of SERO This sample program can be found in tern 186 samples ae Software Interface Before using the serial ports they must be initialized There is a data structure containing important serial port state information that is passed as argument to the TERN library interface functions The COM structure should normally be manipulated only by TERN libraries It is provided to make debugging of the serial communication ports more practical
74. rdBox A 1 2 Features Standard Features Dimensions 4 80 x 3 72 x 1 50 inches with enclosure Easy to program in Borland C C Power consumption 190 130 mA at 5V for 40 20 MHz Power saving mode 60 40 mA at 5V for 40 20 MHz Power input 8 5V to 35 V unregulated DC or 5V regulated DC Temperature range 40 C to 85 C 16 bit CPU Am188ES Intel 80x86 compatible High performance zero wait state operation at 40 MHz Up to 512KB Flash ROM 2 high speed PWM outputs and Pulse Width Demodulation 32 I O lines from Am188ES 512 byte serial EEPROM 8 external interrupt inputs three 16 bit timer counters Two CPU UARTs RS232 Supervisor chip 691 for power failure reset and watchdog 48 additional bi directional I O lines from two PPI 82C55 Interface for LCD keypads and slave CPU operation Seven channels of solenoid sinking drivers default or eight channels sourcing drivers Parallel port printer interface Optional Features surface mounted components 1 2 32KB 128KB or 512KB SRAM 11 channels of 12 bit ADC sample rate up to 10 KHz 2 channels of 12 bit DAC 0 4 095V output Two SCC2691 UARTs on board support 8 bit or 9 bit networking UARTs come with RS232 default or 485 drivers Real time clock RTC72423 lithium coin battery BB Pack 16 characters x 2 lines LCD display Beeper LEDs interrupt driven 4 x 3 keypad DB25 connector for parallel port DB9 RJ11 phone jack connectors for serial ports Al
75. rnal environment serial input data will automatically fill in the buffer circularly without stopping regardless of overwrite If the user does not take out the data from the ring buffer with getserl before the ring buffer is full new data will overwrite the old data without warning or control Thus it is important to provide a sufficiently large buffer if large amounts of data are transferred For example if you are receiving data at 9600 baud a 4 KB buffer will be able to store data for approximately four seconds BirdBox A Chapter 4 Software However it is always important to take out data early from the input buffer before the ring buffer rolls over You may designate a higher baud rate for transmitting data out and a slower baud rate for receiving data This will give you more time to do other things without overrunning the input buffer You can use serhit1 to check the status of the input buffer and return the offset of the in_head pointer from the in_tail pointer A return value of 0 indicates no data is available in the buffer You can use getserl to get the serial input data byte by byte using FIFO from the buffer The in_tail pointer will automatically increment after every getserl call It is not necessary to suspend external devices from sending in serial data with RTS Only a hardware reset or s1_close can stop this receiving operation For transmission you can use putserl to send out a byte or use putsers1 to t
76. s characters than the length requested str will contain only the remaining characters from the buffer Appends a 0 character to the end of str Returns the retrieved string length Var c pointer to serial port structure len desired string length str pointer to output character string Reference ser1 h ser0 h for prototype E 10 Appendix F Enclosure BirdBox A Appendix F Enclosure The BirdBox A enclosure optional is shown below Figure 1 1 through Figure 1 6 The material used is anodized sheet aluminum with a maximum sheet thickness of 0 05 inch VIEW D 1 550 O D Outside Dimension I D Inside Dimension All hole diameters 0 15 inch Figure 1 1 Upper half of the enclosure BirdBox A Appendix F Enclosure VIEW C 3 620 L D D 0 35 hole DB25 4 54 1 D VAN DYKE FAB JOHN Tel 916 344 5221 FAX 916 344 2610 Figure 1 2 Lower half of the enclosure F 2 Appendix F Enclosure BirdBox A View D dimensions VIEW D 0 245 1 036 1 486 Figure 1 3 View D of the enclosure F 3 BirdBox A View C dimensions VIEW C Appendix F Enclosure 4 540 O D 0 350 1 81 LA Figure 1 4 View C of the enclosure F 4 Appendix F Enclosure BirdBox A Side view A dimensions VIEW A
77. sition occurs at the WDI pin of the MAX691 When controllers are shipped from the factory the J9 jumper is off which disables the watchdog timer The Am188ES has an internal watchdog timer This is disabled by default with ae_init Battery Backup Protection The backup battery protection protects data stored in the SRAM and RTC The battery switch over circuit compares VCC to VBAT 3 V lithium battery positive pin and connects whichever is higher to the VRAM power for SRAM and RTC backing up the SRAM and the real time clock RTC72423 In normal use the lithium battery should last about 3 5 years without external power being supplied When the external power is on the battery switch over circuit will select the VCC to connect to the VRAM 3 11 BirdBox A Chapter 3 Hardware 3 5 4 EEPROM A 512 byte serial EEPROM 24C04 is installed in U7 The BirdBox A uses the P12 SCL serial clock and P11 SDA serial data to interface with the EEPROM The EEPROM can be used to store important data such as a node address calibration coefficients and configuration codes It typically has 1 000 000 erase write cycles The data retention is more than 40 years EEPROM can be read and written by simply calling the functions ee_rd and ee_wr A range of lower addresses in the EEPROM is reserved for TERN use Details regarding which addresses are reserved and for what purpose can be found in Appendix D of this manual 3 5 5 12 bit ADC TLC2543
78. structure should be allocated by the user This function returns O on success and returns 1 in case of error such as the clock failing to respond void rtc_init Arguments char t Return value none This function is used to initialize and set a value into the real time clock The argument t should be a null terminated byte array that contains the new time value to be used The byte array should correspond to weekday yearl0 yearl month10 month1 day10 day1 hour10 hourl minutel0 minutel second10 second O If for example the time to be initialized into the real time clock is June 5 1998 Friday 13 55 30 the byte array would be initialized to unsigned char t 14 Delay In many applications it becomes useful to pause before executing any further code There are functions provided to make this process easy For applications that require precision timing you should use hardware timers provided on board for this purpose void delay0 Arguments unsigned int t Return value none This function is just a simple software loop The actual time that it waits depends on processor speed as well as interrupt latency The code is functionally identical to While t t Passing in a t value of 600 causes a delay of approximately 1 ms void delay_ms Arguments unsigned int Return value none This function is similar to delay0 but the passed in argument is in units of milliseconds instead of loop iterations
79. system some components need to be attached to I O pins directly For details regarding the chip select unit please see Chapter 5 of the Am188ES User s Manual The table below shows more information about I O mapping VO space Select Location Usage Ox0000 Ox00ff PCSO Jl pin 19 P16 PPI U16 0x0100 0x01ff PCS1 J2pin13 P17 PPI U5 0x0200 0x02ff PCS2 J2 pin UART U02 22 CTS1 0x0300 0x03ff PCS3 J2 pin 74HC259 U18 31 RTS1 0x0400 0x04ff PCS4 Reserved 0x0500 0x05ff PCS5 J2pin15 P3 UART U8 0x0600 0x06ff PCS6 J2pin24 P2 RTC 72423 Some of the above chip select lines are free for use if optional components are not installed This includes PCS2 PCS5 and PCS6 In applications where the high voltage output HV0 HV7 is not used the latch U18 is not necessary That allows chip select line PCS3 to be used for any user application as well To illustrate how to interface the BirdBox A with external I O boards a simple decoding circuit for interfacing to a 82C55 parallel I O chip is shown below in Figure 3 2 3 6 BirdBox A Chapter 3 Hardware 82055 74HC138 AS P00 P07 A6 A7 SEL60 SEL80 SELAO SELCO SELFO SEL20 CS P10 P17 PCS3 P20 P27 Figure 3 2 Interface the BirdBox A to external I O devices The function ae_init by default initializes the PCS3 line at base I O address starting at 0x300 You can read from the 82C55 with inportb 0x320 or write to the
80. ta output can be tri state while disabled P12 DRQO INTS Output for LED or U7 serial EE clock or Hit watchdog P16 PCSO U16 PPI chip select at base I O address 0x0000 LCD Header P17 PCS1 U5 PPI chip select at base I O address 0x0100 Parallel Port P18 CTS1 PCS2 U02 SCC2691 UART chip select at base I O address 0x0200 3 5 BirdBox A Chapter 3 Hardware Signal Pin Function P19 RTS1 PCS3 U18 Latch at base I O address 0x0300 High Voltage Outputs P22 TxDO Default SERO debug P23 RxDO Default SERO debug INTO J2 pin2 U8 SCC2691 UART interrupt INT J2 pin6 U02 SCC2691 UART interrupt Table 3 2 I O lines used for on board components 3 4 T O Mapped Devices 3 4 1 I O Space External I O devices can use I O mapping for access You can access such I O devices with inportb port or outportb port dat These functions will transfer one byte or word of data to the specified I O address The external I O space is 64K ranging from 0x0000 to Oxffff The default I O access time is 15 wait states You may use the function void io_wait char wait to define the I O wait states from 0 to 15 The system clock is 25 ns or 50 ns giving a clock speed of 40 MHz or 20 MHz Details regarding this can be found in the Software chapter and in the Am188ES User s Manual Slower components such as most LCD interfaces might find the maximum programmable wait state of 15 cycles still insufficient Due to the high bus speed of the
81. the interrupt clean_sern Arguments COM c Return value none 4 14 BirdBox A Chapter 4 Software This flushes the input buffer by resetting the tail and header buffer pointers The asynchronous serial I O ports available on the Am188ES Processor have many other features that might be useful for your application If you are truly interested in having more control please read Chapter 10 of the manual for a detailed discussion of other features available to you 4 5 Functions in SCC OBJ SCC1 OBJ The functions found in this object file are prototyped in scc h and sccel h in the tern 186 include directory The SCC is a component that is used to provide an asynchronous port It uses a 8 MHz crystal different from the system clock speed for driving serial communications This means the divisors and function arguments for setting up the baud rate for this third port are different than for SERO and SER1 On the BirdBox A there are two SCC2691 serial ports provided The first located at position U8 is accessed using functions prefixed with sec_ The second SCC2691 not available on other controllers like the BirdBox and TD40 located at position U02 is accessed using identical functions prefixed with secl_ Each SCC2691 component has its own 8 MHz crystal providing the clock signal By default these are set to 8 MHz to be consistent with earlier TERN controller designs The highest standard baud rate is 19 200 as shown in the table be
82. ticular range of memory will be used to activate appropriate chip select lines and the corresponding hardware component responsible for handling this data peek peekb Arguments unsigned int segment unsigned int offset Return value unsigned int unsigned char data 4 BirdBox A Chapter 4 Software These functions retrieve the data for a specified address in memory space Once again the segment address is shifted left by four bits and added to the offset to find the 20 bit address This address is then output over the address bus and the hardware component mapped to that address should return either an 8 bit or a 16 bit value over the data bus If there is no component mapped to that address this function will return random garbage values every time you try to peek into that address outport outportb Arguments unsigned int address unsigned int unsigned char data Return value none This function is used to place the data into the appropriate address in I O space It is used most often when working with processor registers that are mapped into I O space and must be accessed using either one of these functions This is also the function used in most cases when dealing with user configured peripheral components When dealing with processor registers be sure to use the correct function Use outport if you are dealing with a 16 bit register inport inportb Arguments unsigned int address Return value unsigned int unsigned char data
83. ts for BirdBox A System Development 1 5 1 Minimum Hardware Requirements e PC or PC compatible computer with serial COMx port that supports 115 200 baud e BirdBox A controller with DEBUG ROM TDREM_AE 1 6 BirdBox A Chapter 1 Introduction e PC V25 serial cable RS232 DB9 connector for PC COM port and IDC 2x5 connector for controller e center negative wall transformer 9V 500 mA 1 5 2 Minimum Software Requirements e TERN EV DV Kit installation diskettes e PC software environment DOS Windows 3 1 Windows95 or Windows98 The C C Evaluation Kit EV and C C Development Kit DV are available from TERN The EV Kit is a limited functionality version of the DV Kit With the EV Kit you can program and debug the BirdBox A in Step One and Step Two but you cannot run Step Three In order to generate an application ROM Flash file make production version ROMs and complete the project you will need the Development Kit DV 1 7 BirdBox A Chapter 2 Installation Chapter 2 Installation 2 1 Software Installation Please refer to the Technical manual for the C C Development Kit and Evaluation Kit for TERN Embedded Microcontrollers for information on installing software The README TXT file on the TERN EV DV disk contains important information about the installation and evaluation of TERN controllers 2 2 Hardware Installation Hardware installation for the BirdBox A consists primarily of connecting the microcontroll
84. uffer offset nt out_segm output buffer segment nt out_offs output buffer offset har byte_delay V25 macro service byte delay Q P RPRP0000000 sn_init Arguments unsigned char b unsigned char ibuf int isiz unsigned char obuf int osiz COM e Return value none This function initializes either SERO or SER1 with the specified parameters b is the baud rate value shown in Table 4 1 Arguments ibuf and isiz specify the input data buffer and obuf and osiz specify the location and size of the transmit ring buffer The serial ports are initialized for 8 bit 1 stop bit no parity communication There are a couple different functions used for transmission of data You can place data within the output buffer manually incrementing the head and tail buffer pointers appropriately If you do not call one of the following functions however the driver interrupt for the appropriate serial port will be disabled which means that no values will be transmitted This allows you to control when you wish the transmission of data within the outbound buffer to begin Once the interrupts are enabled it is dangerous to manipulate the values of the outbound buffer as well as the values of the buffer pointer putsern Arguments unsigned char outch COM c Return value int return_value This function places one byte outch into the transmit buffer for the appropriate serial port The return value returns one in case
85. uminum sheet metal enclosure BirdBox A Chapter 1 Introduction 1 3 Physical Description The physical layout of the BirdBox A is shown in Figure 1 2 High Power jack SERO SER1 RS232 9V to 12V for linear regulator voltage RS232 RS232 RS485 9V to 35V for switching regulator Drivers for U02 High o voltage H5 PPI U16 Drivers o LCD o Linear or switching regulator a o contrast Data address ul control Battery bus PIO pins pa Beeper Am188ES Watchdog enable lt A Red LED ADC DAC ere Green LED power reset 0000000 0 00 0 00 PZ ee PPI U5 Keypad RS485 Reset Printer Port RS232 for U8 Figure 1 2 Physical layout of the BirdBox A 1 3 Chapter 1 Introduction BirdBox A 1 4 BirdBox A Programming Overview Development of application software for the BirdBox A consists of three easy steps as shown in the block diagram below STEP 1 Serial link PC and BirdBox A program in C C Debug C C program on the i386 Drive with Remote Debugger gt STEP 2 Test BirdBox A in the field away from PC Application program resides in the battery backed SRAM STEP 3 Make application ROM or Download to Flash Replace DEBUG ROM project is complete You can program the BirdBox A from your PC via serial link with an RS232 interface Your C C program can be remotely debugged over the serial link at a rate of 115 000 baud The C C Evaluation Kit EV or Development Kit DV from TE
86. us I O pins interrupt vectors sets up expanded DOS I O and provides other processor specific updates needed at the beginning of every program There are certain default pin modes and interrupt settings you might wish to change With that in mind the basic effects of ae_init are described below For details regarding register use you will want to refer to the AMD Am188ES Microcontroller User s manual e Initialize the upper chip select to support the default ROM The CPU registers are configured such that Address space for the ROM is from 0x80000 Oxfffff to map MemCard I O window 512K ROM Block size operation Three wait state operation allowing it to support up to 120 ns ROMs With 70 ns ROMs this can actually be set to zero wait state if you require increased performance at a risk of stability in noisy environments For details see the UMCS Upper Memory Chip Select Register reference in the processor User s manual outport Oxffa0 Ox80bf UMCS 512K ROM 0x80000 Oxfffff e Initialize LCS Lower Chip Select for use with the SRAM It is configured so that Address space starts 0x00000 with a maximum of 512K RAM 0 wait state operation Disables PSRAM and disables need for external ready outport Oxffa2 Ox7fbc LMCS base Mem address 0x0000 e Initialize MMCS and MPCS so that MCSO and PCS0 PCS6 except for PCS4 are configured so MCS0 is mapped also to a 256K window at 0x80000
87. y using a jumper to connect pins 1 VS and 3 GND on header H6 If you are expecting to sink a large amount of current you will have to connect this ground signal to an external ground using a heavy gauge 20 wire GK connects to the protection diodes in the ULN2003 chip and should be tied to highest voltage in the external load system GK can be connected to an unregulated on board 12VI signal by connecting H6 pins 2 and 4 by jumper ULN2003 is a sinking driver not a sourcing driver An example of typical application wiring is shown below 3 13 BirdBox A Chapter 3 Hardware Solenoid Power Supply GND SUB J6 or J7 ULN2003 Birdbox A Figure 3 5 Drive inductive load with high voltage current drives ULN2003 The UDS2982 technical specifications available from http www allegromicro com can be installed to act as a sourcing driver providing eight channels It has an output current of up to 500 mA with a load supply voltage up to 50V Typical loads for this component include relays solenoids lamps stepper and or servo motors print hammers and LEDs The UDS2982 also integrates input current limiting resistors and output transient suppression diodes When the UDS2982 is used the signal VS must be connected to the load supply voltage This can be done by jumper connecting pins and 2 on header H6 to connect VS to the 12V input voltage GK acts as ground and should be connected using pins 3 and 4 on header H6
Download Pdf Manuals
Related Search
Related Contents
Samsung LA26A450C1N دليل المستخدم MACINADOSATORE AMM - AMMT NEC NC800C User Guide Manual Proceedings • INSTALLATION • FONCTIONNEMENT • ENTRETIEN GPS Personal Tracker 主 管 OP-001 仕様書 頁 開発センター 1.適用 2.概要 3.適合する Copyright © All rights reserved.
Failed to retrieve file