After more than 10 days; I have solved the crash problem. It was in jshardware.h.
When the program was to store the bitrate in the address, the address was not divisible by 4.
I hope it will run on a normal Espruino too. I haven't tested it yet.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
After more than 10 days; I have solved the crash problem. It was in jshardware.h.
When the program was to store the bitrate in the address, the address was not divisible by 4.
I hope it will run on a normal Espruino too. I haven't tested it yet.
I have also chaged a lot in i2c_master.c
When x is under 4 then the result was 0. So the waiting in the program was not good.
Now I use this
and sat it up so it could wait between 1 and 4 us.
I don't know the bitrate, but I have it running with wii nunchuck and htu21d at the same time.
Se the attachment files.
Are there sombody, that have some equepment to test the bitrate, and to try it out?
And clockstreching on all places where the clocksignal goes from 0 to 1.
before any change:
after change in:
Espruino/Espruino/src/jshardware.h
after change in:
Espruino/Espruino/targets/esp8266/i2c_master.c
2 Attachments