View previous topic :: View next topic |
Author |
Message |
maxneo
Joined: 07 Sep 2010 Posts: 35
|
Posted: Sat Jun 20, 2015 3:53 pm Post subject: Can not get ports that function |
|
|
Hi
Have problems with aliases can someone see if I have done wrong this can not get the port going as I want, I use toggle it goes.
'------------------------------------------------------------------------------
' Reset signal for MCS Bootloader
'------------------------------------------------------------------------------
$regfile = "atTiny45.dat"
$prog &HFF , &HD2 , &HDC , &HFF 'Enable internal Oscilator, Disable /8 divider
$crystal = 8000000
$hwstack = 35
$swstack = 30
$framesize = 45 '
Dim Bstatus As Byte
Const On = 1
Const Off = 0
Led Alias Portb.4 'fungerar inte
Res Alias Portb.3
Ok Alias Portb.2
Config Pinb.0 = Output ' com port in
Config Pinb.1 = Input
Config Led = Output
Config Res = Output
Config Ok = Input
Res = On 'set Res
Led = Off 'Reset Led
Ok = On
Open "comb.1:38400,8,n,1" For Input As #2
'Open "comb.0:38400,8,n,1" For Output As #1
Do
Bstatus = Waitkey(#2) '{ did we received value 123 ?
If Bstatus = 123 Then
Led = On 'Set Led
Res = Off 'Reset Res
Bitwait Pinb.2 , Reset
Res = On 'Set Res
Led = Off 'Reset Led
End If
nop
Loop
End
many greetings Maxneo
(BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.7.8 ) |
|
Back to top |
|
|
Dibor
Joined: 04 Dec 2004 Posts: 137 Location: ISRAEL
|
Posted: Sat Jun 20, 2015 7:12 pm Post subject: |
|
|
Hello.
I think , you cant to use aliases in config ports.
First - config ports like Config Pinb.1 = Input , Config Portb.3 = Output
Second - define aliases Led Alias Portb.4, Res Alias Portb.3
After that use aliases .
Regards. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun Jun 21, 2015 3:14 pm Post subject: In is pIn / out is pORt |
|
|
You can use aliases in config ports
But you should alter this
Ok alias pinb.2
config ok = input
ok = on
The last one is to activate pull up.
In is Pin
out is Port
Have fun
Ben Zijlstra |
|
Back to top |
|
|
maxneo
Joined: 07 Sep 2010 Posts: 35
|
Posted: Sun Jun 21, 2015 5:34 pm Post subject: Thanks |
|
|
Hello, Thanks for the answers to test directly.
Sincerely Maxneo |
|
Back to top |
|
|
|