IrDA-Sender mit AVR (kein RC5/RC6)

Gast #579345
Lesenswert?
• ▲
▼
Hallo,
bin auf der Suche nach einem einfachen AVR-ASM-Programm, mit welchem man 
einzelne Datenbytes per IrDA  von einem AVR-Tiny/Mega (mit IR-LED und 
Wid.) über kurze Distanz (20-30cm) an einem Palm M100 (mit Basic) senden 
kann.
Habe schon rumgeGOOGELT - habe nur Anwendungen mit 8051ern gefunden !
Habt Ihr da eine Idee ?

Steki
Gast #579793
Lesenswert?
• ▲
▼
Hallo Leute,
... wollte eigentlich nur mit geringstem Schaltungsaufwand loslegen,
IR-LED über 200-Ohm-Widerstand an den entsprechenden Port.
Die IR-LED muß kurze Lichtblitze abgeben - nur ca. 3 Mikrosec. lang bei 
9600 Baud - im Gegensatz zu RS232.

Habt Ihr da einmal ein winziges Programmbeispiel in BASCOM, wie das 
gehen
soll ?

Steki
Gast #579904
Lesenswert?
• ▲
▼
einfach die IRLED an TxD



$regfile = "m48def.dat"                                     ' specify 
the used micro

$crystal = 4000000                                          ' used 
crystal frequency

$baud = 19200                                               ' use baud 
rate

$hwstack = 32                                               ' default 
use 32 for the hardware stack

$swstack = 10                                               ' default 
use 10 for the SW stack

$framesize = 40                                             ' default 
use 40 for the frame space




Dim A As Byte , B1 As Byte , C As Integer , S As String * 4

A = 1

Print "print variable a " ; A

Print                                                       'new line

Print "Text to print."                                      'constant to 
print







B1 = 10

Print Hex(b1)                                               'print in 
hexa notation

C = &HA000                                                  'assign 
value to c%

Print Hex(c)                                                'print in 
hex notation

Print C                                                     'print in 
decimal notation




C = -32000

Print C

Print Hex(c)

Rem Note That Integers Range From -32767 To 32768




Print "You can also use multiple" _

; "lines using _"

Print "use it for long lines"

'From version 1.11.6.4 :

A = &B1010_0111

Print Bin(a)

S = "1001"

A = Binval(s)

Print A                                                     '9 dec

End
Gast #580846
Lesenswert?
• ▲
▼
Hallo Leute,
habe die Schaltung mit ATmega8 und 4MHz-Quarz aufgebaut und mit 
folgendem
Programm gestartet

+++++++++++++++++++++++++++++++++++++++++++++++++++++++
' IRLED und 180 Ohm zwischen TxD und +5V
$regfile = "m8def.dat"
$crystal = 4000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40

Anfang:
Print "123456789 ABCD";
Wait 2
Goto Anfang
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
.... es kommt nur Quatsch an:          822& &&>8>xrrf

Dasselbe wie auf dem Palm M100 wird im "Terminal Emulator" von Bascom
mit einem "Serial-IrDA Infrared Adapter Hama 49290" angezeigt.

Gast #585207
Lesenswert?
• ▲
▼
Hallo,
das entsprechende Fuse muß natürlich geändert und gespeichert werden, 
damit der Quarz auch für den Controller aktiv ist.
Habe dann auch noch einmal auf die internen Oszillatoren "umgefust":
4MHz und 8MHz funktionierten - bei 1MHz und 2MHz kam nur Mist an bei
9600Baud.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren