proton+ DWORD den büyük sayılar nasıl işlenir

Başlatan mikro29, 29 Eylül 2012, 18:58:16

mikro29

#15
ad9851 bu şekilde seri gönderiyorum glcd' ye hex'i yazdırıyorum, gönderdiğim hexle buradaki http://designtools.analog.com/dt/dds/ad9851.html#troubleshooting  hex kıyaslıyorum (biraz uzun yol) 32bit  olayını çözemediğim için bu kod max 15mhz e kadar çalışıyor başka nasıl yapabilirim hocam

mesaj birleştirme:: 08 Ekim 2012, 23:25:54

bu arada benim ref. frekansım 30MHz çarpan 6 olması lazım yani frekans 180MHz ,bu program ref. 30MHz çarpan 1 = 30MHZ bununda yarısında bile normal çalışmıyor  :'(

yarın burayı ayrıntılı incelerim http://www.protonbasic.co.uk/showthread.php/67460-Using-AD9851-DDS-with-Proton

herkesten Allah razı olsun

Hattusa

s.a. arkadaşlar
ad9850 kiti geçti elime 1 haftadır henüz istediğim kontrol edemedim.


bu konu ile ilgili çalışma yapmış arkadaşlar bilgi verebilirler mi?

konu ile ilgili dosya ekte

nerde hata yaptığımı bulamadım henüz

http://www.dosya.tc/server6/PnE1dZ/ad.rar.html
vardım ilim meclisine eyledim talep, meğer ilim en gerideymiş illa EDEP, illa EDEP <muhyiddin Arabi K.S.>

Hattusa

s.a. arkadaşlar ya yokmu yardımcı olacak arkadaş, aşağıya eklediğim resimde frekansı belirleyen değerler isisde aynı (yada ben hatalı algılıyorum)




konu ile ilgili bas dosyası ekte
Device 18F4520
Xtal 4
Config_Start
   OSC = XT ; HS oscillator
   FCMEN = OFF ; Fail-Safe Clock Monitor disabled
   IESO = OFF ; Oscillator Switchover mode disabled
   PWRT = OFF ; PWRT disabled
   BOREN = OFF ; Brown-out Reset disabled in hardware and software
   WDT = OFF ; WDT disabled (control is placed on the SWDTEN bit)
   MCLRE = On ; MCLR pin enabled; RE3 input pin disabled
   LPT1OSC = OFF ; Timer1 configured for higher power operation
   PBADEN =OFF ; PORTB<4:0> pins are configured as digital I/O on Reset
'   CCP2MX = PORTC ; CCP2 input/output is multiplexed with RC1
   STVREN = OFF ; Stack full/underflow will not cause Reset
   LVP = OFF ; Single-Supply ICSP disabled
   XINST = OFF ; Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
   Debug = OFF ; Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
Config_End
Declare LCD_DTPort = PORTD                
Declare LCD_RSPin = PORTC.6               
Declare LCD_ENPin = PORTC.4               
Declare LCD_RWPin = PORTC.5                
Declare LCD_CS1Pin = PORTA.5            
Declare LCD_CS2Pin = PORTA.3               
Declare LCD_Type =GRAPHIC         
		Internal_Font =On
		Font_Addr = 0
Declare GLCD_CS_Invert =0
 Declare GLCD_STROBE_DELAY = 1000

Cls
DelayMS 100
 

TRISA =%00000000
TRISB =%01110000
TRISC =%00000000
TRISD =%00000000
TRISE =%00000000
PORTA =0
PORTB =0
PORTC =0
PORTD =0
PORTE =0
Declare All_Digital =1
PortB_Pullups =1
Reminders = OFF
'CMCON =7
'ADCON0 =%00000011
'ADCON1 =%00001111
'ADCON2 =%10000000



Symbol rOlE =PORTB.7
Symbol DaTa_pIn =PORTC.1
Symbol cLk_pIn =PORTC.3
Symbol fUd_pIn =PORTC.2

'Output cLk_pIn
'Output fUd_pIn 
'Output DaTa_pIn
''Output YtY1
'Output YtY2
'Output YtY3
'Output YtY4
'Input DkY1
'Input DkY2 
'Input DkY3
Output rOlE


Dim tUs As Byte
Dim sAyI As Dword
Dim TeMp As Byte
Dim SeC As Byte
Dim yAk As Byte
Symbol CaRpAn =34.359738368
Dim fR As Dword
Dim KhZ As Float
Dim MhZ As Float
Dim Z[4] As Word
Dim del As Word
Dim K As Word
Dim L As Word
Dim M As Word
Dim O As Word
Dim Y As Word
Dim G As Word
Dim AyA As Dword           
Dim part1 As AyA.Byte0
Dim part2 As AyA.Byte1
Dim part3 As AyA.Byte2
Dim part4 As AyA.Byte3
Dim IlK As fR.Word0
Dim SoN As fR.Word1
Dim Aa As Byte
Dim Bb As Byte
Dim Cc As Byte
Dim Dd As Byte
Dim W As Byte
'dim W0 as w.bit 
Dim TuN As fR.Word0
Dim sUn As fR.Word1
Dim KoD As Byte
Dim X As Byte

Dim YtY1 As PORTB.0
Dim YtY2 As PORTB.1
Dim YtY3 As PORTB.2
Dim YtY4 As PORTB.3
Dim DkY1 As PORTB.4
Dim DkY2 As PORTB.5
Dim DkY3 As PORTB.6

yAk =0
rOlE =0
SeC =0
YtY1 =0
YtY2 =0
YtY3 =0
DaTa_pIn =0
cLk_pIn =0
fUd_pIn =0

tUs=0


PORTC.0 =1
DelayMS 1000
PORTC.0 =0

mAIn:



'****************************     TUŞ TARAMA  *******************************
YtY1 =0
If DkY1 =0 Then tUs = 1  : GoSub hEsApLa : While DkY1 ==0 : Wend
If DkY2 =0 Then tUs = 2  : GoSub hEsApLa : While DkY2 ==0 : Wend
If DkY3 =0 Then tUs = 3  : GoSub hEsApLa : While DkY3 ==0 : Wend
DelayMS 10
YtY1 =1

YtY2 =0
If DkY1 =0 Then tUs = 4 : GoSub hEsApLa  : While DkY1 ==0 : Wend
If DkY2 =0 Then tUs = 5 : GoSub hEsApLa  : While DkY2 ==0 : Wend
If DkY3 =0 Then tUs = 6 : GoSub hEsApLa  : While DkY3 ==0 : Wend
DelayMS 10
YtY2 =1

YtY3 =0
If DkY1 =0 Then tUs = 7 : GoSub hEsApLa  : While DkY1 ==0 : Wend
If DkY2 =0 Then tUs = 8 : GoSub hEsApLa  : While DkY2 ==0 : Wend
If DkY3 =0 Then tUs = 9 : GoSub hEsApLa  : While DkY3 ==0 : Wend
DelayMS 10
YtY3 =1

YtY4 =0
If DkY2 =0 Then tUs = 0 : GoSub hEsApLa : While DkY2 ==0 : Wend
If DkY1 =0 Then GoSub yIldIz :While DkY1 ==0 : Wend '* tuşu
If DkY3 =0 Then GoTo dIyEz  :While DkY3 ==0 :  Wend'# tuşu
DelayMS 10
YtY4 =1

Print At 2,1,# sAyI


Print At 3,1,Dec SeC," "

DelayMS 100
If yAk =0 Then rOlE =0
If yAk =1 Then rOlE =1
GoTo mAIn
dIyEz:
PORTC.0 =1
DelayMS 100
'GoSub DDS_GONDER
yAk =0
sAyI = 0 : TeMp = 0 :SeC =0
PORTC.0 =0
Cls
Return

yIldIz:
If SeC <=3 Then
    Print At 4,1,Dec sAyI
    Print At 4,10,"HERTZ    "
    EndIf
If SeC >3 And SeC <=6 Then
    KhZ =sAyI /1000
    Print At 4,1,Dec KhZ
    Print At 4,10,"KILOHERTZ"
    EndIf
If SeC >6 Then
    If sAyI >=10000000 Then sAyI =10000000
    MhZ =sAyI /1000000
    Print At 4,1,Dec MhZ
    Print At 4,10,"MEGAHERTZ"
    EndIf
fR = sAyI *CaRpAn
AyA =fR Rev 32
Print At 0,1,Hex AyA
Print At 0,10, Dec AyA
Print At 1,10,Dec fR  
Print At 1,1,Hex fR
Print At 5,1,Hex part1
Print At 5,10,Hex part2
Print At 6,1,Hex part3
Print At 6,10,Hex part4


W =0
Print At 6,15,Hex W
 DelayMS 1000


fUd_pIn =1
DelayMS 1
fUd_pIn =0
SHOut DaTa_pIn, cLk_pIn, 0,[part1, part2, part3, part4, $00]
fUd_pIn =1
DelayMS 1
fUd_pIn =0

'sAyI = 0 : TeMp = 0
yAk =1
GoTo mAIn


bYteOuT:
'DelayuS 30
DaTa_pIn =GetBit W,0
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0
DelayUS 10 

DelayUS 30
DaTa_pIn =GetBit W,1
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0

DelayUS 30
DaTa_pIn =GetBit W,3
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0

DelayUS 30
DaTa_pIn =GetBit W,4
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0

DelayUS 30
DaTa_pIn =GetBit W,5
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0

DelayUS 30
DaTa_pIn =GetBit W,6
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0

DelayUS 30
DaTa_pIn =GetBit W,7
DelayUS 20
High cLk_pIn
DelayUS 50
Low cLk_pIn
DelayUS 20
Low DaTa_pIn; CLOCK OUT BIT0
''DelayuS 30

Return





hEsApLa:
If SeC <8 Then
Inc SeC
TeMp=tUs
sAyI = (sAyI * 10) + TeMp
TeMp=0
If SeC >8 Then SeC =0
EndIf


Return

End  ' ************************* PROGRAM SONU **********************************
Stop
Include "FONT.INC"
vardım ilim meclisine eyledim talep, meğer ilim en gerideymiş illa EDEP, illa EDEP <muhyiddin Arabi K.S.>

Hattusa

s.a.
arkadaşlar bu konu hakkında kimsenin bir fikri yokmu?
vardım ilim meclisine eyledim talep, meğer ilim en gerideymiş illa EDEP, illa EDEP <muhyiddin Arabi K.S.>