$regfile = "atxtiny3217.dat"
Config Submode = New
Config Base = 0
$crystal = 20000000
$hwstack = 80
$swstack = 48
$framesize = 150
'$sim
'$dbg
Config Sysclock = 16_20mhz , Prescale = 1
Const _valcheck = 1
Const Updateeprom = 1
Config Com1 = 115200 , Mode = Asynchroneous , Parity = None , Databits = 8 , Stopbits = 1 , Baud_offset = Osc20_5v
Config Serialin = Buffered , Size = 60
Config Serialout = Buffered , Size = 100
Config Twi0 = 100000
Config I2cdelay = 100
I2cinit Twi0
Dim Twi_start As Byte
Porta_pin1ctrl = 0 ' need to reassign register bits
Porta_pin2ctrl = 0
'-------------------------------ADC CONFIG---------------------------------
Config Vref = Dummy , Adc0 = 4v3 , Adc1 = 1v1
Config Adc0 = Single , Resolution = 10bit , Adc = Enabled , Reference = Internal , Prescaler = 32 , Sample_cap = Above_1v , Init_delay = 32 , Sample_accu = 4 , Mux = Ain1
Vtg_monitor Alias Porta.1 : Config Porta.1 = Input
Dim Adc_get As Word
Enable Interrupts
Do
Adc_get = Getadc()
Print Adc_get
Wait 1
Loop |