- fchao-Sinus-Wechselrichter AliExpress         
Ergebnis 1 bis 10 von 30

Thema: Master Slave Verbindung mit AVR2313 und 485-Bustreibern ?

Hybrid-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1
    Erfahrener Benutzer Robotik Einstein Avatar von Vitis
    Registriert seit
    06.01.2005
    Ort
    Südpfalz
    Alter
    51
    Beiträge
    2.253
    Bascom Hilfe:

    CONFIG PRINT
    Top Previous Next
    Action

    Configure the UART to be used for RS-485


    Syntax

    CONFIG PRINT0 = pin

    CONFIG PRINT1 = pin

    Remarks

    pin
    The name of the PORT pin that is used to control the direction of an RS-485 driver.

    mode
    SET or RESET

    Use PRINT or PRINT0 for the first serial port. Use PRINT1 for the second serial port.

    When you use RS-485 half duplex communication you need a pin for the direction of the data. The CONFIG PRINT automates the manual setting/resetting. It will either SET or RESET the logic level of the specified pin before data is printed with the Bascom print routines. After the data is sent, it will inverse the pin so it goes into receive mode.

    You need to set the direction of the used pin to output mode yourself.


    See also

    CONFIG PRINTBIN

    Code:
     
    
    Example
    
    '------------------------------------------------------------------------------
    
    'name                     : rs485.bas
    
    'copyright                : (c) 1995-2006, MCS Electronics
    
    'purpose                  : demonstrates
    
    'micro                    : Mega48
    
    'suited for demo          : yes
    
    'commercial addon needed  : no
    
    '------------------------------------------------------------------------------
    
    $regfile = "m48def.dat"                                     ' we use the M48
    
    $crystal = 8000000
    
    $baud = 19200
    
     
    
    $hwstack = 32
    
    $swstack = 32
    
    $framesize = 32
    
     
    
    Config Print0 = Portb.0 , Mode = Set
    
    Config Pinb.0 = Output                                      'set the direction yourself
    
     
    
    Dim Resp As String * 10
    
    Do
    
      Print "test message"
    
      Input Resp                                               ' get response
    
    Loop
    in den Plänen hab ich auch mal rumgepinselt ... siehe Anhang
    Angehängte Dateien Angehängte Dateien
    Vor den Erfolg haben die Götter den Schweiß gesetzt

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

LiFePO4 Speicher Test