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

User avatar
By Fr4gg0r
#8097
pvvx wrote:Use the limitation of current and voltage to the input of ADC.
0...1V, + resistor. With more than 1V "code crashes"

I am not using the externally available ADC. Also I don't see why providing too much voltage to the ADC would cause the chip to hang.

pvvx wrote:readv dd33 () programmatically associated with Wifi tx...

What are you trying to imply here?

Btw.: Did you do some experiments to see if
Code: Select allos_update_cpu_frequency(160)
actually does anything?
I wrote a small benchmark in lua but could not see any speed gains compared to 80MHz.
Code: Select allets_get_cpu_frequency()
correctly reports back 160MHz.
Does it have to be called at startup? :?:
User avatar
By pipi61
#8104
pvvx wrote:
erik2005 wrote:But you have to uncomment this part:
//#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
in Web/include/esp8266.h
You have an old version...

Hi!
in esp_iot_sdk_v0.9.4_14_12_19.zip and esp_iot_sdk_v0.9.4_14_12_19.zip exist c_types.h contain this line:
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
and redefine in your c:\Espressif\Web_base\Web\include\esp8266.h source
Thank You
User avatar
By pvvx
#8107
Fr4gg0r wrote:I am not using the externally available ADC. Also I don't see why providing too much voltage to the ADC would cause the chip to hang.

Try to do the experiment. :)

Btw.: Did you do some experiments to see if
Code: Select allos_update_cpu_frequency(160)
actually does anything?
I wrote a small benchmark in lua but could not see any speed gains compared to 80MHz.
Code: Select allets_get_cpu_frequency()
correctly reports back 160MHz.
Does it have to be called at startup? :?:

https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map :
3FF00014h is a clock setting register. Setting bit 0 changes the CPU to 160 MHz mode. Clearing it means 80 MHz.
Code: Select all#ifdef USE_CPU_SPEED
#if   USE_CPU_SPEED > 80
   REG_SET_BIT(0x3ff00014, BIT(0));
   os_update_cpu_frequency(160);
#else
   REG_CLR_BIT(0x3ff00014, BIT(0));
   os_update_cpu_frequency(80);
#endif
#if DEBUGSOO > 0
   os_printf("Set CPU CLK: %u MHz\n", ets_get_cpu_frequency());
#endif
#endif

see os_update_cpu_frequency in esp_iot_sdk\examples\IoT_Demo\ssl\app\espconn_ssl.c

BiosROM:
Code: Select all40002f04 <ets_update_cpu_frequency>:
    2f04:   fff131         l32r   a3, 2ec8 <ets_timer_init+0x60>  0x3fffc704 = 0x000000a0
    2f07:   0329         s32i.n   a2, a3, 0
    2f09:   f00d         ret.n
    2f0b:   00             .byte 00

40002f0c <ets_get_cpu_frequency>:
    2f0c:   ffef21         l32r   a2, 2ec8 <ets_timer_init+0x60>
    2f0f:   0228         l32i.n   a2, a2, 0
    2f11:   f00d         ret.n

os_update_cpu_frequency()/ets_get_cpu_frequency() - Called to notify the timers and other routines settings in the SDK/BiosROM.
SDK periodically disables 160MHz.
My tcpsrv_server_poll() enables 160MHz, when there is a connections (else #define USE_CPU_SPEED xx)

At 80MHz speed HTTP / TCP to 800 Kbytes / sec
At 160MHz CPU and QSPI 80MHz + Flash W25Q128 speed more 1200 Kbytes / sec
User avatar
By pvvx
#8126
pipi61 wrote:
pvvx wrote:
erik2005 wrote:But you have to uncomment this part:
//#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
in Web/include/esp8266.h
You have an old version...

Hi!
in esp_iot_sdk_v0.9.4_14_12_19.zip and esp_iot_sdk_v0.9.4_14_12_19.zip exist c_types.h contain this line:
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
and redefine in your c:\Espressif\Web_base\Web\include\esp8266.h source
Thank You
Hi!
#define a b
#define a b
#define a b
#define a b
No error :)