jak dziala i2s ??



Masz problem? Zapytaj na forum elektroda.pl

Poprzedni Następny
Wiadomość
Spis treści
From: "Janicki Dariusz" <janiol_at_nospam_zeus.polsl.gliwice.pl>
Subject: jak dziala i2s ??
Date: Fri, 13 Dec 2002 15:52:32 +0100


Witam

Czy ktos interesowal sie transmisja I2S ktora najczesciej stosuje sie w ac /
ca , wymagajacych szybkiej transmisji danych.
Ja proboje okiełznac szeregowy przetwornik ca (i2s) ale narazie nie zbyt
dobrze mi to wychodzi .Nie wiem gdzie jest problem , czy zegar musi byc
taktowany sygnalem o konkretnej czestotliwosci ( syganl 50 % wypelnienia -
muss). Moze sygnaly bck, ws, powinny miec okreslona sekwencje .Prosze o
ewentualne sugestie.
Pozdrowienia
Darek




Poprzedni Następny
Wiadomość
Spis treści
From: amsNO_SPAM_at_nospam_e7.pl (Andrzej Sarbinowski)
Subject: Re: jak dziala i2s ?? - i2s (0/1)
Date: Fri, 13 Dec 2002 18:49:14 GMT


On Fri, 13 Dec 2002 15:52:32 +0100, "Janicki Dariusz"
<janiol_at_nospam_zeus.polsl.gliwice.pl> wrote:

Witam

Czy ktos interesowal sie transmisja I2S ktora najczesciej stosuje sie w ac /
ca , wymagajacych szybkiej transmisji danych.

Przepraszam ze wale zrodla na liste, ale nie sa zbyt dlugie, a moze
komus jeszcze sie przydadza.
Program napisany pod archimedesa C dla 8051. Sklada sie z dwoch
modulow : procedury obslugi I2S w asemblerze (dla obslugi TDA1543 -
D/A 2x16 bit w moim przypadku). W C fragment programu do obslugi tego
czegos z poziomu C. W plikach moga byc drobne niedopatrzenia edycyjne
na 100 %.


Poprzedni Następny
Wiadomość
Spis treści
From: amsNO_SPAM_at_nospam_e7.pl (Andrzej Sarbinowski)
Subject: Re: jak dziala i2s ?? - i2s (0/1)
Date: Fri, 13 Dec 2002 19:17:01 GMT


Cos sie zrodlo nie dokleilo ...
; Plik i2s.asm

PUBLIC SendI2S
$DEFFN SendI2S(0,0,0,0,0,4,0,0)

EXTERN _R

I2SWR EQU P1.1
I2SCL EQU P1.2
I2SDA EQU P1.3

RSEG CODE

macro %W10us
MOV R5,#4
DJNZ R5,$
endmac

SendI2S: MOV R0,#$LOCBI SendI2S
MOV _at_nospam_R0,_R+6
INC R0
MOV _at_nospam_R0,_R+7

MOV R0,#$LOCBI SendI2S
MOV A,_at_nospam_R0
XRL A,#80h
CLR KTORYKAN
LCALL SendI2SB

MOV R0,#$LOCBI SendI2S+1
MOV A,_at_nospam_R0
CLR KTORYKAN
LCALL SendI2SB

MOV A,#0
SETB KTORYKAN
LCALL SendI2SB

MOV R0,#$LOCBI SendI2S+2
MOV A,_at_nospam_R0
XRL A,#80h
SETB KTORYKAN
LCALL SendI2SB

MOV R0,#$LOCBI SendI2S+3
MOV A,_at_nospam_R0
SETB KTORYKAN
LCALL SendI2SB

MOV A,#0
CLR KTORYKAN
LCALL SendI2SB

RET

SendI2SB: MOV R7,#7
NastBIT: RLC A
MOV I2SDA,C
%W10us
SETB I2SCL
%W10us
CLR I2SCL
DJNZ R7,NastBIT
RLC A
MOV I2SDA,C
MOV C,KTORYKAN
MOV I2SWR,C
%W10us
SETB I2SCL
%W10us
CLR I2SCL
RET

END



/* Plik przyklad.c */

typedef unsigned char byte;
typedef unsigned int word;

extern void SendI2S(word,word);

void init_I2S(void);

void main(void)
{
init_I2S();
do
{
/* ........ */

SendI2S(KanalL,KanalP);
} while(1);
}

void init_I2S(void)
{ SendI2S(0,0);
SendI2S(0,0);
}



Poprzedni Następny
Wiadomość
Spis treści
From: "Janicki Dariusz" <janiol_at_nospam_zeus.polsl.gliwice.pl>
Subject: Re: jak dziala i2s ?? - i2s (0/1)
Date: Fri, 13 Dec 2002 20:39:24 +0100


Serdeczne Dzieki


Użytkownik "Andrzej Sarbinowski" <amsNO_SPAM_at_nospam_e7.pl> napisał w wiadomości
news:3dfa31d7.8881850_at_nospam_news.tpi.pl...
Cos sie zrodlo nie dokleilo ...
; Plik i2s.asm

PUBLIC SendI2S
$DEFFN SendI2S(0,0,0,0,0,4,0,0)

EXTERN _R

I2SWR EQU P1.1
I2SCL EQU P1.2
I2SDA EQU P1.3

RSEG CODE

macro %W10us
MOV R5,#4
DJNZ R5,$
endmac

SendI2S: MOV R0,#$LOCBI SendI2S
MOV _at_nospam_R0,_R+6
INC R0
MOV _at_nospam_R0,_R+7

MOV R0,#$LOCBI SendI2S
MOV A,_at_nospam_R0
XRL A,#80h
CLR KTORYKAN
LCALL SendI2SB

MOV R0,#$LOCBI SendI2S+1
MOV A,_at_nospam_R0
CLR KTORYKAN
LCALL SendI2SB

MOV A,#0
SETB KTORYKAN
LCALL SendI2SB

MOV R0,#$LOCBI SendI2S+2
MOV A,_at_nospam_R0
XRL A,#80h
SETB KTORYKAN
LCALL SendI2SB

MOV R0,#$LOCBI SendI2S+3
MOV A,_at_nospam_R0
SETB KTORYKAN
LCALL SendI2SB

MOV A,#0
CLR KTORYKAN
LCALL SendI2SB

RET

SendI2SB: MOV R7,#7
NastBIT: RLC A
MOV I2SDA,C
%W10us
SETB I2SCL
%W10us
CLR I2SCL
DJNZ R7,NastBIT
RLC A
MOV I2SDA,C
MOV C,KTORYKAN
MOV I2SWR,C
%W10us
SETB I2SCL
%W10us
CLR I2SCL
RET

END



/* Plik przyklad.c */

typedef unsigned char byte;
typedef unsigned int word;

extern void SendI2S(word,word);

void init_I2S(void);

void main(void)
{
init_I2S();
do
{
/* ........ */

SendI2S(KanalL,KanalP);
} while(1);
}

void init_I2S(void)
{ SendI2S(0,0);
SendI2S(0,0);
}





Poprzedni Następny
Wiadomość
Spis treści
From: amsNO_SPAM_at_nospam_e7.pl (Andrzej Sarbinowski)
Subject: Re: jak dziala i2s ?? - i2s (0/1)
Date: Fri, 13 Dec 2002 20:15:41 GMT


Skomplikowalem na probe te pliki i wyszly dwa niedopatrzenia (za ostro
cialem) .

W pliku I2S.ASM zamienic to :
RET

END

na to :
RET

RSEG BITVARS
KTORYKAN DS 1

END

W pliku przyklad.c zamienic to :

void main(void)
{
init_I2S();

na to :

void main(void)
{ word KanalL,KanalP;

init_I2S();

I teraz sie poprawnie kompiluje (sprawdzilem).

Poprzedni Następny
Wiadomość
Spis treści
From: amsNO_SPAM_at_nospam_e7.pl (Andrzej Sarbinowski)
Subject: Re: jak dziala i2s ?? - i2s (1/1)
Date: Fri, 13 Dec 2002 18:49:15 GMT


begin 644 i2s
M.R!0;&EK(&DR<RYA<VT-"_at_nospam_T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_(%!50DQ)0R`_at_nospam_4V5N
M9$DR4PT*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("1$149&3_at_nospam_E396YD23)3*#`L,"PP+#`L
M,"PT+#`L,"D-"_at_nospam_T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_($585$523B!?4_at_nospam_T*#0I),E-7
M4B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_15%5("`_at_nospam_("!0,2XQ#0I),E-#3"`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_15%5
M("`_at_nospam_("!0,2XR#0I),E-$02`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_15%5("`_at_nospam_("!0,2XS#0H-"_at_nospam_D)
M4E-%1PE#3T1%#0H-"B`_at_nospam_"2`_at_nospam_("`_at_nospam_("`_at_nospam_;6%C<F\_at_nospam_)5<Q,'5S#0H_at_nospam_"2`_at_nospam_("`_at_nospam_
M("`_at_nospam_34]6("`_at_nospam_("!2-2PC-`T*"2`_at_nospam_("`_at_nospam_("`_at_nospam_1$I.6B`_at_nospam_("!2-2PD#0H)("`_at_nospam_
M("`_at_nospam_("!E;F1M86,-"_at_nospam_T*4V5N9$DR4SH_at_nospam_("`_at_nospam_("`_at_nospam_($U/5B`_at_nospam_("`_at_nospam_4C`L(R1,
M3T-"22!396YD23)3#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_34]6("`_at_nospam_("!`4C`L7U(K
M-_at_nospam_T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_($E.0R`_at_nospam_("`_at_nospam_4C`-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_
M("!-3U8_at_nospam_("`_at_nospam_($!2,"Q?4BLW#0H-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_
M(%(P+",D3$]#0DD_at_nospam_4V5N9$DR4PT*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_($U/5B`_at_nospam_("`_at_nospam_
M02Q`4C`-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!84DP_at_nospam_("`_at_nospam_($$L(S_at_nospam_P:`T*("`_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_($-,4B`_at_nospam_("`_at_nospam_2U1/4EE+04X-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!,
M0T%,3"`_at_nospam_(%-E;F1),E-"#0H-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_(%(P
M+",D3$]#0DD_at_nospam_4V5N9$DR4RLQ#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_34]6("`_at_nospam_("!!
M+$!2,`T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_($-,4B`_at_nospam_("`_at_nospam_2U1/4EE+04X-"B`_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_("!,0T%,3"`_at_nospam_(%-E;F1),E-"#0H-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_
M("!-3U8_at_nospam_("`_at_nospam_($$L(S`-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!3151"("`_at_nospam_($M43U)9
M2T%.#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_3$-!3$P_at_nospam_("!396YD23)30_at_nospam_T*#0H_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_34]6("`_at_nospam_("!2,"PC)$Q/0T))(%-E;F1),E,K,_at_nospam_T*("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_($U/5B`_at_nospam_("`_at_nospam_02Q`4C`-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!8
M4DP_at_nospam_("`_at_nospam_($$L(S_at_nospam_P:`T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_(%-%5$(_at_nospam_("`_at_nospam_2U1/4EE+
M04X-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!,0T%,3"`_at_nospam_(%-E;F1),E-"#0H-"B`_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_(%(P+",D3$]#0DD_at_nospam_4V5N9$DR4RLS#0H_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_34]6("`_at_nospam_("!!+$!2,`T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_(%-%
M5$(_at_nospam_("`_at_nospam_2U1/4EE+04X-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!,0T%,3"`_at_nospam_(%-E;F1)
M,E-"#0H-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_($$L(S`-"B`_at_nospam_("`_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("!#3%(_at_nospam_("`_at_nospam_($M43U)92T%.#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_3$-!
M3$P_at_nospam_("!396YD23)30_at_nospam_T*#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_4D54#0H-"E-E;F1)
M,E-".B`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_(%(W+",W#0I.87-T0DE4.B`_at_nospam_("`_at_nospam_("`_at_nospam_4DQ#
M("`_at_nospam_("!!#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_34]6("`_at_nospam_("!),E-$02Q##0H_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_)5<Q,'5S#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_4T540B`_at_nospam_("!)
M,E-#3`T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("57,3!U<PT*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_
M($-,4B`_at_nospam_("`_at_nospam_23)30TP-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!$2DY:("`_at_nospam_(%(W+$YA
M<W1"250-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!23$,_at_nospam_("`_at_nospam_($$-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_
M("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_($DR4T1!+$,-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_
M($,L2U1/4EE+04X-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!-3U8_at_nospam_("`_at_nospam_($DR4U=2+$,-
M"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`E5S$P=7,-"B`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("!3151"
M("`_at_nospam_($DR4T-,#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_)5<Q,'5S#0H_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_
M("`_at_nospam_("`_at_nospam_0TQ2("`_at_nospam_("!),E-#3`T*("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_("`_at_nospam_(%)%5`T*#0H_at_nospam_
M"2`_at_nospam_("`_at_nospam_("`_at_nospam_14Y$#0H-"_at_nospam_T*#0HO*B!0;&EK('!R>GEK;&%D+F,_at_nospam_*B\-"_at_nospam_T*
M='EP961E9B!U;G-I9VYE9"!C:&%R(&)Y=&4[#0IT>7!E9&5F('5N<VEG;F5D
M(&EN="!W;W)D.PT*#0IE>'1E<FX_at_nospam_=F]I9"!396YD23)3*'=O<F0L=V]R9"D[
M#0H-"G9O:60_at_nospam_:6YI=%]),E,H=F]I9"D[#0H-"G9O:60_at_nospam_;6%I;BAV;VED*0T*
M>R`-"B`_at_nospam_:6YI=%]),E,H*3L-"B`_at_nospam_9&\_at_nospam_#0H_at_nospam_('L_at_nospam_#0H_at_nospam_("`_at_nospam_+RH_at_nospam_+BXN+BXN
M+BX_at_nospam_*B\-"B`_at_nospam_("`-"B`_at_nospam_("!396YD23)3*$MA;F%L3"Q+86YA;%`I.PT*("!]
M('=H:6QE*#$I.PT*?0T*#0IV;VED(&EN:71?23)3*'9O:60I#0I[(%-E;F1)
,E,H,"PP*3L-"B`_at_nospam_4V5N9$DR4R_at_nospam_P+#`I.PT*?0T*
`
end