Main Menu
Counter
This page today ...
total: 2
unique: 1

This page ever ...
total: 237
unique: 167

Site ...
total: 4657
unique: 2799
Online
  • Guests: 2
  • Members: 0
  • Newest Member: SGSGSG3
  • 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
8 years ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR XTINY/MEGAX/AVRX : Config-ADC0 in AVRX_DD_.DAT files : REPLY



    Yes you are right. I have corrected it.

  • BASCOM-AVR XTINY/MEGAX/AVRX : Config-ADC0 in AVRX_DD_.DAT files : NEWTOPIC



    It seems that in the DAT files AVRX16DD14.DAT to AVRX64DD32.DAT there is a typo in [b:1425574b05]Config-adc0[/b:1425574b05].
    In the lines [b:1425574b05]OPTION13DATA[/b:1425574b05] and [b:1425574b05]OPTION14DATA[/b:1425574b05] there is a missing comma between the values [b:1425574b05]​​$1D and $1E[/b:1425574b05].
    Without the correction, the ADC0 setting for measuring the chip temperature, the voltages Vdddiv10, Vddio2div10 and so on are mixed up.

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    Here is an image showing there has been and currently is the correct display activity after changing TWI channel. Obviously they are not running concurrently which is where the 2x2 library is used..

    [img:ca778f3e09]https://www.mcselec.com/userpix/4797_20260203_143108_1.jpg[/img:ca778f3e09]

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    And

    [quote:e635227bb2]Then you can download and test the attached lib.
    Same test. NO variable named I2C_ADDR and see if it still works.[/quote:e635227bb2]

    This still works....

    Finally

    [quote:e635227bb2]Then the last test would be to create I2C_ADDR and assign it with &H78 BEFORE you use config graphlcd.
    It should work too.[/quote:e635227bb2]

    And this works too!

    Thank you to all who contributed to fixing this!

    Best r
    Guy


    This is how simple it now is to swap the SSD1306 from TWI port 0 where it might conflict with high ADC channel usage on Port C, to the second hardware TWI on Port E.
    [code:1:e635227bb2]Config Scl1 = PortE.1 ' used i2c pins
    Config Sda1 = PortE.0
    Config Twi1 = 400000 ' i2c speed


    I2cinit

    Const cTWI = 1


    $lib "I2c_twi-multi.lib" ' we do not use software emulated I2C but the TWI
    $lib "glcdSSD1306-I2C-TWI-option.lib" ' override the default lib with this special one

    Dim _i2cchannel as byte
    _i2cchannel = 1 ' 0 for TWI0, 1 for TWI1

    Dim I2c_addr as byte
    I2c_addr = &H78
    [/code:1:e635227bb2]

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    [quote:f8a643f4d1]So please try that first if that is right.
    glcdSSD1306-I2C-TWI-option.lib
    I2C_TWI-MULTI.lib [/quote:f8a643f4d1]

    This works like a charm - toggling _i2cchannel redirects the display correctly. I did notice that as long as one TWI is configured , then both ports work.

    I will do the other test in a moment.....

    [code:1:f8a643f4d1]'-------------------------------------------------------------------------------
    ' SSD1306-I2C.BAS
    ' (c) MCS Electronics 1995-2020
    ' Sample to demo the 128x64 I2C OLED display
    '
    '-------------------------------------------------------------------------------
    $regfile = "m328pbdef.dat"
    $hwstack = 32
    $swstack = 32
    $framesize = 32
    $crystal = 8000000
    Config Clockdiv = 1 ' make sure the chip runs at 8 MHz

    'Config Scl = Portc.5 ' used i2c pins
    'Config Sda = Portc.4
    'Config Twi = 400000 ' i2c speed

    Config Scl1 = PortE.1 ' used i2c pins
    Config Sda1 = PortE.0
    Config Twi1 = 400000 ' i2c speed


    I2cinit

    Const cTWI = 1

    '$lib "i2c_twi.lbx" ' we do not use software emulated I2C but the TWI
    $lib "I2c_twi-multi.lib" ' we do not use software emulated I2C but the TWI
    '$lib "glcdSSD1306-I2C.lib" ' override the default lib with this special one
    $lib "glcdSSD1306-I2C-TWI-option.lib" ' override the default lib with this special one

    Dim _i2cchannel as byte
    _i2cchannel = 1 ' 0 for TWI0, 1 for TWI1


    #if _build < 20784
    Dim ___lcdrow As Byte , ___lcdcol As Byte ' dim these for older compiler versions
    #endif

    Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"
    Cls
    Setfont Font8x8tt ' select font

    Do

    cls

    Lcdat 1 , 1 , "BASCOM-AVR"
    Lcdat 2 , 10 , "1995-2020"
    Lcdat 8 , 5 , "MCS Electronics" , 1
    Waitms 1000

    Showpic 0 , 0 , Plaatje

    Waitms 1000

    Loop

    End


    $include "font8x8TT.font" ' this is a true type font with variable spacing


    Plaatje:
    $bgf "ks108.bgf" ' include the picture data[/code:1:f8a643f4d1]

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    Ok this version is the same as the previous one except it supports dynamic LCD address.
    In order to use that create a variable named I2C_Addr and assign it the value of your LCD. That is typical &H78
    For the rest use the I2C_TWI-MULTI.lib with its instructions.

    You use 1 LCD so you only set the _I2CCHANNEL to the second TWI.
    Now i think of it : the LCD lib you have now should work with the second TWI too ( I2C_TWI-MULTI.lib)

    So please try that first if that is right.
    glcdSSD1306-I2C-TWI-option.lib
    I2C_TWI-MULTI.lib

    And use the lib you tested last. It should work.

    Then you can download and test the attached lib.
    Same test. NO variable named I2C_ADDR and see if it still works.
    Then the last test would be to create I2C_ADDR and assign it with &H78 BEFORE you use config graphlcd.
    It should work too.

    For users that want to use 2 LCD with different address : the multi lib is needed and since the lib initialize 1 LCD you have to call initlcd twice (one time with the address loaded in I2C_addr)

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    [quote:ee32c5ef9a="albertsm"]ok i will post a similar version for the v2x2 version so you can use both SPI interfaces.[/quote:ee32c5ef9a]

    Great - not that it matters but it was a case of being able to use [b:ee32c5ef9a]either[/b:ee32c5ef9a] TWI interface. This design does not actually use both but I needed to use the second TWI for the display as the ADC inputs on PortC were already used...

    Best r
    Guy

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    ok i will post a similar version for the v2x2 version so you can use both SPI interfaces.

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    Thanks - I deleted the previous version from the lib folder and added the new one. Yes $lib "glcdSSD1306-I2C-TWI-option.lib" now works on TWI 0.

    Best r
    Guy

  • BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY



    Odd that the sample works since it uses R20 in the lib which the TWI will use too. I will check that.
    But for the option lib i made a dumb error. I corrected it so you can download it again and try again.

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

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR XTINY/MEGAX/AVRX : Config-ADC0 in AVRX_DD_.DAT files : REPLY
Yes you are right. I have corrected it.
»BASCOM-AVR XTINY/MEGAX/AVRX : Config-ADC0 in AVRX_DD_.DAT files : NEWTOPIC
It seems that in the DAT files AVRX16DD14.DAT to AVRX64DD32.DAT there is a typo in [b:1425574b05]Config-adc0[/b:1425574b05]. In ...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Here is an image showing there has been and currently is the correct display activity after changing TWI channel. Obviously they ...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
And [quote:e635227bb2]Then you can download and test the attached lib. Same test. NO variable named I2C_ADDR and see if it sti...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
[quote:f8a643f4d1]So please try that first if that is right. glcdSSD1306-I2C-TWI-option.lib I2C_TWI-MULTI.lib [/quote:f8a643f4d...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Ok this version is the same as the previous one except it supports dynamic LCD address. In order to use that create a variable na...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
[quote:ee32c5ef9a="albertsm"]ok i will post a similar version for the v2x2 version so you can use both SPI interfaces.[/quote:ee32...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
ok i will post a similar version for the v2x2 version so you can use both SPI interfaces.
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Thanks - I deleted the previous version from the lib folder and added the new one. Yes $lib "glcdSSD1306-I2C-TWI-option.lib" now ...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Odd that the sample works since it uses R20 in the lib which the TWI will use too. I will check that. But for the option lib i ma...


Date published: not known
Details

»BASCOM-AVR XTINY/MEGAX/AVRX : Config-ADC0 in AVRX_DD_.DAT files : REPLY
Yes you are right. I have corrected it.
»BASCOM-AVR XTINY/MEGAX/AVRX : Config-ADC0 in AVRX_DD_.DAT files : NEWTOPIC
It seems that in the DAT files AVRX16DD14.DAT to AVRX64DD32.DAT there is a typo in [b:1425574b05]Config-adc0[/b:1425574b05]. In ...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Here is an image showing there has been and currently is the correct display activity after changing TWI channel. Obviously they ...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
And [quote:e635227bb2]Then you can download and test the attached lib. Same test. NO variable named I2C_ADDR and see if it sti...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
[quote:f8a643f4d1]So please try that first if that is right. glcdSSD1306-I2C-TWI-option.lib I2C_TWI-MULTI.lib [/quote:f8a643f4d...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Ok this version is the same as the previous one except it supports dynamic LCD address. In order to use that create a variable na...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
[quote:ee32c5ef9a="albertsm"]ok i will post a similar version for the v2x2 version so you can use both SPI interfaces.[/quote:ee32...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
ok i will post a similar version for the v2x2 version so you can use both SPI interfaces.
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Thanks - I deleted the previous version from the lib folder and added the new one. Yes $lib "glcdSSD1306-I2C-TWI-option.lib" now ...
»BASCOM-AVR old unsupported versions : M328PB Can't get second hardware TWI to drive SSD1306 Displa : REPLY
Odd that the sample works since it uses R20 in the lib which the TWI will use too. I will check that. But for the option lib i ma...


Date published: not known
Details

»4 January 20244 January 2024
»93c46 editor programmer bascom &amp; vb93c46 editor programmer bascom &amp; vb
»93c46 Bascom &amp; VB693c46 Bascom &amp; 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.