Ethercat compatible Encoder board tentative STM32F4 + LAN9252

More
10 months 2 weeks ago #340091 by Hakan
PDI = that parallel communication mode? Noone uses it. Everyone uses SPI.
The last few lines in the xml file should look similar to this. The first "80" means spi, then there
is polarity and other settings. 
Code:
        <Eeprom>           <ByteSize>2048</ByteSize>           <ConfigData>80060344640000</ConfigData>         </Eeprom>
Read out the eeprom from the board and verify that is says "80" in the first byte.
I have had my fair share of problems with SPI so I think you again should verify that you can get past the ESC_init() function.
Use the debugger and verify that you read 0x87654321 from LAN9252 on line 445 in the figure
 
You may need to power cycle the LAN9252, it only reads eeprom after power down.
 

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #340099 by vibram
My ESC TEST VALUE reading is fine...
i tried a lot of things but dont know why i cant get the eeprom correctly set up. Maybe its something with the board I dont know

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #340105 by vibram
In order to limit costs and continue tests maybe I should try to build a lan9252 prototype board with eeprom spi and i2c.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #340107 by Hakan
Ok ok. Spi was a pain for me until I got it sorted that's why I wanted to be really sure it works. Nothing works without spi.

There are a few hardware bootstrap jumpers on the Lan9252.
They are described in the schematics for lan9252 evaluation  board.
I have them marked on all board schematics. 
You can compare them with your board, perhaps there is something different?

I guess it wouldn't be too difficult to replicate your board and try to troubleshoot it.
Can you make sure to push relevant code to github and I can have a look at that.
I'm pretty sure I can puzzle together the hardware.

You are going to end up designing a board, just start haha.
You mention I2C. If you need it, yes. Otherwise no. I used it for 
plasma arch voltage. Worked great, but if you don't need it don't include I2C.



 
The following user(s) said Thank You: besriworld

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago - 10 months 2 weeks ago #340114 by Hakan
Good morning, I have looked at the code now. Clear out the whole loop() function and insert just this line
Code:
void loop(void) {   ecat_slv(); }

That should do it. You never called ecat_slv() in cyclous mode.
The danger of using someone else's code.
It meant it never used spi to query lan9252 for changes and updates to register etc etc.

There were a lot of diagnozing and trouble-shooting with the I2C so I wanted an easy way
to run the board as a normal aurduino without the ethercat things. It was required to define ECAT
during compile for it to be an ecat device. Now that is gone, so remove all of that.
Last edit: 10 months 2 weeks ago by Hakan.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #340188 by Hakan
I connected up the hardware in the same way as your system. It didn't want to go to PREOP.
It seems you have been editing a lot, at least some, in lib/soes and I would say that's a big no-no. Leave that as is.
I restored lib/soes from E7000, fixed settings for SPI, removed all SPI from main.cpp, modified loop() and the card is now up and running in PREOP.
 
You shouldn't need to make a lot of editing in lib/soes, only to get SPI running and I think it was fine the way you did it.
All editing for SDOs PDOs etc are done through the EEPROM_generator, no manual editing is needed.



 
The following user(s) said Thank You: besriworld

Please Log in or Create an account to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum