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

This page ever ...
total: 166
unique: 97

Site ...
total: 2551
unique: 1080
Online
  • Guests: 2
  • Members: 0
  • Newest Member: ole
  • Most ever online: 42
    Guests: 42, Members: 0 on Thursday 11 January 2018 - 04:46:41
Chatbox
You must be logged in to post comments on this site - please either log in from the Login box or from here.If you are not registered click here to signup.


bullet Kim
4 months ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR : USI, TWI, I2C confusion : REPLY



    Salut JP,

    Merci beaucoup pour vos reponses !
    Si, je vous comprends bien, il faut d'avoir le 'I2C addon' (de MCS) pour faire les choses I2C avec le ATMega8. Je vais aller l'acheter maintenant. cheesey
    Merci encore !

  • BASCOM-AVR : USI, TWI, I2C confusion : REPLY



    Hi, bonjour,

    [quote:5cf64261f9]I'm well aware I'm probably going to be critisicized for this but I figure after reading a LOT of mixed up stuff from (mostlly) old, some REALLY old (2003-2011) and some (very very few) newer posts I remain confused with regards TWI, USI & I2C and how to configure a master and slave implementation on a particular AVR. [/quote:5cf64261f9]
    there are no stupid questions, there are only foolish people

    about TWI/I2C , your are right but with Bascom you can create your own I2C soft port.

    About the library from Mcselec , It is a method to create your own I2C slave or master, but you can use also the serial port - USI (Tx-rx) to transfer data between 2 (or more) µcontrolers
    TX-RX is available on nearly all µcontrolers with enough ram using soft port with Bascom statement
    see serial sample and help about UART

    From years, I use ATtiny 45/85 (8 pins), ATmega 88-328 and 2560 (Arduino shield) and mega 644-1264
    Arduino shield are very easy to use with Bascom (no need of programmer) but I had build my own dev. board.

    M8, T2313 are old µC. When you visit the https://www.microchip.com/design-centers/8-bit/microchip-avr-mcus they are disapeared

    -2- use ssd1306 OLED (I2C) disp;ays with my AVRs.

    [b:5cf64261f9]see :[/b:5cf64261f9] https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13611

    So..., if the above is basically correct and makes sense, to my question(s)...
    -1- to create my own I2C SLAVE ATM8 devices (hardware TWI/I2C, I believe) : do I need the I2CSlave library addon ?
    [b:5cf64261f9]Yes ![/b:5cf64261f9]
    -2- to use an ATM8 to send data (master mode) to a TWI/I2C device : is this capabilty inherrent / inbuilt in BascomAVR 2.0.7.9 and + ?
    [b:5cf64261f9]Yes ![/b:5cf64261f9]
    -3- to create my own I2C SLAVE ATtiny2313 devices (hardware TWI/I2C, I believe) : do I need the I2CSlave library addon ?
    [b:5cf64261f9]Yes but I think you are short in flash memory only 2k ![/b:5cf64261f9]

    -4- to use an ATtiny2313 to send data(master mode) to a TWI/I2C device : is this capabilty inherrent / inbuilt in BascomAVR 2.0.7.9 and + ?
    [b:5cf64261f9] Yes but I think you are short in flash memory only 2k ! [/b:5cf64261f9]

    if you need French speaking help you can send me a message jp030405atyahoo.fr
    JP

    :wink:

  • BASCOM-AVR : USI, TWI, I2C confusion : NEWTOPIC



    I'm well aware I'm probably going to be critisicized for this but I figure after reading a LOT of mixed up stuff from (mostlly) old, some REALLY old (2003-2011) and some (very very few) newer posts I remain confused with regards TWI, USI & I2C and how to configure a maste and slave implementation on a particular AVR.

    From my research, pleae DO corrct me where I'm wrong, add more :
    as I understand it; I2C is a 2 wire serial interface created by nxp/Philips. TWI is basically the same idea/protocol but with a different name (foe licensing reasons etc) on Atmel AVRs. I also understand that USI is a generic term (universal serial interface) referring to the serial interface on (more modern ?) AVRs.

    Additionally, I believe older / less capable AVRs (ATtiny's etc) do NOT have a 'built-in' / ready-fitted / harfware I2C/TWI interface BUT they are capable of mimicing the interface via software. More modern / up-to-date / more capable AVRs (M8 etc) DO have a built-in / ready fitted / hardware I2C/TWI interface.

    Furthermore, I see reference to (and have visited the MCS sales page) for an add-on I2CSlave library. Looks like it's fairly priced too, at around 15Euro.

    My confusion arises when I try to get my head around what I need for which AVR and which I2C/TWI mode.
    I've already said there are (I believe) two types of TWI/I2C AVRs - those with inbuilt/hardware capability and those without.
    Those WITHOUT, that interest me, would include the ATtiny 2313 and those WITH woud include the ATmega8 and the ATMega2561. I use all three AVRs in various GPS and robotics projetcs - generally, though, withoit I2C.
    Currently I would like to :
    -1- create my own I2C SLAVE projects.
    -2- use ssd1306 OLED (I2C) disp;ays with my AVRs.

    I'm slowly moving away from the 2313's due to memory restrictions etc and have selected the ATMega8 for ALL my projects that don't need the additional capabilities of the 2561...

    So... if the above is basically correct and makes sense to my question(s)...
    -1- to create my own [b:d1cc2e2ebb]I2C SLAVE ATM8 [/b:d1cc2e2ebb]devices (hardware TWI/I2C, I believe) : do I need the I2CSlave addon ?
    -2- to use an ATM8 to send data (master mode) to a TWI/I2C device : is this capabilty inherrent / inbuilt in BascomAVR 2.0.7.9 and + ?
    -3- to create my own[b:d1cc2e2ebb] I2C SLAVE ATtiny2313[/b:d1cc2e2ebb] devices (hardware TWI/I2C, I believe) : do I need the I2CSlave addon ?
    -4- to use an ATtiny2313 to send data(master mode) to a TWI/I2C device : is this capabilty inherrent / inbuilt in BascomAVR 2.0.7.9 and + ?

    Apologies for this being so long... there is simply so much FUD out there and I simply failed to grasp it completely.

    Any help / corrections to my 'beliefs' above will not only help me but will, I'm sure to really useful to others too.
    Thanks a million, people. Appreciated.

    [b:d1cc2e2ebb][color=red:d1cc2e2ebb](BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.8.1 )[/b:d1cc2e2ebb][/color:d1cc2e2ebb]

  • BASCOM-AVR : Leave the old CFG file ? : REPLY



    Great stuff - thanks both !

    To clarify : answer 'NO' in order to the 'Leave old Config file ?' question to ensure a new config file is generated / saved along with the new ('Save as...') file.
    Your examples are *exactly* why I was asking: I had originally written some code for a ATTiny2313 but then found I needed to upgrade to a chip with more memory. All I wanted to do was change the $regfile for in my existing code for the new (more 'powerful', say ATmega8) chip and save my project with a matching 'Mega8' file name...

    Works perfectly and clears up some 'issues' I'd been experiencing.

    Thanks a mil.

  • BASCOM-AVR : Leave the old CFG file ? : REPLY



    The *.cfg holds IDE's configuration data.

    For example, if no [b:aad38cf185]$regfile = ...[/b:aad38cf185] exists within code, settings from the IDE --> options --> compiler --> chip apply.
    Having saved the current file with "chip = ATTiny25" as 'test.bas', while changing IDE-settings to ATTiny85 after, then 'Save As test1.bas' together with 'Leave the old CFG file ? = Yes' will result in a copy of old 'test.cfg' named 'test1.cfg'.
    This 'test1.cfg' contains the former IDE settings, i.e. 'chip = ATTiny25'.
    If 'No' is selected, then current settings of the IDE apply and are stored into a new 'test1.cfg', which in this example would mean 'chip = ATTiny85'.

    Every compiler directive '$...' within code overrides its correlating IDE- and *.cfg-settings.

  • BASCOM-AVR : Leave the old CFG file ? : REPLY



    For example when code from Internet is for "$regfile = "m8def.dat" and I want to test it with "$regfile = "m328pdef.dat" then I always "save it as" and answear "No"
    Open *.cfg file in the corresponding *.bas file folder with Notepad/Notepad++ and look what data it holds.
    I think it is worth to create new *.cfg file everytime you change the chip/regfile.

  • BASCOM-AVR : Leave the old CFG file ? : NEWTOPIC



    Hi there,
    When I grab an existing project file and use the 'Save As...' option in the File menu (usually as the basis for a modified / new version), I always get asked 'Leave the old CFG file ?'.
    I have no idea what this means or what the differences there are between 'Yes' and 'No'.
    I cant find a reference to it in the manual / google... Would someone enlighten me please ?
    Thanks a mil. & have a great weekend.
    Regards.

    [b:bb14f72642][color=red:bb14f72642](BASCOM-AVR version : 2.0.7.9 , Latest : 2.0.8.1 )[/b:bb14f72642][/color:bb14f72642]

  • BASCOM-AVR : ASM start character ! : REPLY



    Code explorer works on INC files but only in project mode.

  • BASCOM-AVR : How to store a String array at fixed memory location : REPLY



    Hi both,
    Thanks for your responses / thoughts.

    I played around with this last night and found the 'Data' and associated 'Lookup' / 'LookupStr' functionality work best for me. Whilst the larger / more capable processors (mega 2560) make all this really easy (and probably entice me to code even more sloppily than normal) the atTiny range really doesn't offer the flexibility - eeprom size etc...

    I hadn't found 'Data' and the associated 'Lookup' / 'LookupStr' !

    Thanks to both of you. Appreciated.
    Have a great day !

  • BASCOM-AVR : ASM start character ! : REPLY



    I lied, I do use code explorer.

    Doesn't seem to work on .INC files.

    Good for .BAS.

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

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR : USI, TWI, I2C confusion : REPLY
Salut JP, Merci beaucoup pour vos reponses ! Si, je vous comprends bien, il faut d'avoir le 'I2C addon' (de MCS) pour faire le...
»BASCOM-AVR : USI, TWI, I2C confusion : REPLY
Hi, bonjour, [quote:5cf64261f9]I'm well aware I'm probably going to be critisicized for this but I figure after reading a LOT o...
»BASCOM-AVR : USI, TWI, I2C confusion : NEWTOPIC
I'm well aware I'm probably going to be critisicized for this but I figure after reading a LOT of mixed up stuff from (mostlly) ol...
»BASCOM-AVR : Leave the old CFG file ? : REPLY
Great stuff - thanks both ! To clarify : answer 'NO' in order to the 'Leave old Config file ?' question to ensure a new config ...
»BASCOM-AVR : Leave the old CFG file ? : REPLY
The *.cfg holds IDE's configuration data. For example, if no [b:aad38cf185]$regfile = ...[/b:aad38cf185] exists within code, se...
»BASCOM-AVR : Leave the old CFG file ? : REPLY
For example when code from Internet is for "$regfile = "m8def.dat" and I want to test it with "$regfile = "m328pdef.dat" then I al...
»BASCOM-AVR : Leave the old CFG file ? : NEWTOPIC
Hi there, When I grab an existing project file and use the 'Save As...' option in the File menu (usually as the basis for a modif...
»BASCOM-AVR : ASM start character ! : REPLY
Code explorer works on INC files but only in project mode.
»BASCOM-AVR : How to store a String array at fixed memory location : REPLY
Hi both, Thanks for your responses / thoughts. I played around with this last night and found the 'Data' and associated 'Looku...
»BASCOM-AVR : ASM start character ! : REPLY
I lied, I do use code explorer. Doesn't seem to work on .INC files. Good for .BAS.


Date published: not known
Details

»LCD Problem
Servus zusammen, bin dabei mit dem Sensor KTY81-110 in einem Gehäuse, welches im Außenbereich montiert ist, im Bereich zwischen -30,0º … 120,0º Ce...
»Time$ , Date$ und Timerbenutzung
Ich habe beim Durchblättern meiner Programme in einer Präambel folgende Bemerkung gefunden. '* Um Time$ und Date$ auszuwerten , darf Timer0 oder Ti...
»TFT Display ILI9341 2.2" und 2.4"
Hallo, Display ILI9341 2.2" oder 2.4" 320x240 Pixel mit und ohneTouch . Es kann über SPI – 8Bit oder 16Bit angesteuert werden. Das Display hat ein...
»RFM12 an Controller
Hallo, ich habe hier ein Pollin Controller Modul ATEMEGA 168 auf einem Steckbrett. Für Tests will ich ein RFM12 Modul verbinden. (Verbindungen sieh...
»Anmerkung zum Lexikoneintrag digispark-mini-mit-bascom-avr-programmieren
Link zum anklicken: Digispark Mini mit BASCOM-AVR programmieren Danke an @Galahat für die Mühe und für die genaue Beschreibung. Bei dem Schaltbi...
»Modellbahnblinker
Hallo, hier mal ein kleiner Modellbaublinker. Es können Autoblinker oder Rundumleuchten simuliert werden. Die LEDs werden immer in einen anderen Rh...


Date published: Mon, 22 Jan 2018 14:59:54 +0000
Details

»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

»IV-17 Nixie clock GPS set time & date at power onIV-17 Nixie clock GPS set time & date at power on



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 which is released under the terms of the GNU GPL License.