Quantcast
Channel: MCS Electronics Forum
Viewing all 20717 articles
Browse latest View live

BASCOM-AVR Old versions : DS1307 : REPLY

$
0
0
[quote:b3f85743ff="EDC"]It back everytime to the same date and time because of this code: [code:1:b3f85743ff]'setup date _day = 20 _month = 5 _year = 17 Gosub Setdate 'Setup time _sec = 00 _min = 12 _hour = 16 Gosub Settime [/code:1:b3f85743ff] Set time once and then remove or remark this code. Then compile and program microcontroller again. So microcontroller without this part of code will not set date and time back. Solution for comfortable setting date and time is made some Menu but this can be dificult to You if you ask about this simple "issue" :D Try at first to read (with understanding) some example codes from Bascom sample folder. Try also forum searchengine. Some book or even Google know the answears for these basic questions :D[/quote:b3f85743ff] With the code when compiling the program will update the time but when I turn off my STK500 restarts again with the same time 16:12:00 ok !! [code:1:b3f85743ff]'setup date _day = 20 _month = 5 _year = 17 Gosub Setdate 'Setup time _sec = 00 _min = 12 _hour = 16 Gosub Settime[/code:1:b3f85743ff] Now without this code as my friend says EDC when compile will update the time but every time it is restarted, the time is not erased .... ok !! [code:1:b3f85743ff]'setup date '_day = 20 '_month = 5 '_year = 17 'Gosub Setdate 'Setup time '_sec = 00 '_min = 12 '_hour = 16 'Gosub Settime[/code:1:b3f85743ff] Until then we are going well !! I am still reading with the help bascom i2c protocol is very difficult for me. :shock: :shock:

Share your working BASCOM-AVR code here : Attiny13 and Max7219 : REPLY

$
0
0
Thank you for sharing. Source is documented very well. well done! Nice to see these projects that fit into a T13.

BASCOM-AVR Old versions : DS1307 : REPLY

$
0
0
[quote:9aa03051f2="bzijlstra"]https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=10729&highlight=i2cscan Here you can find the i2c scanner. Perhaps you have to change things like regfile, crystal, config sda en slk. Perhaps you can run this to check if you see your ds1307 is seen on the i2c bus before. Could you please check it. And let us know? Have fun Ben Zijlstra[/quote:9aa03051f2] I have read and seen the code but I am very happy !! Disable these: [code:1:9aa03051f2]'$lib "i2c_twi.lbx" ' we do not use software emulated I2C but the TWI [/code:1:9aa03051f2] I already detected slave of the scanner. :D :D :D

BASCOM-AVR : pass an eeprom variable to sub/function : NEWTOPIC

$
0
0
Hi i want to pass a variable and its related eeprom variable to sub and by pressing a key save current value of variable to related eeprom variable,how is it possible? for example [code:1:63ba4f27d7] dim param as byte dim e_param as eram byte dim m as byte dim e_m as byte dim s as byte dim e_s as eram byte sub save_to_ee(param as byte,e_param as byte,key_condition) if key_condition=1 then e_param=param endif end sub - - - key_condition=pinb.0 call save_to_ee(m,e_m,key_condition) key_condition=pinb.0 call save_to_ee(s,e_s,key_condition) end [/code:1:63ba4f27d7] [b:63ba4f27d7][color=red:63ba4f27d7](BASCOM-AVR version : 2.0.7.8 )[/b:63ba4f27d7][/color:63ba4f27d7]

BASCOM-AVR : pass an eeprom variable to sub/function : REPLY

$
0
0
some note: -compiler dont accept eeprom variables as input argument -compiler accept eeprom variable as byval so it make a copy of value of variable and we can not save value to eeprom in sub/functions. thanks

BASCOM-AVR Old versions : DS1307 : REPLY

$
0
0
You make it very difficult for me. An i2c scanner scans the i2c bus and should display all i2c devices on the bus it finds. Your ds1307 occupies two addresses on hex(D0) and hex(D1. So you should see only that single device. You are talking about 'Research', I suggest you read some more on the working of i2c. The help of Bascom is very clear on this. In 2014 you were struggeling with the same problem. Have fun Ben Zijlstra

Share your working BASCOM-AVR code here : SSD1306 LCD SPI-mode library : REPLY

$
0
0
Does the atxmega library support?

Share your working BASCOM-AVR code here : SSD1306 LCD SPI-mode library : REPLY


BASCOM-AVR : pass an eeprom variable to sub/function : REPLY

$
0
0
I use tables for that. You should only decide which address will represent whitch value. [code:1:6c485a4b70]Config Submode = New 'general purposes Dim N As Byte , Helpb As Byte , Helpw As Word 'variables Dim My_bytes(20) As Byte , My_ee_bytes(20) As Eram Byte Sub Read_whole_memory() For N = 1 To 20 My_bytes(n) = My_ee_bytes(n) Next End Sub Sub Save_to_ee(byval Address As Byte) My_bytes(address) = Helpb My_ee_bytes(address) = Helpb End Sub Call Save_to_ee(1) 'for example[/code:1:6c485a4b70]

BASCOM-AVR : pass an eeprom variable to sub/function : REPLY

$
0
0
thanks a lot EDC i remember that we have some instructions in assembly for find address,why the compiler does not find address by these instruction automatically and write to related address?! is some limitions on stack or frame or some things else?

BASCOM-AVR Old versions : DS1307 : REPLY

$
0
0
Hi all!! Does anyone have a manual "How to prepare a BASCOM i2c address from an i2c address?" I would like to read this manual since the help does not appear DS1307 nor example. :D

BASCOM-AVR Old versions : DS1307 : REPLY

$
0
0
The manual/help does mention that bascom i2c address is vendor address shift left by 2. Or multiply by 2. The i2c scanner will give this info. if you had done some search on the forum you would have found that too. The more interesting question is : why does bascom use a different address? After an i2cstart we must send the address of the slave. This address has a Read/Write bit at bit position 0, which indicates if we want to read or write. Thus the 8 bit we must send is A6,A5,A4,A3,A2,A1,A0, R/W While vendor uses address &H20 for example, we must send it as &H40 because of the R/W bit. And while R/W is not actually an address, i think it simplifies dealing with I2C since it is always sent as part of the address.

BASCOM-AVR : Simple Sample Programmer : REPLY

$
0
0
a related question about programmers, is any one try to make an isolated spi programmer? when working near power elements like AC Motor drives, the noise of high voltage switching make computer completely unstable. in some cases my programmer burn. so i want to make an isolated spi programmer. my programmer connected via usb, and making an usb isolator is very difficult, so i decide to isolate output signals of my programmer. just some answer will help me, i want to know: 1- does the condition of pins of Mosi-Miso-Sclk-Reset change whitin spi programing or not? 2- same question for Xmega Types, PDI and reset? if the direction is always same, for example Mosi is always output, then using a optocoupler solve my problem, othervise the solution will be more difficult. thanks for your answers.

BASCOM-AVR : RTC32 disabling and enabling on AtxMega256A3BU : REPLY

$
0
0
Correction on my previous reply. After having encountered all kinds of sporadic bugs which only occurred for the Atxmega256A3U and not for the Atxmega258a3bu, I discovered that the Rtc_ctrl = 0 command does not stop the RTC and the sectic routine keeps being fired every second. So for now I am not able to stop / start the RTC on the A3U by syntax. On the Atxmega256a3bu hoever, the command Rtc32_ctrl.0 = 0 does stop the Rtc32 as sectic is not fired. So in summary: Atxmega256a3u: Rtc_ctrl = 0 has no effect as rtc keeps running Atxmega256a3bu: Rtc32_ctrl.0 = 0 works as rtc32 is stopped. Any other options to start/ stop the RTC?

Share your working BASCOM-AVR code here : TFT8K2346FPC-A1-E LCD 272x480 - ILI9481 : REPLY

$
0
0
[b:00b4a6cb22]Hello Mrshilov [/b:00b4a6cb22] [b:00b4a6cb22]can i use this library for " ILI9486" ?[/b:00b4a6cb22] https://www.aliexpress.com/item/Free-shipping-5pc-lot-Full-view-4inch-TFT-LCD-screen-with-touch-37pin-8-16bits-Parallel/32623734305.html?spm=2114.40010708.4.2.6z7jcH [b:00b4a6cb22] if can not.do you have any library for ILI9486 ? Best Regards[/b:00b4a6cb22]

BASCOM-ARDUINO : Arduino Mega 2560 and Uno R3 getting stk500_recv() programme : NEWTOPIC

$
0
0
I have followed the directions here: https://avrhelp.mcselec.com/index.html?arduino.htm Tried different baud rates, both arduino and arduino stk500v2. Nothing I do makes this work. This is on windows 7. Arduino IDE version 1.8.2. Boards work fine in the Arduino IDE but not in BASCOM. Any ideas?

BASCOM-ARDUINO : Arduino Mega 2560 R3 and Uno R3 getting error : REPLY

$
0
0
hi, to work with arduino and bascom it is simplest to do like I write here :[url]https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=12472[/url] it is working with W7 W8 W8.1 and W10 both 32 and 64 bits I'm working with it now. try it and let us know. jp :wink:

EASY TCP/IP : URL2IP issues : NEWTOPIC

$
0
0
Hi, i happy about the new function URL2IP in the latest Bascom revision. Thats what i never hoped to find. Regarding to the Help its connecting to Google DNS server 8.8.8.8 , is this changeble to my own internal DNS Server so it works for my internal network. I used the Wiz510 sample, works fine as it is. Is the Google server maybe the reason why it does not work for all url names? It works for the "mcselec.com" url from the sample, but many URL do not work even if they respond to a manual request via my PCs command line. One not working example is my page gs400.de; WWW.Bild.de works fine. Regards, Tobias

BASCOM-AVR : XMega-A1 Xplained - Simple Blink a Led : NEWTOPIC

$
0
0
Hey Guys, I have written a small program for the Mega-A1 Xplained (uses the CPU ATXMEGA128A1) with the help of the official Bascom-Documentation: https://avrhelp.mcselec.com/index.html?atxmega.htm But unfortunately I cant see anything blinking on the chip. This is my code: [code:1:a4251bf672] $regfile = "xm128a1def.dat" $crystal = 32000000 '32MHz $hwstack = 64 $swstack = 40 $framesize = 64 Config Osc = Enabled , 32mhzosc = Enabled Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1 Config Porte.1 = Output Do Toggle Porte.1 Waitms 500 Loop End 'end program [/code:1:a4251bf672] I cant upload pictures to this Forum, because I do not have at least 4 posts. As a programmer I use the [b:a4251bf672]ALL-AVR-Programmer[/b:a4251bf672] which the BASCOM IDE recognizes as [b:a4251bf672]USBprog Programmer / AVR ISP mkII[/b:a4251bf672]. The Programming process -by clicking "Program chip (F4)"- executes without errors and reads as follows: Verified OK Buffer read AVRISP MK2 detected 1024 bytes written to FLASH AVRISP MK2 detected CHIP erased AVRISP MK2 detected Chip ID: 1E974C AVRISP MK2 detected Auto program C:UsersmyuserDocumentsMyProjectsHelloWorld BASCOMHELLO.EEP not found C:UsersmyuserDocumentsMyProjectsHelloWorld BASCOMHELLO.BIN loaded 804 bytes into FLASH buffer Elektor / mkII compatible programmer set Started Why isnt anything blinking? [b:a4251bf672][color=red:a4251bf672](BASCOM-AVR version : 2.0.7.5 , Latest : 2.0.7.8 )[/b:a4251bf672][/color:a4251bf672]

BASCOM-AVR : XMega-A1 Xplained - Simple Blink a Led : REPLY

$
0
0
Q: What is the Program and Debug Interface (PDI) ? A: The Program and Debug Interface (PDI) is an Atmel proprietary interface for external programming and on-chip        debugging of a device.     “The XMEGA doesn’t have the SPI based In-System Programming (ISP) interface for    external programming, which has been used for megaAVR. Nor does it have the    debugWIRE interface. These have been replaced by a two wire “Programming and    Debugging Interface” (PDI).” [from Atmel App Note AVR1005]
Viewing all 20717 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>