M90E32AS SPI write ISSUE

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I am communicating ATMEL M90E32AS with RENESAS micro controller R5F100FC with the help of SPI communication.

I am operating chip in NORMAL MODE.

I am able to read the data from the chip but I am not able to write the data on the chip.

So if anyone can help in solving this write issue can help.

Last Edited: Wed. Aug 16, 2017 - 10:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check your SPI Mode

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My SPI is operating in MODE 3.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DO NOT CROSS POST. 

 

I will lock the other thread that you started in.

 

Ross

Moderator

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I got the solution and that is we have to initialize CfgRegAccEn register (0x7FH) with value 0x55AAH.

After initializing that register my SPI Read and Write works completely.

But this type of initialization is not mentioned anywhere.

Can anyone say is their any other such type of initialization required?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, i'm trying make a comunication ATMEL M90E32AS with ESP8266, but, i don't any data receive from device. I tried with MODE3 and MODE2

and analisys with osciloscope too, and the MOSI that's right for send. What's wrong with my code?
Regards!

 

// Author: Leonardo Domingos Batista
// Co-Creators: Kevin Jahn and Juliano
// Code: Comunication by SPI with ATM90E32AS
// Date: 07/08/2017

 

#include <SPI.h>

const int CS = 15; //Pin D8
const int PM0 = 16; //Pin D0
const int PM1 = 5; //Pin D1
const int Reset = 4; //Pin D2

 

//NodeMCU pin's --> ATM90E32AS
//D5 GPIO 14 -----> SCLK
//D6 GPIO 12 -----> SDO
//D7 GPIO 13 -----> SDI
//D8 GPIO 15 -----> CS
//3.3 -----> DVDD and AVDD
//GND -----> DGND and AGND

 

void setup() {
  pinMode(CS, OUTPUT);
  pinMode(PM0, OUTPUT);
  pinMode(PM1, OUTPUT);
  delay(10);
  digitalWrite(CS, HIGH);
  digitalWrite(PM0, HIGH);
  digitalWrite(PM1, HIGH);
  
  SPI.begin();
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE2)); //Can be MODE3?
  Serial.begin(115200);

 

}

void loop() {

  delay(1000);

  Write(0x7F,0x55,0xAA);

  delay(1000);

  int x = Read(0xFC);

  Serial.println("Processed Data Recieved from Slave is: ");
  Serial.print(x);
  Serial.println("\r\n");
  delay(1000);
}

int Read(int adress) {
  digitalWrite(CS, LOW);
  byte byte1 = ((adress >> 8) & 0x03);
  byte byte0 = (adress & 0xFF); //0xFF = B11111111
  byte1 |= 0b10000000;
  SPI.transfer(byte1);
  SPI.transfer(byte0);
  byte1 = SPI.transfer(0);
  byte0 = SPI.transfer(0);
  digitalWrite(CS, HIGH);
  return ((byte1 << 8) | byte0);
}

int Write(int adress, byte value1, byte value0) {
  digitalWrite(CS, LOW);
  byte byte1 = ((adress >> 8) & 0x03);
  byte byte0 = (adress & 0xFF); //0xFF = B11111111
  SPI.transfer(byte1);
  SPI.transfer(byte0);
  SPI.transfer(value1);
  SPI.transfer(value0);
  digitalWrite(CS, HIGH);
  return (0);
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please do not double post continue here http://www.avrfreaks.net/forum/a...

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Topic locked