[elektro] Bascom osccal

lista at tavir.hu lista at tavir.hu
Tue Dec 29 12:56:20 CET 2009


Talán segít....

Robert


Tipp: tiny48 mintából:


'--------------------------------------------------------------
'                        ATtiny48.bas
'                      tiny48 sample file
'                  (c) 1996-2009, MCS Electronics
'--------------------------------------------------------------
$regfile = "attiny48.dat"
$crystal = 8000000
Config Clockdiv = 1                                         ' disable the 8 divider that is enabled by default

' too nad this chip does not have a UART
Open "comd.1:19200,8,n,1" For Output As #1
Open "comd.0:19200,8,n,1" For Input As #2

Config Portb = Output

Dim B As Byte
For B = &H50 To &H80
  Osccal = B
  Waitms 500
  Print #1 , "OSCAL TEST:" ; B
Next
Osccal = 80                                                 ' seems a good value, also datasheet does not seem to be correct for default fusebits

Dim K As Byte
Do
  K = Waitkey(#2)
  Print #1 , K
  Incr B
  Portb = Not Portb
  Print #1 , "hello tiny48 " ; B
  'we print the variable to see if the micro does not reset
  'when it resets it will never reach 255
  Waitms 500
Loop Until K = 27


Config Adc = Single , Prescaler = Auto , Reference = Internal
Start Adc
Do
   'in version 1.11.7.6 the GETADC() supports an offset parameter
   'you can use this to add an offset to the channel.
   'For example to use the differential and GAIN settings of some new AVRS's
   Print #1 , "ch0 " ; Getadc(0 , 0)
   Print #1 , "ch1 " ; Getadc(1)
   Waitms 1000
Loop

End

----- Original Message -----
From: Riba Zoltán <libus at madmac.hu>
To: elektro at tesla.hu
Date: Mon, 28 Dec 2009 23:14:15 +0100
Subject: Re: [elektro] Bascom osccal

> Nem értek hozzá, de nem az OSCCAL regiszter van erre a célra?
> 
> RZ
> 
> 
> On Dec 28, 2009, at 10:31 PM, Csuvár Imre wrote:
> 
> > Hali,
> > hat senkise nem?
> > Bruhubruhu :(
> >
> > Csuva'r Imre
> >
> > From: "Csuvár Imre" <icsuvar at t-online.hu>
> >
> >
> >> Hali,
> >> hogyan lehet a Bascom-ban egy Attiny26
> >> belso RC oszcijat hangolaszni.
> >> Ha valaki tudja, ne kimeljen.
> >>
> >> Koszi:
> >> Csuva'r Imre
> >
> > -----------------------------------------
> >           elektro[-flame|-etc]
> 
> 
> 
> 



More information about the Elektro mailing list