Main Menu
Counter
This page today ...
total: 0
unique: 0

This page ever ...
total: 163
unique: 134

Site ...
total: 5760
unique: 3646
Online
  • Guests: 1
  • Members: 0
  • Newest Member: Kimmi
  • Most ever online: 170
    Guests: 170, Members: 0 on 15 Jan 2023 : 07:39
Chatbox
You must be logged in to post comments on this site - please either log in from the Login box or from here.


bullet Kim
9 years ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR XTINY/MEGAX/AVRX : xtiny ADC latest syntax? : REPLY



    [quote:654270321f="Duval JP"]hi,
    maybe my post is stupid
    [quote:654270321f] but even the samples give error when try to compile them[/quote:654270321f]

    I try to compile the sample adc.bas with axtiny816 and it is ok

    Did you buy and install the add-on?[img:654270321f]https://www.mcselec.com/userpix/115_20260727_194148_1.jpg[/img:654270321f]

    jp :wink:[/quote:654270321f]

    Hi JP,

    Of course i buyed&installed.
    In my pc it give errors (still win10) - but it is good idea to try on another pc.

    Laszlo

  • BASCOM-AVR XTINY/MEGAX/AVRX : xtiny ADC latest syntax? : REPLY



    hi,
    maybe my post is stupid
    [quote:e93aaaa853] but even the samples give error when try to compile them[/quote:e93aaaa853]

    I try to compile the sample adc.bas with axtiny816 and it is ok

    Did you buy and install the add-on?[img:e93aaaa853]https://www.mcselec.com/userpix/115_20260727_194148_1.jpg[/img:e93aaaa853]

    jp :wink:

  • BASCOM-AVR XTINY/MEGAX/AVRX : xtiny ADC latest syntax? : REPLY



    [quote:28b5c8af7a="ok1hdu"]I don't have an Attiny816 here so I can't check it, so no guarantees, however:
    The correct syntax for setting Sysclock is:[code:1:28b5c8af7a]
    Config Sysclock = 16_20mhz , Prescale = 1[/code:1:28b5c8af7a]
    Then it should work:[code:1:28b5c8af7a]
    W = Getadc(5) : Print "W:" ; W[/code:1:28b5c8af7a]

    Jarda[/quote:28b5c8af7a]

    Thanks for your reply and sorry about my late response.

    This config working today (with bascom 2.0.8.0.003) with another type ATtiny:
    [code:1:28b5c8af7a]'-------------------------------------------------------------------------------
    ' ATtiny402 ADC Dual-Channel Sampling Demo
    ' Function: Continuous sampling and channel switching between AIN6 and AIN7
    '-------------------------------------------------------------------------------
    $regfile = "atxtiny402.dat" ' Microcontroller definition file
    $crystal = 20000000 ' System clock speed: 20 MHz

    $hwstack = 48 ' Hardware stack size allocation
    $swstack = 48 ' Software stack size allocation
    $framesize = 48 ' Frame size allocation

    '--- Clock Configuration (20 MHz) ---
    Config Sysclock = 20mhz , Prescale = 1 ' Set system clock to 20MHz without prescaling

    '--- Port Setup ---
    Config Porta.6 = Input ' Set PA6 (AIN6) as input pin
    Config Porta.7 = Input ' Set PA7 (AIN7) as input pin

    '--- ADC Configuration (1.1V Internal Reference, 10-bit) ---
    Vref_ctrla = &B00010000 ' REFSEL=10: Select 1.1V internal reference

    Adc0_ctrlc = &B00000011 ' SAMPCAP= on, Prescaler 0 to 8 = div2/4/8/16/32/64/128/256
    Adc0_ctrlb = &B00000100 ' Sampnum 0 to 6 = none,2,4,8,16,32,64 sample
    Adc0_ctrla = &B00000011 ' RESSEL=0 (10-bit resolution), FREERUN=1, ENABLE=1

    ' Disable digital input buffers on analog pins as per datasheet recommendation
    Porta_pin6ctrl = Porta_pin6ctrl And &B11111000 ' Clear the lowest 3 ISC bits on PA6
    Porta_pin6ctrl = Porta_pin6ctrl Or &B00000111 ' Set INPUT_DISABLE (7) on PA6
    Porta_pin7ctrl = Porta_pin7ctrl And &B11111000 ' Clear the lowest 3 ISC bits on PA7
    Porta_pin7ctrl = Porta_pin7ctrl Or &B00000111 ' Set INPUT_DISABLE (7) on PA7

    '--- Variables ---
    Dim Adc_val_ch6 As Word ' Measured ADC value for AIN6
    Dim Adc_val_ch7 As Word ' Measured ADC value for AIN7
    Dim Current_channel As Byte ' Current active MUX channel ID

    '--- ADC Initial Kick-off ---
    Adc0_muxpos = 6 ' Set initial analog channel to AIN6
    Adc0_command = 1 ' Start first conversion in Free-Running mode

    '--- Main Loop ---
    Do

    ' Read current MUX channel ID
    Current_channel = Adc0_muxpos And &B00011111 ' Mask out channel bits

    ' Channel switching logic with Free-Running correction
    If Current_channel = 6 Then
    Adc0_muxpos = 7 ' Switch target channel to AIN7
    Bitwait Adc0_intflags.0 , Set ' Wait for previous conversion completion
    Adc0_intflags.0 = 1 ' Clear interrupt flag
    Adc_val_ch6 = Adc0_res ' Save converted result for AIN6
    'Print Adc_val_ch6 ' Print value
    Bitwait Adc0_intflags.0 , Set ' Wait for fresh conversion on new channel
    Adc0_intflags.0 = 1 ' Clear interrupt flag
    Adc_val_ch6 = Adc0_res ' Read stabilized result for AIN6
    Else
    Adc0_muxpos = 6 ' Switch target channel to AIN6
    Bitwait Adc0_intflags.0 , Set ' Wait for previous conversion completion
    Adc0_intflags.0 = 1 ' Clear interrupt flag
    Adc_val_ch7 = Adc0_res ' Save converted result for AIN7
    'Print Adc_val_ch7 ' Print value
    Bitwait Adc0_intflags.0 , Set ' Wait for fresh conversion on new channel
    Adc0_intflags.0 = 1 ' Clear interrupt flag
    Adc_val_ch7 = Adc0_res ' Read stabilized result for AIN7
    End If

    Loop[/code:1:28b5c8af7a]

  • BASCOM-AVR : Petite FAT File System : REPLY



    Try use KokkeKat library. I was use it even on Mega8 https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewforum&f=18

  • Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY



    I get mine from AliExpress in China.
    If you search for products using "ST7796S" or "ILI9488" on AliExpress, you will find many sellers.
    It also appears that 5.0-inch TFT LCDs using the SSD1963 controller are available on AliExpress.

    They are sold on eBay as well.

  • Share your working BASCOM-AVR code here : Window mode AC0+AC1 together with ADC0 in AVR128DB48 : REPLY



    Hi

    Thanks for sharing this clever code. It is good to see that you try these new things and share your findings and code !

  • Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY



    O'family
    Great work, thank you.
    I used similar 5" screens (480 x 800 px) with SSD1963 controllers back in 2015–2017;
    unfortunately, those screens and the M2560 interface have disappeared from my supplier's catalog.
    Where do you get yours?
    I’ve switched to Nextion HMIs; I’m happy with them, though I imagine the use case and price point are different.

    JP :wink:

  • BASCOM-AVR : Petite FAT File System : NEWTOPIC



    Has anybody ported the open source Petite FAT File System to BASCOM? I need to read (no writing) from a microSD card using an ATtiny841. This chip is too small for AVR-DOS. But the Petite FAT should be possible on an ATtiny841. Before I try to use it with BASCOM, I wanted to find out if anybody has already gone down that road. Ideally I would like to first read the files in the root directory. Then read the selected file.

    [b:7ba116c965][color=red:7ba116c965](BASCOM-AVR version : 2.0.8.7 )[/b:7ba116c965][/color:7ba116c965]

  • Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY



    The 8-bit parallel modules are compatible with both the ILI9488 and ST7796S, allowing them to share the same library.

    Equipped with level converters on all control and bus lines, the module supports operation at both 5V and 3.3V.

    Designed to stack directly onto an Arduino Mega2560, this LCD module board eliminates the need for external wiring during assembly.

    Arduino Mega2560 circuit diagram
    https://drive.google.com/file/d/1hHhWQy_GgJ0ksXhCwSjsAQEofvsnEigI/view?usp=drive_link

    Arduino Mega2560 Video
    https://youtu.be/9SJXzlYJy8Q

  • Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY



    O-Family, huge thanks to you for all your work on this. It inspired me to make the required changes for bascom. I think users have no idea what a challenge it was/is to convert an older lib to the new word type but i have huge respect for your work. Thank you for sharing and that reminds me to hurry with the 2088. Please people : no questions about bascom 2088 here : just about the work of O-Family!

| Date published: not known
Back to newsfeed list
Welcome
Username or Email:

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR XTINY/MEGAX/AVRX : xtiny ADC latest syntax? : REPLY
[quote:654270321f="Duval JP"]hi, maybe my post is stupid [quote:654270321f] but even the samples give error when try to compile...
»BASCOM-AVR XTINY/MEGAX/AVRX : xtiny ADC latest syntax? : REPLY
hi, maybe my post is stupid [quote:e93aaaa853] but even the samples give error when try to compile them[/quote:e93aaaa853] I...
»BASCOM-AVR XTINY/MEGAX/AVRX : xtiny ADC latest syntax? : REPLY
[quote:28b5c8af7a="ok1hdu"]I don't have an Attiny816 here so I can't check it, so no guarantees, however: The correct syntax for ...
»BASCOM-AVR : Petite FAT File System : REPLY
Try use KokkeKat library. I was use it even on Mega8 https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewforu...
»Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY
I get mine from AliExpress in China. If you search for products using "ST7796S" or "ILI9488" on AliExpress, you will find many se...
»Share your working BASCOM-AVR code here : Window mode AC0+AC1 together with ADC0 in AVR128DB48 : REPLY
Hi Thanks for sharing this clever code. It is good to see that you try these new things and share your findings and code ! ...
»Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY
O'family Great work, thank you. I used similar 5" screens (480 x 800 px) with SSD1963 controllers back in 2015–2017; unfortun...
»BASCOM-AVR : Petite FAT File System : NEWTOPIC
Has anybody ported the open source Petite FAT File System to BASCOM? I need to read (no writing) from a microSD card using an ATti...
»Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY
The 8-bit parallel modules are compatible with both the ILI9488 and ST7796S, allowing them to share the same library. Equipped ...
»Share your working BASCOM-AVR code here : Library for 4-inch 320x480dot Color LCD [ST7796S / ILI9488] : REPLY
O-Family, huge thanks to you for all your work on this. It inspired me to make the required changes for bascom. I think users have...


Date published: not known
Details

»Feuchtesensor
Hallo, ich hab solche 'Schätzeisen' im Einsatz, die zeigen im Boden sonst was. Während es auf dem Tisch sauber, wiederholbar unterscheiden konnte o...
»Terminalplatine mobil
Bislang hatte ich meine Terminalplatine ( Atmega 328 mit Display und Eingabetastatur) immer nur in Schaltschränken oder ortsfesten Gehäusen eingese...
»OLED 1,5" 128x128 SH1107
habe mir aus China OLED-Display besorgt: 1,5 Zoll 128x128 Pixel , Treiber angeblich SH1107 leider gibt es dafür in Bascom-AVR keine Library. meine ...
»CRC16 mag nicht
Eine KI hat mir diesen Vorschlag erstellt um die Checksumme zu berechnen BASCOM-Quellcode (76 Zeilen)Das läuft nicht, es kommen Fehlermeldungen M...
»Hdmi Microskop
Wie das im Leben so ist, mit jeden Geburtstag gehs mit den Augen weiter bergab. Hat jemand eine HDMI Kamera bzw Microskop in Betrieb? Grad das HDMI...
»Start BASCOM
Hallo zusammen Seit einigen Wochen habe ich Startprobleme bei BASCOM. Nach Doppelklick bleibt BASCOM als Hintergrundprozess mit 0% CPU-Last hängen....


Date published: Fri, 31 Jul 2026 09:06:29 +0000
Details

»4 January 20244 January 2024
»93c46 editor programmer bascom & vb93c46 editor programmer bascom & vb
»93c46 Bascom & VB693c46 Bascom & VB6
»Analog clock on SSD1289 3.2" 240x320 lcdAnalog clock on SSD1289 3.2" 240x320 lcd
»Nextion HMI lcd with KaraDio the best webradio esp8266Nextion HMI lcd with KaraDio the best webradio esp8266
»Adding 240x320 lcd to the WifiWebRadioAdding 240x320 lcd to the WifiWebRadio


Date published: not known
Details

»Bascom Can Bus Sniffer
»R.I.P Ben Zijlstra
Remembering Ben Zijlstra We hope that people who love Ben will remember and celebrate his life. more info at MCS www.mcselec.com/index2.ph...
»KaRadio webradio ESP8266
The Dimitris board is available at https://github.com/dsaltas/WiFi-WebRadio  This is a hardware project for Ka-Radio
»93C46
small tool to edit 93C46 eeprom written in BascomAVR & VB  Bascom control the 93C46 so we sent data via comport from VB code will be added later ...
»nRF24L01+ RC Controller
This is a RC controller TX & RX unit with nRF24L01+ nRF24L01+ / with PA and LNA for longer range facts: TX 1 x potmeter for servo ...
»RAW lcd
Connecting RAW lcd to atmega8 the lcd is 6 digit + time glass LCD Hour Meter for  tractor ,air compressor, ect the lcd have 4 com pins  & 14...


Date published: not known
Details


Proudly powered by e107 Bootstrap CMS which is released under the terms of the GNU GPL License.