Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

xtiny3227

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR XTINY/MEGAX/AVRX
View previous topic :: View next topic  
Author Message
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 107
Location: The Netherlands

netherlands.gif
PostPosted: Thu May 09, 2024 8:44 am    Post subject: xtiny3227 Reply with quote

Will the attiny3227 supported?

or can I adjust the dat file of the attiny3217 a bit so that it can be used by the attiny3227
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6063
Location: Holland

blank.gif
PostPosted: Thu May 09, 2024 9:24 am    Post subject: Reply with quote

yes it is in the next release.
i attached it. but it might not work since this series is different again. reason why it was not supported yet.
but you can try. you might need to remote the ENADISABLE section which is new.
as there are many new chips and changes i do not recall if the programmer also required a change for this.
but best to test it.

_________________
Mark
Back to top
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 107
Location: The Netherlands

netherlands.gif
PostPosted: Thu May 09, 2024 10:07 am    Post subject: Reply with quote

Thanks Mark,

the most important thing for me is the 2x uart i'm going to test in soon
Back to top
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 107
Location: The Netherlands

netherlands.gif
PostPosted: Sat May 11, 2024 7:44 am    Post subject: Reply with quote

HI Mark,

Testing with simple program, compiler gives error

bascom version 2086
compiler version 001
ide version 002

[/img]
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6063
Location: Holland

blank.gif
PostPosted: Sat May 11, 2024 10:42 am    Post subject: Reply with quote

did you remove the [ENADISABLE] section and entries from the DAT file?
that is for 2087

_________________
Mark
Back to top
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 107
Location: The Netherlands

netherlands.gif
PostPosted: Sat May 11, 2024 3:46 pm    Post subject: Reply with quote

Hi Mark

removing section [ENADISABLE] solves the error.

Thanks
Back to top
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 107
Location: The Netherlands

netherlands.gif
PostPosted: Fri May 24, 2024 3:37 pm    Post subject: Reply with quote

Hi Mark,

can I use then attiny3227.dat also for the attiny3226

because for the first photo I use the attiny3226

when testing on the attiny3226 the timers do not work. these ensure that the LED in the main loop does not flash. If I remove the call to int_tca0, 1 LED flashes



Code:

$Regfile="atxtiny3227.dat"
$Crystal=20000000
$hwstack = 100
$swstack = 100
$framesize = 100
Config Submode = New


'*******************************************************************************
' Config Clock
'*******************************************************************************

Config_clock:

   Config Sysclock = 16_20MHz , Prescale = 1 , Clockout = disabled

'*******************************************************************************
' Config IO
'*******************************************************************************

Config_io:

   Config Porta.5 = Output
   Config Portc.0 = Output



'*******************************************************************************
' Config Timer TCA0 as 100msec
'
'       1
'   ----------
'   (20MHz/64) = 0.0000032 x 31250  --> 100mSecOne Tick
'   Setup overflow interrupt of Timer/Counter C0 and
'   Enable overflow interrupt in LOW Priority
'*******************************************************************************

Config_timer_tca0:

   Config Tca0 = Normal , Prescale = 64 , Resolution = Normal , Run = On

   Tca0_per = 31250                                         ' = 100msec
 '  On Tca0_ovf Int_tca0
   Tca0_intctrl = 1

   '******************************************************************************
' Config Comport
'******************************************************************************

   Set Portc.0
   Reset Porta.5

   Enable Interrupts


   do
       Toggle Porta.5
    '  Toggle Portc.0
      Waitms 50
   loop

    End


'******************************************************************************
' Interrupt routine for TCB0
'******************************************************************************

Int_tca0:
   Toggle Portc.0
Return

 
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6063
Location: Holland

blank.gif
PostPosted: Fri May 24, 2024 4:00 pm    Post subject: Reply with quote

the 3226 and 3227 are similar. the DAT should work for both. the interrupt table is the same. just change the device id in the dat file.

the timers should work. it is not clear if it worked with your proto?

after the ISR you must reset the interrupt flag. TCA0_INTFLAGS=1 to reset the OVF flag

_________________
Mark
Back to top
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 107
Location: The Netherlands

netherlands.gif
PostPosted: Mon May 27, 2024 9:10 am    Post subject: Reply with quote

Hi Mark,

reset the OVF flag does the Job.

Thanks.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR XTINY/MEGAX/AVRX All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum