![]() ![]() INFO - FAQ - CC2-Forum - CCPro-Forum |
|
' ---------------------------------------------------------------------------------- ' AD-Ports auf festes Potential legen. Es werden die Pull-Up-Widerstände aktiviert. ' In OCBASIC 1.11a für Open-Maxi von Dietmar Harlos am 15. August 2017. ' ---------------------------------------------------------------------------------- ' Die AD-Ports AD[1] bis AD[8] liegen bei der Open-Maxi genauso wie bei der C-Control I Version 1.1 ' standardmäßig in der Luft, was ungünstig ist. Wenn der Anwender nicht alle AD-Ports benötigt, sollte ' er die nicht verwendeten auf festes Potential legen. Sie können zum Beispiel auf I/O-Port-Funktion ' umgeschaltet und die internen Pull-Up-Widerstände aktiviert werden. ' Das Controllermanual MC9S08AW60.pdf schreibt dazu: ' "To avoid extra current drain from floating input pins, the reset initialization routine in the ' application program should either enable on-chip pullup devices or change the direction of unused ' pins to outputs so the pins do not float." ' "Pins that are not used in the application must be terminated. This prevents excess current caused by ' floating inputs and enhances immunity during noise or transient events. Termination methods include: ' * Configuring unused pins as outputs driving high or low ' * Configuring unused pins as inputs and using internal or external pullups ' Never connect unused pins to VDD or VSS." ' Siehe auch "Chapter 14: Analog-to-Digital Converter (S08ADC10V1)" im Controllermanual. INCLUDE "omax.def" 'Definitionen für die Open-Maxi POKE PTDPE,&b11111111 'Internal Pullup Enable for Port D (PTDPE) APCTL2 =&b00000000 'Pin Control 2 Register (APCTL2) WHILE TRUE PRINT ad0 'AD-Ports liefern jetzt den Wert 255 PRINT ad1 PRINT ad2 PRINT ad3 PRINT ad4 PRINT ad5 PRINT ad6 PRINT ad7 PAUSE 25 WEND End2Host=ON 'nach dem Programmende in den Host-Modus END 'Programmende Meine Homepage: http://ccintern.dharlos.de |
Antwort schreiben |