General area when it fits no where else

Moderator: Mmiscool

User avatar
By trackerj
#68412
Mihail wrote:Yes :) , I test the device and it is working normally. I start several programs and it works well !
I saw and try this tutorial for scanning i2c, but nothing is scanned when scanning!
to i2c.read() is printing 0
to i2c.end() is printing 2
I put pull-up resistors to VCC of both pins!


So you are saying that is working normally? what exactly? you ESP board? your max6675? with what? Please help me understand a bit more from your setup and tests.
Your whole setup is working ok with max6675 but max6675 is not detected by I2C scanner?
That sounds odd.

What value do you have for your SDA/SCL pull-up resistors?
User avatar
By Electroguard
#68413 Hi, I've just done a quick search and it appears your max6675 device is an SPI thermocouple, so is not i2c.
You should be able to still connect to it, but you'll need to connect via SPI rather than i2c.
User avatar
By Mihail
#68416 I bought this ebay module and want to read the information from it.
I'm using esp12 flash with basic 3.0!
I think I should have started with that information! :)

pullup is 6.2k

Hi, I've just done a quick search and it appears your max6675 device is an SPI thermocouple, so is not i2c.
You should be able to still connect to it, but you'll need to connect via SPI rather than i2c.

:oops:
User avatar
By Mihail
#68417 Okey now I have some data! I connected pin 12 and 14 to MAX6675(D0 CS CLS)
12 - D0
14 - CLk
Where to connect CS??
What options to set in ISP
timer 1000, [check.rotate]
spi.setup(9600,1,1)
wait

[check.rotate]

rec = spi.byte(2)
print rec

wait

FUNCTIONS SPI

The SPI port (H/W) is available for general use.
The following pins are defined :
SCK : GPIO14
MISO: GPIO12 (Master Input, Slave Output) (input for the ESP8266)
MOSI: GPIO13 (Master Output,Slave Input ) (output for the ESP8266)
The CS pin can be any pin. (controlled by user program)
spi.setup():

Opens the SPI port and set the speed.
It possible to optionally define the SPI_MODE and the data direction.
By default these values are SPI_MODE0 and MSB_FIRST. Only spi modes 0 and 1 are supported.
spi.setup({speed}, {MODE}, {MSB_FIRST})
Example :
spi.setup(1000000) -> 1Mbit/sec, mode 0, MSB_FIRST
spi.setup(500000, 1, 1) ->500Kb/sec, mode 1, MSB_FIRST
spi.setup(100000, 1, 0) ->100Kb/sec, mode 1, LSB_FIRST
spi.byte():

Write and receive byte at the same time (the arguments are numbers)
rec = spi.byte({send variable})
The value received and sent are numbers (byte)
Can be used as a command if the received argument is not required
Example :
rec = spi.byte(55)
spi.byte(123)
spi.string():

Write and receive a string of len chars.
var$ = spi.string({string}, {len})
Example:
dat$ = spi.string("Hello World!", 12)
spi.hex():

write and receive a string containing an hexadecimal message representing len bytes.
var $ = spi.string({hex_string}, {len})
Example:
dat$ = spi.hex("a1b2c3d4e5f6", 6) -> send 6 bytes (sequence of a1, b2, c3, d1, e5, f6) and receive in dat$
spi.setmode():

Allows for changing of spi modes on the fly after the spi setup function has been used. Only modes 0 and 1 are supported.
spi.setmode({MODE})
spi.setfrequency():

Allows for changing of spi frequency on the fly after the spi setup function has been used.
spi.setfrequency({FREQUENCY})