Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Nor Flash Forum Discussions

vijayks
Level 1
Level 1
10 sign-ins 5 replies posted 5 questions asked

Hello,

I am trying to communicate with S25HL512T NOR Flash with FTDI. Initially I am trying with single SPI mode. In the below snap I am trying to write the value to volatile configuration register 1 and reading back the configuration register 1, but not able to read the value what I written in Conf_reg 1.

vijayks_0-1634106433201.png

With Regards,

Vijay KS

 

0 Likes
1 Solution
AS_36
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

Hi Vijay,

Can you tell me how is the CS# signal being toggled?

From the code snippet I can see that WRENV command, WRREG command and the inputs for all the status and configuration registers have been saved in the data array and is being sent to the flash in a single SPI transaction using the SPIMaster_SingleWrite() API. Does this mean CS# will be driven LOW at the beginning (before sending the WRENV command) and then it will finally be driven HIGH after the value for Configuration Register 4 is sent?

If yes, then I would like to inform you that this is not the correct way to do it. WRENV is a separate command and cannot be grouped with WRREG command. The correct way is - 

  • CS# LOW
  • WRENV command
  • CS# HIGH
  • CS# LOW
  • WRREG command
  • Input for SR1, CR1, CR2, CR3, CR4
  • CS# HIGH

Please see Figure 7 and Figure 11 of the datasheet for more clarity on CS# signal.

Similarly I can see that you have used a SingleWrite and SingleRead API to write the RDCR1 command and reading the value of CR1, respectively. Does that mean CS# will be driven LOW and HIGH at the beginning and end of each API? I would like to inform you that the correct way is - 

  •  CS# LOW
  • RDCR1 command
  •  Read the CR1 value
  • CS# HIGH

Please let me know whether this solves your problem or not. Also, let me know if you have more questions.

Regards.

View solution in original post

0 Likes
2 Replies
AS_36
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

Hi Vijay,

Can you tell me how is the CS# signal being toggled?

From the code snippet I can see that WRENV command, WRREG command and the inputs for all the status and configuration registers have been saved in the data array and is being sent to the flash in a single SPI transaction using the SPIMaster_SingleWrite() API. Does this mean CS# will be driven LOW at the beginning (before sending the WRENV command) and then it will finally be driven HIGH after the value for Configuration Register 4 is sent?

If yes, then I would like to inform you that this is not the correct way to do it. WRENV is a separate command and cannot be grouped with WRREG command. The correct way is - 

  • CS# LOW
  • WRENV command
  • CS# HIGH
  • CS# LOW
  • WRREG command
  • Input for SR1, CR1, CR2, CR3, CR4
  • CS# HIGH

Please see Figure 7 and Figure 11 of the datasheet for more clarity on CS# signal.

Similarly I can see that you have used a SingleWrite and SingleRead API to write the RDCR1 command and reading the value of CR1, respectively. Does that mean CS# will be driven LOW and HIGH at the beginning and end of each API? I would like to inform you that the correct way is - 

  •  CS# LOW
  • RDCR1 command
  •  Read the CR1 value
  • CS# HIGH

Please let me know whether this solves your problem or not. Also, let me know if you have more questions.

Regards.

0 Likes
vijayks
Level 1
Level 1
10 sign-ins 5 replies posted 5 questions asked

Hi,

Thanks for your response. Issue has been resolved..In the above snap CS# is driven low at the beginning of SPIMaster_SingleWrite() API and last argument in this API decides whether CS# needs to be driven high or in low itself(if TRUE=CS# will driven high FLASE=CS# will be in low state itself).

With Regards,

Vijay KS

0 Likes