Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Can not get ports that function

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
maxneo

Bascom Member



Joined: 07 Sep 2010
Posts: 35

PostPosted: Sat Jun 20, 2015 3:53 pm    Post subject: Can not get ports that function Reply with quote

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
View user's profile
Dibor

Bascom Member



Joined: 04 Dec 2004
Posts: 137
Location: ISRAEL

israel.gif
PostPosted: Sat Jun 20, 2015 7:12 pm    Post subject: Reply with quote

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
View user's profile MSN Messenger
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sun Jun 21, 2015 3:14 pm    Post subject: In is pIn / out is pORt Reply with quote

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
View user's profile Visit poster's website
maxneo

Bascom Member



Joined: 07 Sep 2010
Posts: 35

PostPosted: Sun Jun 21, 2015 5:34 pm    Post subject: Thanks Reply with quote

Hello, Thanks for the answers to test directly.
Sincerely Maxneo
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum