• AVR Freaks

Helpful ReplySPI with PIC16F18345

Page: << < ..6 Showing page 6 of 6
Author
jack@kksound
code tags!
  • Total Posts : 3221
  • Reward points : 0
  • Joined: 2014/05/14 10:03:19
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/02/07 09:53:33 (permalink)
+1 (1)
Okay how to overcome this. I used my own function to change float value into string. Still it is taking time to print.
What to do now?

Make it faster, don't use float variables, use integers (some scaling probably required).
ram1723
Starting Member
  • Total Posts : 79
  • Reward points : 0
  • Joined: 2018/01/16 22:27:23
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/02/07 10:04:17 (permalink)
0
I am using 1 Mhz internal oscillator for this project. I am not going to use any external oscillator, does it okay? Again Confused 🤔

'//'A'lone Employee'
ram1723
Starting Member
  • Total Posts : 79
  • Reward points : 0
  • Joined: 2018/01/16 22:27:23
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/02/07 10:06:27 (permalink)
0
jack@kksound
Okay how to overcome this. I used my own function to change float value into string. Still it is taking time to print.
What to do now?
Make it faster, don't use float variables, use integers (some scaling probably required).

Okay understood and will try. Will I get the accurate angles if I use only integers

'//'A'lone Employee'
jack@kksound
code tags!
  • Total Posts : 3221
  • Reward points : 0
  • Joined: 2014/05/14 10:03:19
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/02/07 12:38:37 (permalink)
0
If you scale the integers properly you will.
ram1723
Starting Member
  • Total Posts : 79
  • Reward points : 0
  • Joined: 2018/01/16 22:27:23
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/02/07 21:41:44 (permalink)
0
If I use external oscillator will it resolve?

'//'A'lone Employee'
brownt
Super Member
  • Total Posts : 296
  • Reward points : 0
  • Joined: 2015/11/21 14:58:09
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/02/07 23:30:40 (permalink)
0
check the datasheet and compare the maximum internal oscillator speed to the maximum external oscillator speed.
ram1723
Starting Member
  • Total Posts : 79
  • Reward points : 0
  • Joined: 2018/01/16 22:27:23
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/03/29 20:56:26 (permalink)
0
What PIC controller ic is best for this project. Here I am interfacing my pic ic with adxl345 and xbee reading data and sending data. I have successfully executed last time with adxl345 but failed at battery life and solar charger. Now i want to design with 16 bit pic low power controller. Please suggest me any pic suitable to this controller.  
post edited by ram1723 - 2018/10/03 21:31:17

'//'A'lone Employee'
ram1723
Starting Member
  • Total Posts : 79
  • Reward points : 0
  • Joined: 2018/01/16 22:27:23
  • Location: 0
  • Status: offline
Re: SPI with PIC16F18345 2018/10/09 05:31:01 (permalink)
0
I am getting the data when i tap or hit the sensor, But when i am moving slowly very slowly activity is not happening. What could be the reason.
 
my code :
ADXL345(0x2C , 0x0C); // BW_RATE 400HZ
ADXL345(0x27 , 0xF0); // ACT_INACT_CNL ACTIVITY ENABLE
ADXL345(0x24 , 0x0F); // THRESH_ACT
ADXL345(0x31 , 0x08); // DATA_FORMAT FULL_RES 2G
ADXL345(0x2A , 0x07); // TAP_AXES TAP ENABLE X,Y,Z
ADXL345(0x2D , 0x00); // POWER_CTL
ADXL345(0x2D , 0x08); // POWER_CTL MEASURE
ADXL345(0x2E , 0x90); //INT_ENABLE DATA READY , ACTIVITY
 
 
activity = ADXL345(0xB0 , 0x00);
 
if(activity & 0x10)
{
// LATBbits.LATB5 = 0;
//sprintf("");
EUSART_Write_string("data\r\n");
}
 
 
uint8_t ADXL345(uint8_t add , uint8_t data)
{
uint8_t buff;
Chip_Select = 0;
SPI1_Exchange8bit(add);
buff = SPI1_Exchange8bit(data);
Chip_Select = 1;
return buff;
}

'//'A'lone Employee'
Page: << < ..6 Showing page 6 of 6
Jump to:
© 2019 APG vNext Commercial Version 4.5