Saturday, June 22, 2013

adis16209 : switch/change command delay

Recently, I have been doing testing for adis16209 sensor. I came across a strange problem when running this piece of code:
 write_spi(ROT_OUT);  
 //wait until we receive rot_out_value from SPI  
 uart_write(rot_out_value);  
 write_spi(YINCL_OUT);  
 //wait until we receive yincl_out_value from SPI  
 uart_write(yincl_out_value);  

The sensor returns false values for ROT_OUT and YINCL_OUT commands. I started to dig into the problem and came to a conclusion that if we want to change the command (For example from ROT_OUT to YINCL_OUT), we must do like this :
 //switch to ROT_OUT command  
 write_spi(ROT_OUT);  
 //small delay  
 delay_us(40);  
 write_spi(ROT_OUT);  
 //wait until we receive rot_out_value from SPI  
 uart_write(rot_out_value);  
 //switch to YINCL_OUT command  
 write_spi(YINCL_OUT);  
 //small delay  
 delay_us(40);  
 write_spi(YINCL_OUT);  
 //wait until we receive yincl_out_value from SPI  
 uart_write(yincl_out_value);  

Wednesday, June 19, 2013

TOMEE java.lang.OutOfMemoryError: PermGen space

In order to solve this annoying problem with PermGen space in TomEE (possibly Tomcat as well) when we try to run startup.bat:
- Create file with name setenv.bat in bin folder with content as follow :
set "CATALINA_OPTS=-Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m"