Projekt Project Hardware Hardware Bedienung Operation BASIC (1) BASIC (1) BASIC (2) BASIC (2) BASIC (3) BASIC (3) Interna Internals Beispiele Examples Erweiterungen Extensions Bibliotheken Libraries Treiber Driver Programme Programs Bezugsquellen: Where to buy: Bausatz Kit Leerplatine Empty board | AVR-ChipBasic2: Hardware AVR ChipBasic2: Hardware V1.45 (c) 2006-2012 Jörg Wolfram V1.45 (c) 2006-2012 Jörg Wolfram 1 Minimale Hardware 1 Minimum Hardware1.1 Schwarzweiss BAS Version 1.1 Black and White version BASFür eine minimale Beschaltung reicht schon ein Steckbrett, eine Streifenleiter- oder eine Lochrasterplatte aus. For a minimal wiring already enough a breadboard, a stripline or a breadboard. Lediglich die Steckverbinder passen in den meisten Fällen nicht. Only the connectors do not fit in most cases. Bei Problemen mit der Tastatur empfiehlt es sich, für die Clock (PB0) und Datenleitung (PD0) jeweils einen Pullup-Widerstan von ca. 4,7K vorzusehen. For problems with the keyboard, it is recommended that the clock (PB0) and data cable (PD0) provide respectively a pullup resis of approximately 4.7 K.![]() 1.2 Farbversion (SCART) 1.2 Color version (SCART)Damit lässt sich allerdings nur ein Graustufenbild ausgeben. So can spend only a grayscale image. Für Farbe auf dem TV benötigt man entweder einen FBAS-Encoder oder einen Scart-Anschluss. For color on the TV you need either a composite video encoder or a Scart connection. Letzterer ist die einfachere Lösung und lässt sich einfach realisieren. The latter is the easier solution and can be realized easily. Über den 180-Ohm-Widerstand an Pin 18 des Scart-Steckers wird dem TV mitgeteilt, dass es die RGB-Eingänge nutzen soll. About the 180-ohm resistor to pin 18 of the SCART connector to the TV is informed that it will use the RGB inputs. Bei manchen TVs mit mehreren Scart-Eingängen geht RGB nur am ersten, in dem Falle wird dann ein Graustufenbild dargestellt. Some TVs with multiple RGB scart input is only at the first, in which case it is a grayscale image shown.![]() 1.3 Die Universalversion 1.3 The Universal versionUm flexibler zu sein, wurde bei der Platine eine 9-polige SUB-D Buchse als Videoanschluss gewählt. In order to be more flexible, was on the board a 9-pin D-SUB connector is selected as video port. Hier können sowohl monochrom BAS, Scart, ein FBAS-Encoder oder auch ein PAL-/NTSC taugliches TFT angeschlossen werden. Here both monochrome BAS, Scart, a composite video encoder or a PAL-/NTSC compliant TFT are connected. Der Anschluss 9 der Buchse sollte nur bei Verwendung des CPLD-FBAS-Encoders belegt werden, da es andernfalls eventuell zu Bildstürungen kommen kann. The terminal 9 of the socket should only be taken when using the CPLD composite encoder, as this may possibly lead to Bildstürungen. Aus dem gleichen Grund dürfen an diesem Anschluss auch keine längeren Leitungen angeschlossen werden. For the same reason in this connection may no longer wires.![]()
2 Video-Adapter für den Uni-Anschluss 2 video adapter for the Uni port2.1 BAS-Signal 2.1 BAS signalDazu müssen einfach nur die Leitungen für das BAS-Signal (optional: Audio) und Masse angeschlossen werden. Just need only the lines for the composite signal (optional: Audio) and ground are connected. Hauptnachteil ist, dass die Darstellung nur in Schwarz/Weiss (Graustufen) erfolgt. Main disadvantage is that the display is only in black / white (grayscale).![]() 2.2 SCART-Anschluss 2.2 SCART connectorÜber den 180-Ohm-Widerstand an Pin 18 des Scart-Steckers wird dem TV wieder mitgeteilt, dass es die RGB-Eingänge nutzen soll. About the 180-ohm resistor to pin 18 of the SCART connector to the TV again advised that it should use the RGB inputs. Bei manchen TVs mit mehreren Scart-Eingängen geht RGB nur am ersten, in dem Falle wird dann bei Nutzung eines anderen Scart-Eingangs nur ein Graustufenbild dargestellt. In some multiple TVs scart input RGB is only on the first, in the case is then at a different use Scart input only a grayscale image shown.![]() 2.3 TFT-Display 2.3 TFT displayDas Beispiel zeigt beispielhaft den Anschluss von NTSC-TFT Displays, wie sie teilweise gebraucht oder als Ersatzteile erhältlich sind. The example shows an example of the connection of NTSC TFT displays as partially used or available as replacement parts. Die Beschaltung ist nur eine Minimalvariante, insbesondere fehlt jeder Schtz des Displays vor Signalausfällen. The wiring is only a minimal variant, especially the display lacks any Underload before dropouts. Kritisch ist dabei eigentlich das HSYNC Signal, fällt es aus (zB beim Flashen des Mikrocontrollers über die ISP-Schnittstelle oder bei Ausfall der 5V-Versorgung) kann es zu bleibenden Schäden am Display kommen. Is critical in this really the HSYNC signal, it fails (eg when flashing the microcontroller via the ISP interface or failure of the 5V supply) can cause permanent damage to the display.![]() 3 Die Schnittstellen 3 The interfacesNeben Tastatur, Video und ISP/SPI hat AVR-ChipBasic drei weitere Schnittstellen, um mit der "Aussenwelt" kommunizieren zu können. In addition to keyboard, video and ISP / SPI chip AVR Basic has three interfaces to communicate with the "outside world" can.![]() 3.1 Die serielle Schnittstelle 3.1 The serial interfaceDa der USART bereits für den Tastaturanschluss verwendet wird, wird die serielle Schnittstelle in Software realisiert. Since the USART is already being used for the keyboard port, the serial interface is implemented in software. Systembedingt lässt sich die TX(Sende)-Leitung aber nur 1 mal pro Bildschirmzeile aktualisieren. Depending on the system, the TX (transmit) line, but can only update 1 time per screen line. Daraus ergibt sich die recht niedrige Geschwindigkeit von nur 1200 bzw. 2400 Bps. Hence the rather low rate of only 1200 or 2400 bps. Im Gegensatz zu anderen Lösungen wird dafür kein extra Schnittstellen-IC benötigt. Unlike other solutions, it's not a double interface IC is required. Ein Timer-Ausgang bildet mit zwei Schottky-Dioden und zwei Kondensatoren eine Ladungspumpe, die ca. -4 V erzeugt. A timer output forms two Schottky diodes and two capacitors, a charge pump which generates approximately 4V. Diese liegt über einen Widerstand am TX-Anschluss an. This is connected via a resistor to TX port. Soll jetzt eine "0" ausgegeben werden, schaltet der Ausgang des Mikrocontrollers einen PNP-Transitor durch. If an output now "0", the output of the microcontroller by a PNP Transistor. Dadurch liegen am TX-Anschluss jetzt 5V (-Ucesat). This lie to TX port now 5V (-Ucesat).Empfangsseitig wird die Eingangsspannung mittels Vorwiderstand und zweier Schottky-Dioden auf 0..5V begrenzt. Receiving end, the input voltage is limited by the series resistor and two Schottky diodes to 0 .5 V. Das Signal am Portpin ist dadurch zwar negiert, da die Ausertung in Software erfolgt ist das aber kein Problem. The signal at the port pin is thus indeed negated because Ausertung is done in the software but not a problem. Alternativ lassen sich die Signalpegel auch so konfigurieren (Konfigurationsseite), dass ein "normaler" Schnittstellenwandler (zB MAX232) angeschlossen werden kann. Alternatively, the signal level also configure (Configuration page) that a "normal" interface converter (eg MAX232) can be connected. 3.2 Die zweite serielle Schnittstelle (nur ATMega644P) 3.2 The second serial interface (ATmega644P)Ab Version 1.25 kann auch die zweite serielle Schnittstelle des ATMega644P genutzt werden. From version 1.25, also the second serial port of the ATmega644P are used. Hier können zB Pegelwandler oder auch ein MIDI-Interface angeschlossen werden. Here for example, level converter or a MIDI interface to be connected. Diese Schnittstelle lässt sich aber nicht als System-Schnittstelle nutzen. This interface can not be used as system interface. Zu beachten ist, dass das Eingangssignal der System-Schnittstelle dafür nunmehr an PD1 (Pin 15) anliegt und nicht mehr an PD3 (Pin 17). It should be noted that the input signal of the system interface for now rests on PD1 (pin 15) and not to PD3 (Pin 17). Diese Änderung ist leider notwendig geworden, um den zweiten UART des ATMega644P nutzen zu können. This change has unfortunately become necessary to use the second UART of ATmega644P can. Über die Konfigurationsseite lässt sich zwischen beiden Pin-Varianten umschalten, wobei die zweite serielle Schnittstelle nur dann nutzbar ist, wenn der Eingang der ersten auf PD1 liegt. Via the configuration page can be switched between two pin versions, the second serial port is available only when the input is the first to PD1. Diese Beschaltung lässt sich natürlich auch mit dem ATMega644 nutzen. This circuitry can of course also use the ATmega644.3.3 Die parallele Schnittstelle 3.3 The parallel portmit der parallelen Schnittstelle lassen sich nicht nur Drucker ansteuern, es können auch digitale Signale ausgegeben und abgefragt werden. to the parallel port can be controlled not only printers, it can also be output digital signals and interrogated. Ausserdem können auch analoge Spannungen im Bereich 0-5V gemessen werden. In addition, can also be analog voltages ranging from 0-5V can be measured. Die beiden Steuersignale (Strobe und Busy) lassen sich aus dem BASIC heraus nicht direkt steuern sondern werden nur zum Anschluss von Druckern benötigt. The two control signals (strobe and busy) can be controlled from the BASIC out not directly but are only required to connect printers. An Pin 16 (/INIT) kann die interne +5V Spannung herausgeführt werden, damit können kleinere I/O Aufgaben auch mit der internen Stromversorgung gelöst werden. Pin 16 (/ INIT), the internal +5 V supply are brought out to allow smaller I / O objects are also achieved with the internal power supply. Alle Datensignale sind über Widerstände zur Strombegrenzung im Kurzschlussfall nach aussen geführt. All data signals are connected via resistors to limit the current in case of short run to the outside.3.4 Die I2C-Schnittstelle 3.4 The I2C interfaceDie I2C-Schnitstelle nutzt das TWI-Interface im Mega644. The I2C-interface uses the TWI interface in the Mega644. Dieses ist identisch zu I2C, heisst aber aus lizenzrechtlichen Gründen anders. This is identical to I2C, but called for licensing reasons differently.Der Signalautausch findet über zwei Leitungen, SCL (Serial Clock) und SDA (Serial Data) statt. The Signalautausch takes place over two lines, SCL (serial clock) and SDA (serial data). Darüber können serielle EEPROMs, Temperatursensoren etc. angeschlossen werden. Furthermore, serial EEPROMs, temperature sensors, etc. are connected. Damit die angeschlossene Peripherie nicht in jedem Fall eine extra Stromversorgung braucht, sind am I2C Anschluss auf der Platine auch +5V ond GND verfügbar. Thus the connected peripherals do not always need an extra power supply, are on the I2C connector on the PCB GND and +5 V ond available. Ebenfalls auf der Platine befinden sich zwei 8-polige Sockel für serielle EEPROMs der Typen 24C64 ...24C512 wobei die Adressen 0 und 1 vorverdrahtet sind. Also on the board are two 8-pin sockets for serial EEPROMs 24C64 ... 24C512 types of the addresses are pre-wired 0 and 1. Die genutzte Adresse lässt sich im Konfigurationsmenü einstellen, wobei XPOKE und XPEEK nur mit der voreingestellten Adresse funktionieren. The same address can be set in the configuration menu, where XPOKE XPEEK and only work with the default address. 3.5 Die SPI-Schnittstelle 3.5 The SPI interfaceDie SPI-Schnittstelle ist identisch mit der Programmierschnittstelle (ISP), an die auch das Dataflash-Modul angeschlossen wird. The SPI interface is identical to the programming (ISP), which is also on the data flash module connected. Ab der Version 1.38 ist es möglich, bis zu 8 Geräte an den SPI-Port anzuschließen. Starting with version 1.38, it is possible up to 8 devices to be connected to the SPI port. Dazu wird folgende Hardware benötigt: The following hardware is required:Die Funktionsweise ist dabei folgende: The operation is as follows:
4 Ein Beispiel-Leiterplattenlayout 4 An example PCB layout4.1 Das Beispiel-Layout 4.1 The sample layoutAuch wenn die Schaltung so einfach ist, dass sie problemlos auf einem Steckboard oder einer Lochraster- bzw. Streifenleiterplatte aufgebaut werden kann, ist für den dauerhaften Betrieb und zum anschließen von Erweiterungen eine kompakte Baugruppe doch recht nützlich. Even if the circuit is so simple that it can be built easily on a plug board or a breadboard or PCB strip, is designed for continuous operation and to connect extensions of a compact assembly quite useful. Die Leiterplatte ist als 8-Farben Version für den Universalanschluß ausgelegt und funktioniert sowohl mit dem Mega16 (AVR-ChipBasic) als auch mit dem Mega32 (AVR-ChipBasic32) und natürlich mit dem Mega644 (AVR-ChipBasic2), wobei die beiden ersteren einen 16MHz Quarz anstelle des beim Mega644 verwendeten 20MHz Quarzes benötigen. The circuit board is designed as an 8-color version of the universal joint and works with both the Mega16 (AVR chip Basic) and also with the Mega32 (AVR ChipBasic32) and of course with the Mega644 (AVR ChipBasic2), the former two one 16MHz quartz need instead of the Mega644 used 20MHz crystal. Das Layout wurde mit dem Programm "PCB" erstellt, die entsprechende Datei ist im Ordner hardware zu finden, ebenso eine PNG-Datei mit 300dpi Auflösung. The layout was created with the program "PCB", the file is found in the folder hardware, as a PNG file with 300dpi resolution. Natürlich ist jedem freigestellt, sich sein eigenes Leiterplattenlayout zu machen. Of course, each is free to make his own PCB layout.4.2 Bestückung der Leiterplatte 4.2 assembled printed circuit boardDie Leiterplatte enthält bis auf ein paar Ausnahmen, die für die Funktion nicht zwingend erforderlich sind, nur bedrahtete Bauelemente. The circuit board contains up to a few exceptions, which are not essential for the function, only leaded components. Die SMD Kondensatoren und der 4K7 Widerstand für die RESET-Leitung verbessern aber die Stabilität und sollten, wenn möglich, auch mit bestückt werden. The SMD capacitors and the 4K7 resistor to the RESET line but improve the stability and should, if possible, also be equipped with. Zusätzlich befindet sich auf dem Board ein einfacher Spannungsregler für die 5V, damit kann die Versorgungsspannung in etwa zwischen 6,5 und 15V liegen. Additionally located on the board, a simple voltage regulator for the 5V, so the supply voltage can be approximately between 6.5 and 15V. Bei höheren Spannungen als 9V und beim Anschluß von Zusatzhardware empfiehlt sich ein Kühlblech oder Kühlkörper für den Spannungsregler (7805). At higher voltages than 9V and the connection of additional hardware to a cooling plate or heatsink is recommended for the voltage regulator (7805).![]() 4.3 Die Erweiterung auf 16 Farben 4.3 The extension to 16 colorsDie Original-Leiterplatte war/ist universell auf 8 Farben ausgelegt, da die Varianten mit dem Mega16 und dem Mega32 sowie ältere ChipBasic2 Versionen den 16-Farb Modus nicht kennen. The original board was / is universally designed to 8 colors, as the variants with the Mega16 and Mega32 ChipBasic2 and older versions do not know the 16-color mode. Auch die Käuflich erhältliche Leiterplatte ist in der derzeitigen Version nur auf 8 Farben ausgelegt. Also can be purchased PCB is designed in the current version only 8 colors. Mit 4 zusätzlichen Widerständen lässt sich die Baugruppe aber einfach auf 16 Farben "aufrüsten", die entsprechenden Punkte sind bereits auf dem Bestückungsplan violett markiert. With 4 additional resistors, the board can do better "upgrade" to 16 colors, the corresponding points are already marked in purple on the placement plan. Der 10 KOhm Widerstand vom Punkt (A) nach +5V hat keinen Einfluss auf die Funktion und braucht nicht entfernt zu werden. The 10 Kohm resistance from point (A) to +5 V has no influence on the function and need not be removed.![]() created with latex2web.pl v0.62 © 2006-2011 Joerg Wolfram Created with latex2web.pl v0.62 © 2006-2011 Joerg tungsten |