Quantcast
Viewing all 20567 articles
Browse latest View live

BASCOM-AVR : over range Compare : REPLY

Hi, Just because it's a 12bit value doesn't mean the OP is using a word, that's why I'm asking what type it is. Regards Ian Dobson

Various : Html Problem : REPLY

[url]http://randomnerdtutorials.com/esp8266-web-server/[/url] Found it in bascomforum.de Is the ESP8266 driven by LUA, AT-commands or with Arduino C? On the main page of www.mcselec.com there is a link to a weatherstation. Weatherstation 4.0 has full communication between an Arduino Mega 2560 in Bascom and an ESP8266 in Arduino C. Have fun Ben Zijlstra

Various : Html Problem : REPLY

Hello Ben and thanks for the link, i saw that page elier but i need drive ESP8266 by AT commands from AVR Atmega128 :) so no LUA or arduino C but Bascom code that will set page and next read input SSID and Password from page and set the ESP8266 is what will help me :) 1. Set ESP8266 as AP and when user connect to ESP8266 then show page with SSID and Password input 2.when user input SSID and Password then set ESP8266 in station mode and next i will handle next steps :)

BASCOM-AVR : SSD1306 SPI Oled bgf picture display : REPLY

I bought another Oled SPI-4 SSD1306 display (this model is without CS pin): https://telmal.com/pl/p/Wyswietlacz-OLED-0%2C96-SPI-3-5V-SSD1306-niebieski-/408 The result is exactly the same - works well with hkipniks code (I tested with sw SPI and hw SPI) but still does not work with Mrshilov code. I tried also to initialize hw SPI and to set ports as outputs in Mrshilov code - no result. EDC, if you want to play a little with this display I can send you one :)

BASCOM-ARDUINO : 1 day delay : NEWTOPIC

Hi, I make weather station with atmega328 on 16MHz. I need for rain gauge period of 1 day. I can count impulse from rain gauge, accumulate it, but after 1 day I have to reset that value (mm/day rain fall). I use timer1 on interrupt for measuring period for wind speed sensor so I can't use it for making time base. How to solve this problem?

BASCOM-AVR : Using the xmega DAC and clock frequency? : NEWTOPIC

I am a bit confused. The ATXmega128A4U has a DAC that can [per the data sheet] perform up to 1 million conversions/second. I am writing a program to create a variable sin wave, frequency from 50 Hz to 10kHz [ using a DDS approach]. Wouldn't the number of conversion/sec be a function of the clock frequency? Seems to me that a chip running at 32mHz could perform a lot more c/sec than a chip running at 2mHz. I want the clock to run as slow as It can [ to reduce power consumption], but at the same time, I want as many samples/cycle to give me the best possible wave form at 10kHz. I've read through the data sheet, and Gone through the .DAT file, but I see nothing about this. Can anyone clue me in why that limitation exists without being a function of the clock? [b:41e279ba2c][color=red:41e279ba2c](BASCOM-AVR version : 2.0.7.8 )[/b:41e279ba2c][/color:41e279ba2c]

Various : Html Problem : REPLY

This is no different to setting the IP , gateway , password and so on I do this in my web servers I even sent text to the RS232 port from web pages have a look at my web server blogs. Regards Paul

BASCOM-ARDUINO : 1 day delay : REPLY

In my web severs in the blog section I have created a real time clock using the CPU clock I increment a variable during this interrupt the variable is there to get NTP time each 24hours you could use this for your purpose. Regards Paul

BASCOM-AVR : SSD1306 SPI Oled bgf picture display : REPLY

Pzx, your lcd only have DI pin not DO (NC) lib use this pin , my 1.3" sh1106 have the DO pin and works fine with Mrshilov SSD1306 SPI-4 & hkipniks Oled SPI code

BASCOM-AVR : USART issues, 2.0.7.6 vs later : NEWTOPIC

Hi all, I'm recently picking up a project after a long hiatus, and have run into a problem with the most recent builds of the IDE. My project includes three microcontrollers (an M128, which is the master controller, an M8 and an FTDI VNC1L USB host chip). The M8 is connected to UART0 on the M128 and the VNC1L to UART1. The entire project compiles and works fine in Bascom AVR 2.0.7.6 and earlier - but as soon as I upgrade to anything newer (2.0.7.7 all the way to 2.0.8.0) and recompile the M128's code, it wouldn't talk to either of the other micros. Here's an example: [code:1:735ebf685a]$regfile = "m128def.dat" $crystal = 16000000 $hwstack = 64 $swstack = 24 $framesize = 48 Dim R As Byte Config Com1 = 1500000 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Config Serialin = Buffered , Size = 8 Config Serialout = Buffered , Size = 8 Config Graphlcd = 240 * 128 , Dataport = Porta , Controlport = Portc , Cd = 0 , Rd = 1 , Wr = 2 , Ce = 3 , Reset = 4 , Fs = 5 , Mode = 6 Enable Interrupts 'enable the interrupts Open "com1:" For Binary As #1 'open the channel to the ATMega8 Wait 1 'allows the M8 to initalise. Locate 3 , 1 Lcd "sending A0 command" Locate 5 , 1 'position the cursor Printbin #1 , &HA0 'tells the M8 to send some data 'check for a response Do R = Inkey(#1) If R > 0 Then Lcd Hex(r) Loop Close #1 Stop [/code:1:735ebf685a] If I compile and flash the above to the M128 using 2.0.7.6 everything works - the M8 sends back the expected responses to the A8 command. However if I compile exactly the same code with any newer version of the IDE, I get no response from the M8 at all. I've checked the History files and also scanned through the help file and here but I haven't found any hints. Any ideas before I start pulling things further to pieces to check what (if anything) the M8 is receiving? Thanks in advance :-) [b:735ebf685a][color=red:735ebf685a](BASCOM-AVR version : 2.0.8.0 , Latest : 2.0.7.8 )[/b:735ebf685a][/color:735ebf685a]

BASCOM-AVR : SSD1306 SPI Oled bgf picture display : REPLY

Kimmi. thanks for your answer and a nice foto. I think there are different names of the same pins in Oleds of different producers. One direction SPI-3 interface needs at list CLK (SCLK) and DATA that is sent from uP to Oled (MOSI). When we use SPI-4 the interface needs additionaly D/C signal (SS) for Command/Data identification. In my oppinion in case of your display D0 and D1 are used as CLK and DATA signals (or the opposite).

BASCOM-ARDUINO : 1 day delay : REPLY

With Arduino Uno you can't use the internal clock system because the M328 use PB6 and PB7 with the external 16MHz crystal so impossible to use a 32Khz crystal but you can use an external I2C RTC as DS3231 or other softclock then you can use varWord= Sysday() JP :wink:

BASCOM-ARDUINO : 1 day delay : REPLY

Hello Jp I use the 16Mhz CPU clock and if you measure the frequency of the clock I have found it to be ok for 24hour periods I then updated via NTP Regards Paul

BASCOM-AVR : USART issues, 2.0.7.6 vs later : REPLY

Hello richbd, For year ago i have a similar problem but with Inputbin and to work i have to add a waitms 3 after If ischarwaiting , so test it with a little delay in your Do ..Loop Regards P_Santos

BASCOM-ARDUINO : 1 day delay : REPLY

Hi paul, Right ! :oops: I didn't look at your work before [url]http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=12358&postdays=0&postorder=asc&start=0[/url] Nice indeed ! but velja use a M328, is it possible to use Wiznet W5100 with a M328 and add all components of weather station ? maybe... I did a lot of programs on M32. JP :wink:

BASCOM-ARDUINO : 1 day delay : REPLY

Well, it's not essential to be 24 hours strictly. About external RTC, I have module with DS1307 but it fit on 5V system which is not mine. I use 3,3V, but it is important to use less components as it is possible with low power consumption as it is solar powering device. The one day period is on second place.

BASCOM-AVR : USART issues, 2.0.7.6 vs later : REPLY

do you use a boot loader? the only thing changed for the UART is when calculating the baud, the u2x bit is used when available. see also the history.txt just compile and check with a terminal emulator if the baud is what you expect.

BASCOM-AVR : SSD1306 SPI Oled bgf picture display : REPLY

I download Hkipniks code to look for differences. Libs are not mystery and can be edited by users if they know what to do :D Maybe someone find this fun like me :D Lib is like TXT file. First difference is duration of reset and wait after reset. In Hkipniks code this is 100ms [code:1:450a6b26ba]Lcd_rst = 0 Waitms 100 'Reset Display Lcd_rst = 1 Waitms 100[/code:1:450a6b26ba] In lib you have 10ms [code:1:450a6b26ba]*cbi _GLCD_PORT_RST,_glcd_rst ; Hardware reset (if exist) ldi r24,10 '<------------------------------------------------ change it into 100 for test clr r25 *Call _Waitms *sbi _GLCD_PORT_RST,_glcd_rst ldi r24,10 '<------------------------------------------------ change it into 100 for test clr r25 *Call _Waitms[/code:1:450a6b26ba] Next difference is sequence/values of initialisation bytes: [code:1:450a6b26ba]AE D5 80 A8 3F D3 00 8D 14 20 00 A1 C8 DA 12 81 55 D9 F1 DB A4 A6 AF ' basic AE A1 C8 20 00 D5 F0 A8 3F D3 00 40 DA 12 81 FF D9 F1 A4 A6 8D 14 AF ' lib[/code:1:450a6b26ba] So maybe change it in next step if longest reset duration dont take effect. Have fun :D

BASCOM-ARDUINO : 1 day delay : REPLY

Hello velja It does not matter what voltage or crystal you just change the numbers Have a look at this code http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=10604&highlight=using+cpu+clockyou only need the interrupt to increment a variable every second and to check if its 24hours worth of seconds in your main program if it is reset to zero and do the task. Note you do not need the date time library or lcd only the interrupt. Regards Paul

BASCOM-ARDUINO : 1 day delay : REPLY

If Timer0 or Timer2 is not used, 1 second can be created even with 8bit timer. And it is possible to count it 24 hours. [code:1:fd0dfc15fe] Dim T8msec As Byte Config Portb.5 = Output Config Timer2 = Timer , Prescale = 1024 , Clear Timer = 1 '16,000,000Hz / 1024 = 15,625Hz Ocr2a = 125 - 1 '15,625Hz / 125 = 125Hz (8mS) Do If Tifr2.ocf2a = 1 Then 'Did 8ms elapsed? Set Tifr2.ocf2a T8msec = T8msec + 1 If T8msec = 125 Then 'Did 1sec elapse? (8ms * 125 = 1sec) T8msec = 0 Set Portb.5 'The Arduino LED lights up at 1 second intervals. Waitms 5 Reset Portb.5 End If End If Loop End[/code:1:fd0dfc15fe]
Viewing all 20567 articles
Browse latest View live


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