ADC in MSP430 Microcontroller

  Рет қаралды 12,787

drselim

drselim

Күн бұрын

Пікірлер: 55
@m.albert482
@m.albert482 3 жыл бұрын
When I compile I get an error because there are too few argument for the following functions: ltoa(memval, mv_char); Should this not have three arguments?
@drselim
@drselim 3 жыл бұрын
Hi, the code was working. I had tested it as i uploaded the video. However there’s a better way to find the fractional part (probable update for the code): assuming the voltage to be 3.3647 volts: to obtain the integer part, divide the number to ten and assign it to an int, to get the 1st digit in the fractional part, multiply the voltage by ten and use%10, etc.. A similar method is here in lines 86-89 github.com/selimg76/microcontroller/blob/7afbd746400feaa96b115f34c8775de08973908e/PIC18F252_4_7_Segment
@drselim
@drselim 3 жыл бұрын
Hi, please see the update from ti, if you haven't done so: software-dl.ti.com/ccs/esd/documents/sdto_cgt_handling_changes_in_ltoa.html ltoa(value, local_buffer); /* OLD */ ltoa(value, local_buffer, 10); /* NEW */ Please try using the NEW format and let me know if it worked for you. Some of the viewers have done it and it worked as expected. I'll be adding a comment in the github page for this video as well.
@maksymdybarskyi578
@maksymdybarskyi578 Жыл бұрын
Thank you. You video helped me to fine a bug in my code. I am gonna have a cool project now.
@biffsr32
@biffsr32 2 жыл бұрын
Thank you Dr Selim. Great video!. Nice breakdown into learning blocks. 👍👍
@drselim
@drselim 2 жыл бұрын
So glad to hear that! Thank you.
@jayrolopez8277
@jayrolopez8277 3 жыл бұрын
Another awesome video. Very informative and useful information.
@drselim
@drselim 3 жыл бұрын
Thank you.
@accountcreatoperidownload7321
@accountcreatoperidownload7321 3 жыл бұрын
Awersome video, thanks! This helped me a lot!
@drselim
@drselim 3 жыл бұрын
You're welcome! I'm glad you enjoyed it.
@GM-wg3on
@GM-wg3on Жыл бұрын
@9:25 , there is an ic in the middle of the screen, what kind of ic is that?
@drselim
@drselim Жыл бұрын
That’s a shift register, it’s explained in the video, I also have shown its operation in another video in my channel, you can check it
@merveozdas1193
@merveozdas1193 Жыл бұрын
I couldn't understand the sample and hold, is it for sampling. As well as we are using prescale. I couldn't understand their duties exactly. Can you explain them? And another question, I will have 600 mV signal. When I put this signal to comparator stage, Is it seeing my signal, or ignore it?
@drselim
@drselim Жыл бұрын
Sample and hold is described in the beginning of the video at around, you can see the difference between sample and sample&hold there. If you'll have an input signal constant at 0.6 V, according to the code used here, it'll be in the first slot and one LED will be on only. Whether you have a signal of 600mV or 10mV, you'll obtain a corresponding value between 0 and 1024 (since ADC in G2553 is 10 bits, with a difference ov 3.22mV between quantized values.).
@merveozdas1193
@merveozdas1193 Жыл бұрын
@@drselim Okay I watched and understand, sample and hold is like zero holder to hinder amplitude skewing. It should stay constant by the next step. However, I wanna ask another thing : For example I have 200 Hz signal and I want to sample it as 1 ms. And I try to find how can I sample it, I found a formula for 2 ms like this: ACLK=32KHz,resolution=12bit,ADC conversion cycles=13,DIV=2,ADC12SHT_2=>2*13( 13 Conversion cycles for 12bit resolution) Fs=32K/(2*13+13)*2=410Hz Is it true? If it is true SHT value should be 16*ADCCLK cycles, shouldn't it?
@drselim
@drselim Жыл бұрын
@@merveozdas1193 for a 200Hz(max) signal you should use at least a 400Hz sampling frequency (information theory), for the rest of the calculation I suggest you use the following link (probably you might already checked it) : e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/41263/msp430f5438-adc-setup-sampling-rate#:~:text=The%20ADC%20could%20sample%20at%20~154%20kHz. Also make sure your mcu supports 12 bit res. ADC, the one that i use (G2553) has ADC10 (10 bits)
@oussamaelallam3221
@oussamaelallam3221 3 жыл бұрын
Great video!
@drselim
@drselim 3 жыл бұрын
Thanks!
@merveozdas1193
@merveozdas1193 Жыл бұрын
Hocam dersinize bayildim, sizinle tanismak isterdim. Temiz bir ingilizceyle, rahat rahat egosuz anlatmissiniz, sagolun :) Hangi okulda oldugunuzu merak ettim.
@drselim
@drselim Жыл бұрын
Nazik yorumunuz için tesekkur ederim. Kanalın sayfasında linkedin baglanti linki var. Bircok ogrenci arkadasla oradan irtibat kuruyoruz.
@Hisoka9932
@Hisoka9932 Жыл бұрын
HIi sir can u please tell how to configure putty with msp430 or ccs? please reply fast
@varshinireddy1356
@varshinireddy1356 3 жыл бұрын
Hello sir which software u used to execute
@drselim
@drselim 3 жыл бұрын
Hi, it’s code composer studio.
@varshinireddy1356
@varshinireddy1356 3 жыл бұрын
Thank you
@drselim
@drselim 3 жыл бұрын
You’re welcome
@DavidTLutz
@DavidTLutz 2 жыл бұрын
I have not been able to get any output from the COM port. I have tried many things but to no avail. I even tried using CCS 9.2 instead of the CSS 11.1 that I am using - running into and fixing the ltoa problem. I have tried other baud rates but apparently the Basys3 is restricted to 9600 baud - which makes me wonder why your code has UCA0BR0 = 52 and UCA0BR1 = 0 which would set the baud rate to 19,200 from what I have read. I tred UCA0BR0 = 104 and UCA0BR1 = 0 but that did not resolve the problem. I tried both Terra Term and Putty but got the same result with both. I have also carefully checked all the other parameters for the serial connection.Any ideas what my problem might be?
@drselim
@drselim 2 жыл бұрын
Hi David, one quick question as a start, you mentioned basys3 accidentally, right? This code is for msp430.
@DavidTLutz
@DavidTLutz 2 жыл бұрын
@@drselim Yes, my mistake writting Basys3. I was thinking of the Basys3 because I have no trouble with Putty making good serial connections. BTW, the circuit for this video worked as expected. Could this have anything to do with the jumpers on J101?
@drselim
@drselim 2 жыл бұрын
You should set the UART jumpers horizontally, you can see that setting in the following video: kzbin.info/www/bejne/fKvJaaRsm8yrnLM at 12:02 Please let me know if it helps.
@DavidTLutz
@DavidTLutz 2 жыл бұрын
@@drselim That was it! So this board is not limited to 9600 baud? Was it ever so in the past? Or is this just another example how much incorrect info there is out on the internet? That is why I appreciated to clarity and accuracy of the info in your videos.
@drselim
@drselim 2 жыл бұрын
So it works, perfect. Thank you for the clarification since this ltoa update caused some problems: some viewes had mentioned it. For the Msp430, I did not hear a limitation for serial connection speed. For Basys3, the default setting for the microblaze soft microprocessor is 9600 baud, but it can be changed in the settings in the block design. It shouldn’t be a problem.
@hamidesmaeili312
@hamidesmaeili312 3 жыл бұрын
How can this electrical circuit be implemented?
@drselim
@drselim 3 жыл бұрын
Hi, I think I couldn’t get your question. You mean for what purpose or? All necessary diagrams and code is in the video description.
@hamidesmaeili312
@hamidesmaeili312 3 жыл бұрын
@@drselim sorry, I did not see this part of the video. Thanks a lot for the interesting and informative videos.
@drselim
@drselim 3 жыл бұрын
@@hamidesmaeili312 you’re welcome!
@bedirhansaglam5689
@bedirhansaglam5689 2 жыл бұрын
hocam voltaj çıktısı veren bir sensörden veri okuma işlemini nasıl yapabilirim ADC ile yada ADC kullanmadan ?
@drselim
@drselim 2 жыл бұрын
Merhaba, gerilim 0- 3.3V araliginda ise bu videoda gosterilen sekilde potansiyometrenin cikisi yerine sensorun cikisini verebilirsin. Farkli bir aralikta cikis veriyorsa basit bir gerilim bolucu devre ile 0-3.3 V araligina getirip onun cikisini baglayabilirsin. Cikis analog ise ADC kullanmadan okuyamazsin. Eger sensor digital cikis veriyorsa (orn: dht11 sicaklik/nem sensoru) onun okuma metodu tamamen farkli, ilgili videoda gorebilirsin.
@bedirhansaglam5689
@bedirhansaglam5689 2 жыл бұрын
@@drselim hocam okumak istediğim sensör ölçülen değer ile orantılı voltaj çıktısı veriyor
@drselim
@drselim 2 жыл бұрын
@@bedirhansaglam5689 Evet, bahsettigin o araligin minimum ve maksimum araliginin 0-3.3V olacak sekilde normalize edilmesi gerekiyor (eger o aralikta degilse). msp430'un ADC'si on bitlik oldugu icin o araligi 1023'a bolecek ve en yakin degere donusturecek. Videoda detayli sekilde anlatmistim.
@bedirhansaglam5689
@bedirhansaglam5689 2 жыл бұрын
@@drselim teşekkür ederim hocam peki sensör pwm voltaj üretiyorsa ölçülen değere göre ölçüm değeri arttıkça pwm sinyalin duty cycle değeri yükseliyorsa ADC ile okunabilir mi ? Dijital sinyal olarak mı düşünmeliyiz
@drselim
@drselim 2 жыл бұрын
@@bedirhansaglam5689 timer interrupt ile olculebilir, hcsr04 mesafe sensorunde mesafeyle dogru orantili pulse uretiyor. O da videolarda var.
@rohinirachu2986
@rohinirachu2986 3 жыл бұрын
can we implement this code in Energia Software
@drselim
@drselim 3 жыл бұрын
Hi, I haven’t used Energia, however I know that it’s similar to arduino ide, and you can’t directly use ccs code in energia.
@rohinirachu2986
@rohinirachu2986 3 жыл бұрын
@@drselim ohh okay tq u sir
@drselim
@drselim 3 жыл бұрын
You’re welcome
@HirilPatelhexagonal
@HirilPatelhexagonal 2 жыл бұрын
Hello Dr Selim, I am using the EZ430f2013 development USB(which is quite old already). I am trying to search for examples where I can extract data from the board to the computer directly when connected via USB(I have tried to divide my problem into parts where I tried to find how to first enable SPI and then transfer data but I couldn't find anything beyond initialization of SPI)(I am fairly new in programming and debugging MCUs so please excuse me if I am jumping on a stupid question). I was able to initialize ADC (SD16) but to confirm if it is really working I have to see data and that is the problem here(lack of knowledge). I hope anyone can provide some sort of guidance with this. I am trying to convert the amplified output from INA333 from a bridge circuit.
@drselim
@drselim 2 жыл бұрын
Hi, first I need to mention that I haven't worked with the board (as you mentioned it's a USB board as I checked online). However I just looked at its specs and tried to understand your request. You'd like to get the analog values from INA333 and convert them into digital with the board's ADC -Sigma delta (which is different than MSP430G2553 in my examples, which is ADC10) and get the values from your computer. My recommendation would be that once you could get ADC working, try to observe the values from the expression window in CCS. See if they are correct or not (you can compare the converted value with the masured valu with a voltmeter). since the device doesn't have UART, I'm afraid you won't be able to use the examples that I gave here, but try to find another solution to get the data to your PC, maybe with SPI as you mentioned. Unfortunately this is all that I can comment for this board.
@selitu2484
@selitu2484 2 жыл бұрын
Hocam mail üzerinden size ulaşmaya çalışıyorum.
@drselim
@drselim 2 жыл бұрын
Mailinizi yanitladim.
How to use an ADC (embedded example in C)
14:56
Jacob Sorber
Рет қаралды 31 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Analog-to-Digital Converters (ADC) - Basics
18:01
iMooX at
Рет қаралды 128 М.
Assembly Programming for MSP430
25:44
drselim
Рет қаралды 17 М.
Inside the V3 Nazi Super Gun
19:52
Blue Paw Print
Рет қаралды 2,3 МЛН
Using GPIO with the MSP430 Microcontroller
20:42
MSP430 Training
Рет қаралды 22 М.
15.2(a) - Analog-to-Digital Converter on the MSP430: The MSP430 ADC & Configuration
17:00
MSP430 Digital I/O Tutorial
12:50
drselim
Рет қаралды 21 М.
How Do ADCs Work? - The Learning Circuit
10:13
element14 presents
Рет қаралды 150 М.
MSP430 Timer - Compare Mode
22:25
Bina Bhatt
Рет қаралды 7 М.