I currently using a ATtiny85 with a simple "Blink" program to test the chip clock as ( 1Mhz,8Mhz,16Mhz )
At 1Mhz the blink work as expected 1 sec interval between each high state.
At clock speed 8,16Mhz the blink occur every 5~6 sec interval.
From GCBASIC documentation page 40, : I'm a bit confused about the statement below.
it mention if the clock is over or less than 4Mhz then in both case
the mode will use "external oscillator mode" HS or XT
while I'm looking to use 1,8,16Mhz internal osc.
• An oscillator mode will be selected, based on the following rules:
◦ If the microcontroller has an internal oscillator, and the internal oscillator is capable of
generating the speed specified in the #chip line, then the internal oscillator will be used.
◦ If the clock speed is over 4Mhz, the external HS oscillator is selected
◦ If the clock speed is 4 MHz or less, then the external XT oscillator mode is selected.
Here's the code used:
' Attiny85 Blink Test
'
;#config INTOSC_OSC_NOCLKOUT, BODEN_OFF#chip tiny85, 1
;#option Explicit;16Mhz 6 sec;8Mhz 6 sec;1Mhz 1 sec
dir portb.0 out
dir portb.1 out
dir portb.2 out
dir portb.3 out
dir portb.4 out
do
portb.0 = 1
pause 500
portb.0 = 0
pause 500
loop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note: This section does not apply to Atmel AVR microcontrollers. Atmel AVR microcontrollers
do have a similar configuration settings, but they are controlled
through "Configuration Fuses". GCBASIC cannot set these -
you MUST use the programmer software.
ATTINY85 is an AVR.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I currently using a ATtiny85 with a simple "Blink" program to test the chip clock as ( 1Mhz,8Mhz,16Mhz )
At 1Mhz the blink work as expected 1 sec interval between each high state.
At clock speed 8,16Mhz the blink occur every 5~6 sec interval.
From GCBASIC documentation page 40, : I'm a bit confused about the statement below.
it mention if the clock is over or less than 4Mhz then in both case
the mode will use "external oscillator mode" HS or XT
while I'm looking to use 1,8,16Mhz internal osc.
• An oscillator mode will be selected, based on the following rules:
◦ If the microcontroller has an internal oscillator, and the internal oscillator is capable of
generating the speed specified in the #chip line, then the internal oscillator will be used.
◦ If the clock speed is over 4Mhz, the external HS oscillator is selected
◦ If the clock speed is 4 MHz or less, then the external XT oscillator mode is selected.
Here's the code used:
https://gcbasic.sourceforge.io/help/_configuration.html
The first paragraph explains.
Note: This section does not apply to Atmel AVR microcontrollers. Atmel AVR microcontrollers
do have a similar configuration settings, but they are controlled
through "Configuration Fuses". GCBASIC cannot set these -
you MUST use the programmer software.
ATTINY85 is an AVR.
Thank's again
To be more precise. The following do work. These are a very small subset of AVRs.
Chipfamily 121: ATTiny4-5-9-10 and ATTiny102-104 - selectable frequencies are
Chipfamily 122: LGT chips - selectable frequencies are
Very good,
took a screen cap.
I updated the Help page. https://gcbasic.sourceforge.io/help/_configuration.html
If I do not document, it gets forgotten. :-)