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

BASCOM-AVR Old versions : FM PLL Transmitter 88Mhz - 108Mhz, Using TSA5511 & Atmeg : REPLY

$
0
0
Did you try Forum Search funktion

BASCOM-ARDUINO : Adruino Resetting with incomming serial data : NEWTOPIC

$
0
0
Hi all I've got a Arduino mega project hooked up to a PC for sensor data logging. The comms is USB to the micro USB port on the arduino. I have got MS Access to send an sensor ID via the usb comms. The Arduino reads this ID and reads the sensor and transmits the data back. Works well I have noticed something weird. When the ID request is transmitted to the Arduino for the first time only ,the Arduino resets. Then it runs up fully. This is not a big issue I'm just wondering why and should it. Here is the code snippet that reads the comms [code:1:1a5ecbf803] Serial_flag = Ischarwaiting() 'Listen to the Uart rs232 port for data to turn up If Serial_flag = 1 Then 'We got something in the Uart Rx_data = 0 Rx_data = Waitkey() 'Get it Filter_command 'Call the sub that fiilters the ID and reads the sensor Locate 1 , 1 Lcd Space(16) Locate 1 , 1 Lcd Rx_data ; ": " ; Sensor_value ' Display it on the LCD before it is sent out. Used for data checking Print Sensor_value 'Send the data back to access Tx_data = 0 End If [/code:1:1a5ecbf803] The whole project works well but just trips up for a few cycles at the start Thoughts?? Cheers Snow

BASCOM-ARDUINO : Adruino Resetting with incomming serial data : REPLY

$
0
0
no idea . But it does the same when I use the terminal emulator from the IDE : It does a reset when it is called :roll: jp

BASCOM-AVR : Xmega: What are Config DMA and Config ADC are doing? : REPLY

$
0
0
Ok, then have it your way :D To point out the initial question, which you thought helpful for others and which may give some meat to the thread for readers looking it up, here's the equivalent for this config: [code:1:647febaa8b] Config Dmach0 = Enabled , Burstlen = 2 , Chanrpt = Disabled , Tci = Lo , Eil = Lo , Singleshot = Disabled , _ Sar = Burst , Sam = Inc , Dar = Block , Dam = Inc , Trigger = &H10 , Btc = 4000 , Repeat = 1 , Sadr = Varptr(adca_ch0_res) , Dadr = Varptr(samples(1)) [/code:1:647febaa8b] Notice I have changed Dar, not having to reload it via code. ----> [code:1:647febaa8b]' Bitnames Const ERRINTLVL_1 = 3 Const ERRINTLVL_0 = 2 Const TRNINTLVL_1 = 1 Const TRNINTLVL_0 = 0 Const SRCRELOAD_1 = 7 Const SRCRELOAD_0 = 6 Const SRCDIR_1 = 5 Const SRCDIR_0 = 4 Const DESTRELOAD_1 = 3 Const DESTRELOAD_0 = 2 Const DESTDIR_1 = 1 Const DESTDIR_0 = 0 Const DMA_CHEN = 7 Const DMA_CHRST = 6 Const DMA_REPEAT = 5 Const DMA_TRFREQ = 4 Const DMA_SINGLE = 2 Const DMA_BURSTLEN_1 = 1 Const DMA_BURSTLEN_0 = 0 DMA_CH0_TRFCNT = 4000 DMA_CH0_REPCNT = 1 DMA_CH0_SRCADDR = Varptr(adca_ch0_res) DMA_CH0_DESTADDR = Varptr(samples(1)) DMA_CH0_CTRLB = Bits(ERRINTLVL_0 , TRNINTLVL_0) DMA_CH0_ADDRCTRL = Bits(SRCRELOAD_1 , SRCDIR_0 , DESTRELOAD_0 , DESTDIR_0) DMA_CH0_TRIGSRC = &H10 DMA_CH0_CTRLA = Bits(DMA_CHEN , DMA_BURSTLEN_0)[/code:1:647febaa8b] But - if you write it this way, you gain nothing, code and runtime is equal to the config line. This may change a bit, if after initial config (as above) only necessary registers are written for a restart, which would look like: [code:1:647febaa8b] DMA_CH0_TRFCNT = 4000 DMA_CH0_CTRLA = Bits(DMA_CHEN , DMA_BURSTLEN_0)[/code:1:647febaa8b] As far I understand the documentation TRFCNT will be only automatically reloaded in continuous mode, so for a single run it has to be reloaded via code. After that, re-enabling the channel should do the trick. Try it out and report it here. Again, as already stated: You gain a few cycles, which you are wasting by thousands in wait-cycles, but it still may be interesting from the academic POV.

BASCOM-AVR Old versions : FM PLL Transmitter 88Mhz - 108Mhz, Using TSA5511 & Atmeg : REPLY

$
0
0
[quote:2e6239c2cf="kimmi"]Did you try Forum Search funktion[/quote:2e6239c2cf] Hi Kimmi, I find that topic for PLL using a TSA5511 with Atmega8, but there are incomplete. I founded this schematic 2 day ago by browsing over the internet, but they are using a PIC.

BASCOM-ARDUINO : Adruino Resetting with incomming serial data : REPLY

$
0
0
Is it possible that the PC toggles the DTR / RTS lines and one of them Resets Arduino? Ennio

BASCOM-AVR : 20 years ! : REPLY

$
0
0
Yes Mark, I would like to add my congratulations also. Very well done. Cheers, Ross

BASCOM-AVR Old versions : line input command : NEWTOPIC

$
0
0
Hello, working on reading txt-files on m328. I think tabs are the marker, to end one input and start another, right? So, what can I do, if the read in block is bigger then a string can contain? Is there a way, to set a pointer on my own, for example a point? Thanks Christian

BASCOM-AVR Old versions : line input command : REPLY

$
0
0
In the help file you can find some info about [b:05d40c725a]buffered serialin[/b:05d40c725a] and[b:05d40c725a] bytematch[/b:05d40c725a] Have fun Ben Zijlstra

BASCOM-AVR Old versions : line input command : REPLY

$
0
0
Thank you, but this one is SPI-connected.

BASCOM-AVR Old versions : line input command : REPLY

$
0
0
Als check the helpfile for $bigstring Have fun Ben Zijlstra

BASCOM-AVR : Can I use the other pins of the ADC port to use as I/O ? : REPLY

$
0
0
Hi Duval JP, Did you get that shield worrking sucessfully ? Regards Dean

BASCOM-AVR : Can I use the other pins of the ADC port to use as I/O ? : REPLY

$
0
0
hello, Yes is working but I found I error in the schematic : finally I use the ADC alone ! I show only the abstract concerning it '-----Horloge maitre Master clock- JP Duval----------------------------------------------- ' Select Programmer 'ARDUINO' , 115200 baud and the proper COM port timeout 200 ' with use of the shield LCD_keypad DFROBOT and the shield Ds3234-SPI ' an error occurs in the schematic the Sw right=0 is grounded ' verify the Adc value of yours ! '----------------------------------------------------------------------------------------- $regfile = "M328pdef.dat" $crystal = 16000000 Config Clockdiv = 1 ' either use this or change the divider fuse byte $hwstack = 128 $swstack = 64 $framesize = 128 $baud = 57600 '38400 '19200 Config Submode = New Config Base = 0 ' arrays start with index 0 to be same as the C exemple. '---- config LCD-------------------------------------------------------------------------- Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portb.1 , Rs = Portb.0 Config Lcd = 16 * 2 Deflcdchar 1 , 4 , 14 , 31 , 4 , 4 , 4 , 4 , 4 ' fleche haute, Arrow up Deflcdchar 2 , 4 , 4 , 4 , 4 , 4 , 31 , 14 , 4 ' Fleche basse, Arrow down Deflcdchar 3 , 1 , 17 , 9 , 9 , 10 , 10 , 4 , 32 ' Valid ok Deflcdchar 4 , 1 , 2 , 31 , 4 , 31 , 8 , 16 , 32 ' esc '----------Timer PWM---Adjust the light of display---------------------------------------- Enable Interrupts Config Pinb.2 = Output 'broche utilisé par Timer 1 pour la sortie PWM D10 arduino Config Timer1 = Pwm , Pwm = 10 , Prescale = 1 , Compare B Pwm = Clear Up 'la sortie PWM1 du timer sont PB1 (OC1A) et PB2 (OC1B) ici, on utilise OC1B ' the output port for timer1 are PB1 (OC1A) and PB2 (OC1B) we use OC1B Pwm1b = 200 '--------------ADC the switches are on the ADC port PortC.0 A0--------------------------- Config Adc = Single , Prescaler = Auto , Reference = Avcc Stop Adc Enable Adc 'will set ADCSRA.ADIE bit $include "Mac_funct_lcddfrobot.inc" Dim Touche As Byte ' pour le clavier /for the Keyboard Dim Objet As Byte 'pour le réglage /to adjust date and time Dim Sw As Word Plus Alias 3 'plus hight Moins Alias 2 'minus low Ok Alias 1 'right Change Alias 5 'left Esc Alias 4 'select menu esc and the includes files ' function and macro for Shield LCD dfrobot----------------------------------------------- 'jp duval 02/09/2014 'V1.0 '----------------------------------------------------------------------------------------- $nocompile '----------Macro-------------------------------------------------------------------------- Macro Getsw ' to get the analogic value of switches Start Adc Sw = Getadc(5) 'Locate 3 , 1 : Lcd "Value:" ; Sw Stop Adc 'Wait 1 'Locate 3 , 1 : Lcd Spc(10) ' "Value:" ; Sw If Sw > 0 Then Sw = Sw / 10 End If End Macro '------------Functions-------------------------------------------------------------------- Function Cle() As Byte 'to read the analog keyboard Local Key As Byte Do Getsw 'macro Select Case Sw Case 0 To 2 'ok right Key = 1 Waitms 200 Exit Do Case 14 To 18 'up 'plus Key = 3 Waitms 200 Exit Do Case 30 To 43 'down 'moins/minus Key = 2 Waitms 200 Exit Do Case 50 To 60 'change/menu Key = 5 Waitms 200 Exit Do 'Case 80 To 83 ' select ' Key = 4 ' Waitms 200 'Exit Do Case Else Key = 0 Exit Do End Select Waitms 200 Loop Cle = Key End Function '----------------------------------- bon courage JP :wink:

BASCOM-AVR : Can I use the other pins of the ADC port to use as I/O ? : REPLY

$
0
0
Hi Duval JP, I bought one of these recently, I shall have a play. Thanks for the demo code and the fast reply Regards Dean

Share your working BASCOM-AVR code here : NOKIA-N73 LCD Library : REPLY

$
0
0
There is also on some of them like 6555 smaller 160x128 lcd 1,4", does anyone know what driver and pinout does it have?? That small on this pixel density would be awesome.

BASCOM-ARDUINO : Adruino Resetting with incomming serial data : REPLY

$
0
0
I had to cut the reset line that was connected on the ftdi chip. Works fine now and if I need to program it again, I manually press the reset button on the arduino as soon I click to program it. Thanos

BASCOM-AVR : overall undervoltage lockout for microcontroller and pheripe : NEWTOPIC

$
0
0
Hi I use a 12volt battery to bakup an industrial circuit.when main power disconnected i should send a condition status to a plc via rs232. my main problem is buttery undervoltage. if battery be full charge every thing is ok. but when battery start to reduction voltage by time, the problem start. 9volt requlator used for pheriperal circuit start to unrequlate voltage. i need a under voltage lockout circuit for 12 vlot. it should start the circuit with 11 volt and stop circuit with 10 volt. any idea would help me. thanks. [b:73740c9d83][color=red:73740c9d83](BASCOM-AVR version : 2.0.7.8 )[/b:73740c9d83][/color:73740c9d83]

BASCOM Project Blog : Weatherstation : NEWTOPIC

$
0
0
[img:aafebdf2ac]http://members.home.nl/hobbycorner/images/weatherstation/weatherstation1.JPG[/img:aafebdf2ac] 32 degrees Celsius today at Tilburg / Netherlands. Here is the proof :D The information is fetched bij a Nodemcu and weatherinformation is send to the serialin1 port of a Arduino Mega 2560 with an ILI9327-display. [b:aafebdf2ac]Nodemcu:[/b:aafebdf2ac] Were can you find the code for the nodemcu weatherstation [url]https://github.com/squix78/esp8266-projects/tree/master/arduino-ide/weather-station-v2[/url] We ripped the OLED-code from the Nodemcu software. Just used the info that comes from the serial port at 115200 baud [b:aafebdf2ac]Brief: [/b:aafebdf2ac]there is a plug-in for the recent Arduino-IDE (version 1.6.4) that can be used to program the Nodemcu You can use Generic ESP8266 modues, Nodemcu and Olimex MOD-WIFI-8266 At the preferences you can add this link and use the board manager to add the NodeMCU and ESP8266 boards. [url]http://arduino.esp8266.com/package_esp8266com_index.json[/url] == [b:aafebdf2ac]Weatherinfo:[/b:aafebdf2ac] API-key you can get it at www.forecast.io at the bottom Forecast API 1000 calls are allowed for free. In the Nodemcu software every 10 minutes a call is made to get new weaterinfo. Thats is 6 times an hour, 6 x 24 = 144 times in 24 hour. Do a test, just the nodemcu. If everything is alright you will get this information from the Nodemcu [code:1:aafebdf2ac]Requesting URL: /rest/weather?apiKey=<here your API-key>&lat=51.50&lon=5.00&units=auto HTTP/1.1 200 OKDate: Mon, 03 Aug 2015 13:49:37 GMT Server: Apache/2.2.29 (FreeBSD) DAV/2 mod_ssl/2.2.29 OpenSSL/1.0.2c mod_hcgi/0.9.5 X-Powered-By: PHP/5.4.42 Connection: close Transfer-Encoding: chunked Content-Type: text/html 11c CURRENT_TEMP=32 CURRENT_HUMIDITY=41 CURRENT_ICON=clear-day CURRENT_SUMMARY=Clear MAX_TEMP_TODAY=32 MIN_TEMP_TODAY=15 ICON_TODAY=partly-cloudy-night SUMMARY_TODAY=Partly cloudy overnight. MAX_TEMP_TOMORROW=21 ICON_TOMORROW=rain MIN_TEMP_TOMORROW=14 SUMMARY_TODAY=Rain until afternoon. 0 closing connection [/code:1:aafebdf2ac] == [b:aafebdf2ac]Bascom-AVR:[/b:aafebdf2ac] In the ZIP-file the main program, two include files and files for optional AVR-DOS. The hardware is from CE - Chinese Electronics. It is an Arduino Mega 2560 with an ILI9327 display. 400 x 240 pixels. Also in the zip-file BGC-icons and the source of these icons (BMP). Here a picture of the complete hardware: [img:aafebdf2ac]http://members.home.nl/hobbycorner/images/weatherstation/weatherstation2.JPG[/img:aafebdf2ac] Have fun Ben Zijlstra Theo Kleijn [i:aafebdf2ac]BTW it is version 0.99 because we haven't seen all weatherconditions yet. Perhaps we have to adapt the program a bit later on.[/i:aafebdf2ac]

BASCOM-ARDUINO : Adruino Resetting with incomming serial data : REPLY

$
0
0
Have just published a weatherstation in the BLOG section of this forum. It also makes use of a Arduino and gets serial info from a other device. Perhaps you can check the code how we did it. We also have spend some time to get the right solution... Have fun Ben Zijlstra

BASCOM Project Blog : Weatherstation : REPLY

$
0
0
hello Ben, well I lost ! you send yours before me, but my approach is very different ! My project is nearly finish the weather station needs some modifications (very few ) And then I have to translate it in english ! but now 15 days of vacation !
Viewing all 20687 articles
Browse latest View live


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