Hi Kampi,
Doch, das geht. Wie schon geschrieben, ist dazu die xmega.lib nicht notwendig, da die Register "zu Fuß" gesetzt werden !Aber das kannst du doch nur mit einer Vollversion benutzen und nicht in der Demo oder?
hier nochmal das Ganze ohne die zusätzlichen Kommentare, ist vielleicht etwas übersichtlicher.
Code:$regfile = "xm128a1def.dat" $crystal = 32000000 ' Ddre = &B11111111 'All Output '************** config Clock 2MHz internal, PLL x16 **************************** Dim A As Byte ' Out &H50 , &B00000001 ' enable 2MHz Oscillator Out &H55 , &B00010000 'PLL Clocksource = 2MHz internal Osc. Out &H34 , &HD8 'No write protection for 4 cycles ' Out &H41 , &B00000000 'Prescaler= No division Prescaler A, B and C While A.0 = 0 'Wait for 2MHz Osc. to be ready A = Inp(&H51) Wend Out &H50 , &B00010001 ' enable PLL While A.4 = 0 'Wait for PLL to be ready A = Inp(&H51) Wend Out &H34 , &HD8 'No write protection for 4 cycles ' Out &H40 , &B00000100 'Select PLL as system Clock Out &H34 , &HD8 'No write protection for 4 cycles ' Out &H42 , &B00000001 'Lock System Clock Settings ' Porte = &B00001111 'indicate init done Wait 1 Do 'Blink Toggle Porte Waitms 1000 Loop End
Gruß
Christopher








Zitieren
Lesezeichen