ATMega16 portC

hwsw famulus hwsw at famulus.hu
Tue Apr 27 10:10:37 CEST 2004


>Hogyan tudom megmondani a Bascomban hogy egy adott port kimenet, bemenet, vagy is-is legyen? Mondjuk felhuzoellenallassal...
>Ugy nez ki nem csipi ha a PortC-re rakom az LCD adatvonalat + RS+E labat (4 bites mukodes). Ugy nez ki mintha a C2..5 lab bemenet lenne...(A Sound fuggveny >nem mukodik ra).
>Sehol nem deklaralom hogy minek akarom latni...

>Van ra valami megvalositas? Vagy tegyem at az adatvonalakat a PortA-ra?

Van!!!
 read manual 
kulonos tekintttela Config utasitasokra...

ilyenk lehtsegesek pl.

Config Pine.4 = Output
Config Pine.5 = Output
Config Porta = &B0000_0011
Config Portf = &B1111_1111
Config Porte = &B1111_1110
Config Portd = Output


LCD is rakhato gyakorlatlag barhova....Ime

'--------------------------------------------------
$regfile = "m128def.dat"
$crystal = 16000000
$baud = 4800
$baud1 = 4800
'------------------------------------------------------------------------------'

'LCD init start (LCD on PORTC)
'------------------------------------------------------------------------------'
'When LCD used hw EN mode

'$lib "lcd4busy.lib"
'Const _lcdport = Portc
'Const _lcdddr = Ddrc
'Const _lcdin = Pinc
'Const _lcd_e = 3
'Const _lcd_rw = 2
'Const _lcd_rs = 1

'When LCD used sw wait mode (must be setting by sw/hw RW=0 )

Config Portc = Output
cbi portc,2
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.1
'------------------------------------------------------------------------------'
'LCD init end
'------------------------------------------------------------------------------'

>Robi

KJ


More information about the Elektro mailing list