Поделитесь плиз исходником декодера на Тини2313 для RC-5. Желательно под Code Vision. Делал на Мега8515 и всё Ок, а под Тини2313 переделать немогу.
За ранние спасибо!
roboforum.ruТехнический форум по робототехнике. |
|
|
Krik99 писал(а):. Делал на Мега8515 и всё Ок, а под Тини2313 переделать немогу.
За ранние спасибо!
blindman писал(а):Так выложи свой код, мож кто поможет перенести на тини
$regfile = "2313def.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
' +5V <---[A Led K]---[220 Ohm]---> Pb.3 for 2313.
' RC5SEND is using TIMER1, no interrupts are used
' The resistor must be connected to the OC1(A) pin , in this case PB.3
Dim Togbit As Byte , Command As Byte , Address As Byte
Command = 12 ' power on off
Togbit = 0 ' make it 0 or 32 to set the toggle bit
Address = 0
Do
Waitms 500
Rc5send Togbit , Address , Command
'or use the extended RC5 send code. You can not use both
'make sure that the MS bit is set to 1, so you need to send
'&B10000000 this is the minimal requirement
'&B11000000 this is the normal RC5 mode
'&B10100000 here the toggle bit is set
' Rc5sendext &B11000000 , Address , Command
Loop
$regfile = "2313def.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
'use byte library for smaller code
$lib "mcsbyte.lbx"
'This example shows how to decode RC5 remote control signals
'with a SFH506-35 IR receiver.
'Connect to input to PIND.2 for this example
'The GETRC5 function uses TIMER0 and the TIMER0 interrupt.
'The TIMER0 settings are restored however so only the interrupt can not
'be used anymore for other tasks
'tell the compiler which pin we want to use for the receiver input
Config Rc5 = Pind.2
'the interrupt routine is inserted automatic but we need to make it occur
'so enable the interrupts
Enable Interrupts
'reserve space for variables
Dim Address As Byte , Command As Byte
Print "Waiting for RC5..."
Do
'now check if a key on the remote is pressed
'Note that at startup all pins are set for INPUT
'so we dont set the direction here
'If the pins is used for other input just unremark the next line
'Config Pind.2 = Input
Getrc5(address , Command)
'we check for the TV address and that is 0
If Address = 0 Then
'clear the toggle bit
'the toggle bit toggles on each new received command
'toggle bit is bit 7. Extended RC5 bit is in bit 6
Command = Command And &B01111111
Print Address ; " " ; Command
End If
Loop
EdGull писал(а):а всё ваша религия дурацкая...
на васике какая красота-то...
EdGull писал(а):ну я ж и говорю, ваша дурацкая религия...
Добавлено спустя 2 минуты 16 секунд:
погодь, али ты студент-халявщик?
EdGull писал(а):а всё ваша религия дурацкая...
на васике какая красота-то...
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 16