Most ever online: 170
Guests: 170,
Members: 0
on Sunday 15 January 2023 - 07:39:26
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.
I test this code with my AVRX128DB32 and it works fine (with one strange issue that I will describe below later). Start ADC is not needed. This probably is done with config parameter "Adc = Enabled".
Notice that my 32 pin uC dont have AIN0 so Im using AIN1 here. Code is working. I touch PIN11 of my uC and value fluctuate.
'The AVRX series have more oscillator options Config Osc = Enabled , Frequency = 24mhz 'set the system clock and prescaler Config Sysclock = Int_osc , Prescale = 1
'configure the internal reference to be 1v024 for the ADC Config Vref = Dummy , Adc0 = 1v024
'configure the ADC0 to read the DAC Config Adc0 = Single , Resolution = 10bit , Adc = Enabled , Prescaler = 32 , Sample_len = 1 , Mux_neg = Gnd , Mux_pos = Ain1
'dimension a variable Dim W As Word , B As Byte
Print "Test ADC"
Do 'when getadc() does not have parameters, it will use the current mux setting 'other options are : getadc(channel) and getadc(adc0 | adc1 , channel) W = Getadc(1) : Print "W:" ; W 'output should be 512 Waitms 1000 Wait 1
Loop[/code:1:a4fb96d839]
Strange is than Waitms and Wait command seems to not working. My loop is working at full uC speed I dont know why. Maybe one more coffe form is needed here
Hello, I am quite helpless with ADC in AVR128DB48. I am using downloaded .dat file: https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=15106
The first part of code is ok. (the selection of the I2C for LCD display). But the ADC part doesnt work. I copied it from sample file adc-db.bas. When compiled, it doesnt report any error, but it does nothing. It obviously stops at getadc(). Then I tried many, many config parameters, but without success. Not any error, but it doesnt work. Maybe, I am missing something fundamental. Any help welcomed.
[quote:18ef4770b3="EDC"]Maybe this answear not satisfy you to.[/quote:18ef4770b3] Very likely, as the TO - in case his hardware matches exactly the shown - uses a LCD-shield with 8bit-bus only, the SPI-connector is only for the SD-card.
As I found the topic - not so much the TO - interesting, I've looked up the linked library from user Netzman.
If nothing is user-configured for the lib, defaults using XMega are: PortC for control PortF for data
It is odd that in https://mat.midlight.eu/images/5/5c/Lcd-connections.jpg LCD_RD is not shown to be connected in 8 or 16 bit parallel mode, however Lcd_pin_rd finds use within the lib. Thus I'd add this wire between LCD_RD and PortC.5
A critical, and maybe the TO's problem is, that [b:18ef4770b3]Lcd_enable_backlight_pwm[/b:18ef4770b3] is enabled by default, which in turn drives the default pin 0 on the control port, line 134 to 136 from ILI9341.inc. Driving the display's reset pin with a PWM will create a mess.
For setting up sample code, I'd use the lib's default settings by removing any configuration for the lib, 8 bit parallel mode will be set as default. This goes well with the hardware, besides the enabled PWM by timer TCC0, this needs to be shut off: [code:1:18ef4770b3]Lcd_enable_backlight_pwm = False[/code:1:18ef4770b3] or redirected to a free pin.
I did so: [code:1:9d5a377310]Printbin &H01 ; &H04 ; &H00 ; &H00 ; &H00 ; &H02 ; &H71 ; &HCB;[/code:1:9d5a377310] Response is correct.
... but I think, that all this is possible with MAKEMODBUS statement. I red help but I'm sorry, I don't understand this.
One question more: On response data I get value
[quote:9d5a377310]&H43618A75[/quote:9d5a377310]
How to calculate a floating point from a hexadecimal value in Bascom In this case, [quote:9d5a377310]&H43618A75 is 225,541[/quote:9d5a377310] Maybe some advice.
BASCOM-AVR : MODBUS master on XMEGA : REPLY
that has been asked before. it is simple :
[code:1:b44109efd2]Dim L As Long
Dim Sn As Single At L Overlay
L = &H43618A75
prin...
»
BASCOM-AVR : MODBUS master on XMEGA : REPLY
How must be set parameters in MAKEMODBUS statement that controller send on serial port this?
[quote:9d5a377310]01 04 00 00 00 0...
»
BASCOM-AVR : MODBUS master on XMEGA : REPLY
you send too many parameters.
please check makemodbus in the help. only 4 are allowed. and you specify the start address.
i t...
UART-Senden-Empfangen mit 2 MC Ich probiere die serielle Übertragung zwischen zwei MC aus und bin leider nicht erfolgreich.An MC1 sind 4 Taster angeschlossen, die bei Betätigung ...
»
Nach langer Pause... Hallo Welt!
Ja, ich lebe noch und schau' demnächst wieder öfter vorbei - sofern ich kann und es zeitlich passt. Lesestoff hab ich ja reichlich und...
»
Strom am A4988 einstellen ? Hi ihr,
Ich versuche gerade etwas mit einem Nema17 Stepper und einem A4988 Treiber.
Am Treiber habe ich jetzt erst mal nur 12v an VMot und GND ang...
»
Power Down wecken mit PinChange? Hallo in die Runde!
Stecke da gerade über einen Schaltplan den ich gerade zusammen stricke.
Allerdings meine etwas leichtsinnige Vorstellung der A...
»
Bauteil gesucht Hallo zusammen,
wer kennt das nicht: beim Vekabeln einer neuen Bastelei wird der Platz an der GND-Klemme plötzlich ziemlich eng...
Neulich habe ic...
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...