реклама на сайте
подробности

 
 
> Анализ сети 3G | sim5360
3dfx
сообщение Aug 28 2016, 13:02
Сообщение #1





Группа: Участник
Сообщений: 10
Регистрация: 20-08-16
Пользователь №: 93 033



Здравствуйте!
Стоит задача с помощью модуля sim5360 без установленной сим-карты производить анализ сети WCDMA, что будет примерным аналогом команды AT+CNETSCAN у sim900.
То есть модуль должен в режиме UMTS\WCDMA выдавать список операторов, чтобы можно было в последствии "сесть" на один из них.
Была идея использовать команды AT+CRUS и AT+COPS, но вторая команда недоступна без вставленной сим-карты. Применение AT+CNLSA=1 успехов не дало.
Еще была мысль один раз подключить симку, вытащить, а потом запретить проверку на ее наличие при следующих перезагрузках. Подскажите, как это можно реализовать?

Сообщение отредактировал 3dfx - Aug 28 2016, 13:02
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
3dfx
сообщение Oct 22 2016, 22:28
Сообщение #2





Группа: Участник
Сообщений: 10
Регистрация: 20-08-16
Пользователь №: 93 033



Всё та же проблема - не инициализируется дисплей. Может, не так подключаю? Помимо SCL и SDA с дисплея идут CSB и RST, помеченные как "Active Low". Правильно ли я делаю, подвесив их через резистор 10к на Vdd? Нужно ли включать RST при запуске?

Сообщение отредактировал 3dfx - Oct 22 2016, 22:29
Go to the top of the page
 
+Quote Post
Hub
сообщение Nov 3 2016, 08:52
Сообщение #3


Частый гость
**

Группа: Свой
Сообщений: 184
Регистрация: 7-10-15
Из: Санкт-Петербург
Пользователь №: 88 743



Цитата(3dfx @ Oct 23 2016, 01:28) *
Всё та же проблема - не инициализируется дисплей. Может, не так подключаю? Помимо SCL и SDA с дисплея идут CSB и RST, помеченные как "Active Low". Правильно ли я делаю, подвесив их через резистор 10к на Vdd? Нужно ли включать RST при запуске?

давно не заходил на форум, все никак время не находилось.
удалось разобраться?
если нет - схему подключения фстудию, будем разбираться
Go to the top of the page
 
+Quote Post
3dfx
сообщение May 5 2017, 06:08
Сообщение #4





Группа: Участник
Сообщений: 10
Регистрация: 20-08-16
Пользователь №: 93 033



Цитата(Hub @ Nov 3 2016, 11:52) *
давно не заходил на форум, все никак время не находилось.
удалось разобраться?
если нет - схему подключения фстудию, будем разбираться

Дисплей так и не заработал - не приходит ACK, хотя подключено всё 100% правильно, это обсуждалось со знающими людьми, да и схеме подключения в даташите полностью соответствует. Проблема, думаю, именно в коде. Сейчас код примерно такой:
Код
function I2C_out(j) --//I2C Output
    print("~~I2C output '",string.format("0x%X",j),"':\r\n")
    local d, n;
    d=j;
    n=0;
    vmsleep(delay);
    print("1. Sending 8 bits (n = [0,7])\r\n")
    for n = 0,7 do --//send 8 bits
        print("1.",n+1,".1) n = ", n, ", d = ",d, ", d and 0x80 = ",bit.band(d,0x80),". ");
        if(bit.band(d,0x80) == 0x80) then --//get only the MSB
            setHIGH(SDA);--SDA=1; --//If it is 1 then SDA=1
            print("SDA to 1: SDA == ", gpio.getv(SDA),"\r\n");
        else
            setLOW(SDA);--SDA=0; --//If 0 then SDA=0    
            print("SDA to 0: SDA == ", gpio.getv(SDA),"\r\n");            
        end
        
        vmsleep(delay);
        print("1.",n+1,".2) SCL clocks\r\n");
        print("SСL to 0: ")    
        setLOW(SCL);--SCL = 0;
        print("SCL == ",gpio.getv(SCL),"\r\n")
        vmsleep(delay);
        print("SСL to 1: ")    
        setHIGH(SCL);--SCL = 1; --//clock in data
        print("SCL == ",gpio.getv(SCL),"\r\n")
        vmsleep(2*delay);
        
        d = bit.lshift(d,1);--d=(d<<1); --//shift data byte left
        
        print("SСL to 0: ")    
        setLOW(SCL);--SCL = 0;
        print("SCL == ",gpio.getv(SCL),"\r\n")
        vmsleep(delay);
    end;
    
    print("\r\n2.\r\n")
    
    print("SDA to 1: ")
    setHIGH(SDA);--SDA = 1;
    print("SDA == ",gpio.getv(SDA),"\r\n")    
    vmsleep(2*delay);
    
    print("SСL to 1: ")    
    setHIGH(SCL);--SCL = 1; --//clock in data
    print("SCL == ",gpio.getv(SCL),"\r\n")
    vmsleep(2*delay);
    
    print("SСL to 0: ")    
    setLOW(SCL);--SCL = 0;
    print("SCL == ",gpio.getv(SCL),"\r\n")
    vmsleep(delay);
    
    pinToIN(SDA);
    
    --[
    print("3. Wait until ACK:\r\n")
    while(gpio.getv(SDA)==1) do --//wait here until ACK
        print("SСL to 0: ")    
        setLOW(SCL);--SCL = 0;
        print("SCL == ",gpio.getv(SCL),"\r\n")
        vmsleep(delay);
        print("SСL to 1: ")    
        setHIGH(SCL);--SCL = 1;
        print("SCL == ",gpio.getv(SCL),"\r\n")
        vmsleep(delay);
        print("NACK (Sending '", string.format("0x%X",j)," (gpio.getv(SDA) == ",gpio.getv(SDA),"')\r\n");
    end;    
    
    print("!!!!!!!!!!!ACK!!!!!!!!!!!!\r\n");    
    pinToOUT(SDA);
    vmsleep(delay);
    
    setLOW(SCL);--SCL = 0;    
    vmsleep(delay);
end;
--/*****************************************************/
function I2C_Start(void)
    print("~~Start:\r\n")            
    
    print("SСL to 1: ");
    setHIGH(SCL)--SCL = 1;    
    print("SCL == ",gpio.getv(SCL),"\r\n");
    vmsleep(10)
    
    print("SDA to 1: ")
    setHIGH(SDA);--SDA = 1;
    print("SDA == ",gpio.getv(SDA),"\r\n")    
    vmsleep(10)
    
    print("SDA to 0: ")    
    setLOW(SDA);--SDA = 0;
    print("SDA == ",gpio.getv(SDA),"\r\n")
    vmsleep(10)    
    
    print("SСL to 0: ")    
    setLOW(SCL);--SCL = 0;
    print("SCL == ",gpio.getv(SCL),"\r\n")
    vmsleep(10)
    
    print("~~(endstart)\r\n");
end
--/*****************************************************/
function I2C_Stop(void)
    print("~~Stop:\r\n")        

    print("SDA to 0: ")    
    setLOW(SDA);--SDA = 0;
    print("SDA == ",gpio.getv(SDA),"\r\n")
    vmsleep(10)    
    
    print("SСL to 0: ")    
    setLOW(SCL);--SCL = 0;
    print("SCL == ",gpio.getv(SCL),"\r\n")
    vmsleep(10)    
    
    print("SСL to 1: ");
    setHIGH(SCL)--SCL = 1;    
    print("SCL == ",gpio.getv(SCL),"\r\n");
    vmsleep(10)
    
    print("SDA to 1: ")
    setHIGH(SDA);--SDA = 1;
    print("SDA == ",gpio.getv(SDA),"\r\n")    
    vmsleep(10)
    
    print("~~(endstop)\r\n");
end
--/*****************************************************/
function Show(text)
    local n,i;
    local page=0xB0;  --//first page
    for i=0, 13 do --//100 pixels = 12.5 pages
        I2C_Start();
        I2C_out(Slave);
        I2C_out(Comsend);
        I2C_out(page);
        I2C_out(0x10); --//column address Y9:Y6
        I2C_out(0x01); --//column address Y5:Y2
        I2C_Stop();
        I2C_Start();
        I2C_out(Slave);
        I2C_out(Datasend);
        for n=0, 160 do
            I2C_out(text);  --//send data 4 times for grayscaling
            I2C_out(text);
            I2C_out(text);
            I2C_out(text);
            text = text+1;  --//point to next byte of data
            vmsleep(10);
        end
        I2C_Stop();
        page = page+1;  --//move to next page
    end
end
--/****************************************************
--* LCD Initialization *
--*****************************************************/
function init_LCD()
    I2C_Start();
    I2C_out(Slave);
    
    for n = 1, #initTable do
        I2C_out(initTable[n]);
    end
    
    I2C_Stop();
end
--/*****************************************************/
--]]

--/****************************************************
--* MAIN *
--/*****************************************************/
    
Slave = 0x3F; --//slave address
--Comsend = 0x00;
--Datasend = 0x40;
initTable = {
    0x00,    --Comsend
    
    -- Select partial display line (p. 56)
    -- Sets the ratio within range of 16 to 128 (ICON disabled) or 17 to 129 (ICON enabled)
    -- to realize partial display by using the 2-byte instruction
    0x48,    -- 1-st
    0x64,    -- 2-nd : 1/100 duty
    
    -- ADC select (p. 62)
    -- Changes the relationship between RAM column address and segment driver.
    -- The direction of segment driver output pins could be reversed by software.
    -- This makes IC layout flexible in LCD module assembly.
    0xA0,    -- ADC = 0: normal direction (SEG0 -> SEG127)

    -- SHL select (p. 61)
    -- COM output scanning direction is selected by this instruction which determines the LCD driver output status.
    0xC8,    -- SHL = 1: reverse direction (COM127 -> COM0)
    
    -- Set Initial COM0 Register (p. 55)
    -- Sets the initial row (COM) of the LCD panel using the 2-byte instruction.
    -- By using this instruction, it is possible to realize the window moving without the change of display data.
    0x44,    -- 1-st
    0x00,    -- 2-nd scan from COM0

    --    Oscillator ON Start (p. 62)
    0xAB,    -- This instruction enables the built-in oscillator circuit

    -- Select Regulator Resistor (p. 60)
    -- Selects resistance ratio of the internal resistor used in the internal voltage regulator.
    -- See voltage regulator section in power supply circuit
    0x26, -- 1+ (Rb / Ra) = 6.5

    -- Set Electronic Volume Register (p. 60)
    -- Consist of 2-byte Instructions
    -- The 1st instruction set Reference Voltage mode,
    -- the 2nd one updates the contents of reference voltage register.
    -- After second instruction, Reference Voltage mode is released.
    0x81,    -- 1-st *****
    0x18,    -- 2-nd
    -- 0x1C, -- 2-nd

    -- Select LCD bias (p. 60)
    -- Selects LCD bias ratio of the voltage required for driving the LCD.
    0x57,    -- 1/12
    -- 0x56, -- 1/11 ****
    
    -- Select DC-DC Step-up (p. 59)
    -- Selects one of 4 DC-DC step-up to reduce the power consumption by this instruction.
    -- It is very useful to realize the partial display function.
    0x64,    -- 3x times boosting circuit

    0xE3,    -- NOP (p. 64)
    0xE3,    -- NOP (p. 64)
    
    -- Power control (p. 58)
    0x2C,    --    Internal voltage converter circuit is ON
    
    -- Select DC-DC Step-up (p. 59)
    -- Selects one of 4 DC-DC step-up to reduce the power consumption by this instruction.
    -- It is very useful to realize the partial display function.
    0x66,    -- 5x times boosting circuit
    
    0xE3,    -- NOP (p. 64)
    0xE3,    -- NOP (p. 64)
    
    -- Power control (p. 58)
    0x2E,    -- Internal voltage converter circuit is ON
            -- Internal voltage regulator circuit is ON
    
    0xE3,    -- NOP (p. 64)
    0xE3,    -- NOP (p. 64)
    
    -- Power control (p. 58)
    0x2F,    -- Internal voltage converter circuit is ON
            -- Internal voltage regulator circuit is ON
            -- Internal voltage follower circuit is ON
    
    -- Set Bias Power Save Mode (p. 58)
    -- This command is for saving the IC current consumption by Bias Power Saving
    -- After this Instruction is set, Bias function is also working
    0xF3,    -- 1-st
    0x00,    -- 2-nd

    -- Set FRC & PWM mode (p. 65)
    0x96,    -- 3FRC
            -- 60PWM

    -- Set Mode Register (p. 49)
    -- 2-byte instruction to set Mode (EXT) and FR (Frame frequency control), BE (Booster efficiency control).
    -- Booster Efficiency
    -- The ST7528 incorporates software configurable Booster Efficiency Command.
    -- It could be used with Voltage multiplier to get the suitable Vout and Power consumption.
    -- Default setting is Level 2
    0x38,    -- 1-st
    0x75,    -- 2-nd
            -- FR frequency = 70 Hz ±20%
            -- Booster Efficiency Level 2
            -- The Instruction of EXT=1 Mode is available

    -- Set FRC & PWM mode (p. 65)
    0x95,    -- 3FRC
            -- 45PWM
    -- 0x97, ****

    -- 16-level (White Mode ~ Dark Mode) Gray Scale Display with PWM and FRC Methods
    -- (p. 1)

--------------------------------------------------
--start 16-level grayscale settings
--------------------------------------------------
    -- Set Gray Scale Mode & Register (p. 65)
    -- Consists of 2 bytes instruction.
    -- The first byte sets grayscale mode and the second byte updates the contents
    -- of gray scale register without issuing any other instruction.
    0x80, -- Set white mode and 1st frame
    0x00, -- set pulse width

    0x81, -- Set white mode and 2nd frame
    0x00, -- set pulse width
    
    0x82, -- Set white mode and 3rd frame
    0x00, -- set pulse width
    
    0x83, -- Set white mode and 4th frame
    0x00, -- set pulse width
--------------------------------------------------
    0x84,
    0x06,
    0x85,
    0x06,
    0x86,
    0x06,
    0x87,
    0x06,
    0x88,
    0x0B,
    0x89,
    0x0B,
    0x8A,
    0x0B,
    0x8B,
    0x0B,
    0x8C,
    0x10,
    0x8D,
    0x10,
    0x8E,
    0x10,
    0x8F,
    0x10,
    0x90,
    0x15,
    0x91,
    0x15,
    0x92,
    0x15,
    0x93,
    0x15,
    0x94,
    0x1A,
    0x95,
    0x1A,
    0x96,
    0x1A,
    0x97,
    0x1A,
    0x98,
    0x1E,
    0x99,
    0x1E,
    0x9A,
    0x1E,
    0x9B,
    0x1E,
    0x9C,
    0x23,
    0x9D,
    0x23,
    0x9E,
    0x23,
    0x9F,
    0x23,
    0xA0,
    0x27,
    0xA1,
    0x27,
    0xA2,
    0x27,
    0xA3,
    0x27,
    0xA4,
    0x2B,
    0xA5,
    0x2B,
    0xA6,
    0x2B,
    0xA7,
    0x2B,
    0xA8,
    0x2F,
    0xA9,
    0x2F,
    0xAA,
    0x2F,
    0xAB,
    0x2F,
    0xAC,
    0x32,
    0xAD,
    0x32,
    0xAE,
    0x32,
    0xAF,
    0x32,
    0xB0,
    0x35,
    0xB1,
    0x35,
    0xB2,
    0x35,
    0xB3,
    0x35,
    0xB4,
    0x38,
    0xB5,
    0x38,
    0xB6,
    0x38,
    0xB7,
    0x38,
    0xB8,
    0x3A,
    0xB9,
    0x3A,
    0xBA,
    0x3A,
    0xBB,
    0x3A,
--------------------------------------------------
    0xBC, -- Set Dark mode and 1st frame
    0x3C, -- set pulse width

    0xBD, -- Set Dark mode and 2nd frame
    0x3C, -- set pulse width

    0xBE, -- Set Dark mode and 3rd frame
    0x3C, -- set pulse width

    0xBF, -- Set Dark mode and 4th frame
    0x3C, -- set pulse width
--------------------------------------------------
-- end grayscale settings
--------------------------------------------------

    -- Set Mode Register (p. 49)
    -- 2-byte instruction to set Mode (EXT) and FR (Frame frequency control), BE (Booster efficiency control).
    -- Booster Efficiency
    -- The ST7528 incorporates software configurable Booster Efficiency Command.
    -- It could be used with Voltage multiplier to get the suitable Vout and Power consumption.
    -- Default setting is Level 2
    0x38,    -- 1-st
    0x74,    -- 2-nd
            -- FR frequency = 70 Hz ±20%
            -- Booster Efficiency Level 2
            -- The Instruction of EXT=0 Mode is available

    0xAF    -- Turns the display ON
};
delay = 10
    
    pinToOUT(SCL)
    pinToOUT(SDA)
    pinToOUT(RST)
    pinToOUT(CSB)

    print("CSB to 0: ")    
    setLOW(CSB)
    print("CSB == ",gpio.getv(CSB),"\r\n")
    vmsleep(5);
    
    print("RST to 0: ")    
    setLOW(RST)
    print("RST == ",gpio.getv(RST),"\r\n")
    vmsleep(100);
    
    print("RST to 1: ")    
    setHIGH(RST)
    print("RST == ",gpio.getv(RST),"\r\n")
    vmsleep(100);

    init_LCD();

--The end
Go to the top of the page
 
+Quote Post

Сообщений в этой теме
- 3dfx   Анализ сети 3G | sim5360   Aug 28 2016, 13:02
- - Hub   Цитата(3dfx @ Aug 28 2016, 16:02) Здравст...   Aug 29 2016, 10:18
|- - 3dfx   Цитата(Hub @ Aug 29 2016, 13:18) Для сете...   Aug 29 2016, 11:22
|- - 3dfx   Цитата(Hub @ Aug 29 2016, 13:18) Для сете...   Sep 3 2016, 07:33
|- - 3dfx   В продолжение истории: как сделать так, чтобы при ...   Sep 19 2016, 21:28
|- - NoDS   Цитата(3dfx @ Sep 20 2016, 00:28) В продо...   Sep 22 2016, 12:58
- - wireless_eltech   У sierrawireless есть 3G модуль HL8518, который мо...   Aug 31 2016, 07:48
|- - Tweeek   Цитата(wireless_eltech @ Aug 31 2016, 10...   Aug 31 2016, 09:02
- - 3dfx   wireless_eltech, знаю, что есть другие решения, но...   Aug 31 2016, 13:53
- - migrator   модуль sim5360 сделан на чипсете Qualcomm MDM6200....   Aug 31 2016, 15:00
|- - 3dfx   Цитата(migrator @ Aug 31 2016, 18:00) мод...   Sep 1 2016, 16:01
- - CADiLO   Ревес инженеринг не каждый потянет...   Aug 31 2016, 17:09
- - Hub   Цитата(3dfx @ Sep 3 2016, 10:33) Ну как, ...   Sep 22 2016, 13:09
|- - 3dfx   Цитата(Hub @ Sep 22 2016, 16:09) пришел о...   Oct 1 2016, 16:03
- - 3dfx   С ногами RST и CSB разобрался. RST сначала опускае...   May 7 2017, 14:44


Reply to this topicStart new topic
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 30th July 2025 - 06:27
Рейтинг@Mail.ru


Страница сгенерированна за 0.01439 секунд с 7
ELECTRONIX ©2004-2016