1

Topic: Address transmission

in three pines of variables.
At storage access (reading, record) I transfer the address (on a picture)
The odd number of bits turns out. And how to me to transfer  address?

2

Re: Address transmission

The address it such

3

Re: Address transmission

Add high orders in zero, to the whole amount byte.

4

Re: Address transmission

Dima T wrote:

Add high orders in zero, to the whole amount byte.

Then that turns out uint32_t row_address = (block_address <<6) | page_address;?

5

Re: Address transmission

jenya7 wrote:

it is passed...
Then that turns out uint32_t row_address = (block_address <<6) | page_address;?

Not absolutely understood in what your problem. If the problem to fill bit structure, i.e. the address occupies some bits successively which are not aligned at first byte, by shifts. As you wrote. Then OR with filled structure.
Or is even easier: Bit fields if on Si you write.

6

Re: Address transmission

Dima T wrote:

it is passed...
Not absolutely understood in what your problem. If the problem to fill bit structure, i.e. the address occupies some bits successively which are not aligned at first byte, by shifts. As you wrote. Then OR with filled structure.
Or is even easier: Bit fields if on Si you write.

I  need to transfer this in three bytes (on the first picture)
That is

//////////////////////////////////// ERASE BLOCK /////////////////////////////
SPI2_CS0_OFF;
SPI_rw_flash (NAND_FLASH_BLOCK_ERASE, &dummy);
temp = 0;
SPI_rw_flash (temp, &dummy);//Dummy+A16
temp = row_address>> 16;
SPI_rw_flash (temp, &dummy);//A15-A8
temp = row_address>> 8;
l_error | = SPI_rw_flash (temp, &dummy);//A7-A0
SPI2_CS0_ON;

Whether so?

7

Re: Address transmission

Whether

jenya7 wrote:

so?

No concept I have, I not the telepathist.
What does SPI_rw_flash ()? What type at temp?

8

Re: Address transmission

Dima T wrote:

it is passed...
No concept I have, I not the telepathist.
What does SPI_rw_flash ()? What type at temp?

SPI_rw_flash () sends byte. But it is not important. temp it is byte.
At us it is given
Block Address (2048 blocks/device): 11 bits
Page Address (64 pages/block): 6 bits
Proceeding from it we build Row Address (on the second picture) uint32_t row_address = (block_address <<6) | page_address;
And now it is the address it is necessary to transfer in three bytes
The first - temp = 0;
The second - temp = row_address>> 8;
The third - temp = row_address and 0xFF;
It turns out so?

9

Re: Address transmission

jenya7 wrote:

Proceeding from it we build Row Address (on the second picture) uint32_t row_address = (block_address <<6) | page_address;
And now it is the address it is necessary to transfer in three bytes
The first - temp = 0;
The second - temp = row_address>> 8;
The third - temp = row_address and 0xFF;
It turns out so?

No, the first - temp = row_address>> 16;
Well and beforehand 1 byte of a command.
In remaining like a picture corresponds.

10

Re: Address transmission

Dima T wrote:

it is passed...
No, the first - temp = row_address>> 16;
Well and beforehand 1 byte of a command.
In remaining like a picture corresponds.

Thanks.

11

Re: Address transmission

that a hogwash  that quits
Admit I I want to erase the unit 2046 - 0x7FE
uint32_t row_address = (2046 <<6) | 0 = 0x1FF80
I transfer
The first - temp = row_address>> 16 = 1;
The second - temp = row_address>> 8 = 0xFF;
The third - temp = row_address and 0xFF = 0x80;
Where that I am explicit

12

Re: Address transmission

jenya7 wrote:

Che that a hogwash  that quits
Admit I I want to erase the unit 2046 - 0x7FE
uint32_t row_address = (2046 <<6) | 0 = 0x1FF80
I transfer
The first - temp = row_address>> 16 = 1;
The second - temp = row_address>> 8 = 0xFF;
The third - temp = row_address and 0xFF = 0x80;
Where that I am explicit

All is true.
What you confuses? How from 0x7FE received 0x1FF80?
So

 0x7FE = 0b111 11111110
0x1FF80 = 0b1 11111111 10000000 

Simply added 6 zero, but thus splitting into bytes moved down also values there were others.

13

Re: Address transmission

In an amicable way better so to write

The first - temp = (row_address>> 16) and 0xFF;
The second - temp = (row_address>> 8) and 0xFF;
The third - temp = row_address and 0xFF;

If temp has type byte exchanged nothing, but the code became more readable

14

Re: Address transmission

Dima T wrote:

it is passed...
All is true.
What you confuses? How from 0x7FE received 0x1FF80?
So

 0x7FE = 0b111 11111110
0x1FF80 = 0b1 11111111 10000000 

Simply added 6 zero, but thus splitting into bytes moved down also values there were others.

Yes but when we return reversely - I should send 07 FE and that I send - 1 FF 80.

15

Re: Address transmission

jenya7 wrote:

yes but when we return reversely - I should send 07 FE and that I send - 1 FF 80.

At what here it is reverse? You truth think that I the telepathist?
At you so the address is constructed

row_address = (block_address <<6) | page_address;

If you have to receive reversely block_address do so

block_address = row_address>> 6;

16

Re: Address transmission

And to a heap

page_address = row_address AND 0x3F;

17

Re: Address transmission

Dima T wrote:

it is passed...
At what here it is reverse? You truth think that I the telepathist?
At you so the address is constructed

row_address = (block_address <<6) | page_address;

If you have to receive reversely block_address do so

block_address = row_address>> 6;

On mine I understood... Thanks

18

Re: Address transmission

And if  you accept, 1 FF 80 sticks together so

row_address = recv_byte ();
row_address <<= 8;
row_address | = recv_byte ();
row_address <<= 8;
row_address | = recv_byte ();

Where recv_byte () reading of the following byte from a flow.
PS If again not about that answered, write more in detail that it is impossible.

19

Re: Address transmission

Dima T wrote:

And if  you accept 1 FF 80 sticks together so

row_address = recv_byte ();
row_address <<= 8;
row_address | = recv_byte ();
row_address <<= 8;
row_address | = recv_byte ();

Where recv_byte () reading of the following byte from a flow.
PS If again not about that answered, write more in detail that it is impossible.

Simply I not so understand - after command BLOCK ERASE - I should transfer the unit address which I want to erase or all  +.

20

Re: Address transmission

BLOCK ERASE - D8 - on a picture

21

Re: Address transmission

jenya7 wrote:

I am simple not so I understand - after command BLOCK ERASE - I should transfer the unit address which I want to erase or all + address.

I so understand that "+ address" since on a picture of 17 bits under it it is led out, and the address of the unit 11.

22

Re: Address transmission

And on the second picture it is written that BLOCK ERASE accepts only row_address which consists from block_address and page_address.

23

Re: Address transmission

Dima T wrote:

And on the second picture it is written that BLOCK ERASE accepts only row_address which consists from block_address and page_address.

I understood. Thanks.

24

Re: Address transmission

Hello, I recently became a progarmist, tell me which language to start
The moderator: the Request to observe forum rules: a forum Official language - Russian.