Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By RogerClark
#4523 @uhrheber

Thanks

I will need to check that I have wired to the correct location I.e pin 6 and that it is a good connection

Btw.
Max value on a 10 bit DAC is 1023 not 1024, so unless LUA is modifying the numbers, I would expect a max value of 1023.

Thanks

Roger
User avatar
By uhrheber
#4525 You're right. In fact, Lua throws a 1024, and I don't know where it's coming from.
Maybe the ADC uses the eleventh bit to indicate an overflow?
User avatar
By RogerClark
#4526 @uhrheber

If I manage to get system_read_adc() to work I will let you know what values I get.

I am going to try removing and re-attaching the wire to pin 6 TOUT, but its very difficult to do as my ESP-03 has a SM resistor near pin 6 which makes it hard to get the soldering iron to the pin :-(

Update.

I have tried to resolder but system_read_adc() now reads 1024 all the time

I need to check my connections

Perhaps I have shorted to an adjacent pin.

But at least we know that system_read_adc() returns a max value of 1024 and its not LUA that is re-scaling ;-)

Edit 2.

OK. I see my mistake. I was supplying more than 1V to the pin. My pot was not wired as I thought

Luckily my pot is 10K so not much current will be delivered to pin 6, so it looks like its OK if it goes above 1V as long as there is at least 10k resistance.

I will now glue my wire in place to prevent it moving (breaking off !)
User avatar
By linker3000
#9326 How's things going with the ADC?

I was looking to to use it to sample a microphone in realtime and compress (G.711?)/stream the result. I haven't had a chance to work on the project yet (long story), and have a backup plan for an external ADC, but any heads-up on how sampling affects wifi transmission or reception (I believe one or other is halted during sampling?

Thanks