Page 228 of 229 Start Back Next End ZBasic Language Reference 218 ZBasic Microcontrollers Appendix N - Processor Resource Description Files The resource description files are XML files that contain information about some of the resources provided by a particular processor, e.g. registers and interrupt vectors. They are used by the compiler to determine the resources that are available for a particular target processor. The are also used by the ZBasic IDE to provide keyword information related to register names. In most cases, a single XML file contains resource information for multiple processors. When necessary, the resource descriptions contain attribute values to identify the processors to which the resource descriptions apply. The excerpt from an XML resource description file below illustrates how the information for several processors is represented in a single XML file. The first four lines of the XML excerpt define attributes that a particular processor may or may not have. For example, ATTR_TIMER3 indicates the presence of Timer3. Following the attribute definitions (which may or may not be present in a particular XML file), one or more target processors are defined. For example, the target M164 is defined and associated with the name “mega164” and having the attribute ATTR_USART1. Multiple attributes may be given for a target as illustrated with the M1284P target. Excerpt from an XML Resource Description File <Attribute>ATTR_USART1</Attribute> <Attribute>ATTR_PRR1</Attribute> <Attribute>ATTR_TIMER3</Attribute> <Attribute>ATTR_COMPAT_M32</Attribute> <Target name="mega164" attr="ATTR_USART1">M164</Target> <Target name="mega324" attr="ATTR_USART1">M324</Target> <Target name="mega644" attr="ATTR_COMPAT_M32">M644</Target> <Target name="mega644P" attr="ATTR_USART1,ATTR_COMPAT_M32">M644P</Target> <Target name="mega1284P" attr="ATTR_USART1,ATTR_PRR1,ATTR_TIMER3">M1284P</Target> <Registers> <Register8 address="0x0021">DDRA</Register8> <Register16 address="0x0086">ICR1</Register16> <Register16 address="0x0096" attr="ATTR_TIMER3">ICR3</Register16> <Register8 address="0x005b" target="M1284P">RAMPZ</Register8> </Registers> <Vectors> <Vector index="01" name="INT0_vect">INT0</Vector> <Vector index="28" name="USART1_RX_vect" attr="ATTR_USART1">USART1_RX</Vector> </Vectors> The excerpt further describes several registers using the <Register8> tag for 8-bit registers and the <Register16> tag for 16-bit registers. The register name given, e.g. DDRA, is the name used with the Register. prefix in ZBasic application code. The first two register descriptors apply to all targets while the third applies only to targets with the ATTR_TIMER3 attribute and the fourth applies only to the M1284P target. Note that a register description may be restricted to multiple targets by specifying multiple attribute values or multiple target identifiers, e.g. target=”M644P,M1284P”. The section defining the interrupt vectors is similar to the register description section in the way that attribute values and target names are used to restrict the applicability to certain processors. The name given in the vector descriptions, e.g. INT0, is the name used when defining an interrupt service routine in a ZBasic application. The table below lists the target devices described in the various XML resource description files. Note that for the mega and tiny series, target devices with A, P and PA suffixes are included along with devices with no suffix.