Recent Posts

Pages: [1] 2 3 4 5 6 ... 10 Next
1
ENI 403LA Class A wideband RF amplifier 3 Watts 37dB 150 kHz - 300 MHz

Tested in good working order (photos available)

Power cable fitted with IEC type connector to support variable length cables

£200 Collection or shipping available
2
Beginners / Re: Bulk input caps and impedance
« Last post by Zero999 on Today at 04:22:41 pm »
Now I want to try what an inductor does.

10uH torroid ... not what I expected.
470uH - more what I expected, although it appears to only delay the steep portion of the rise.
4.7mH and it's much better.... longer / smoother / lower gradient.

What's the catch?
What's the ESR of those inductors?

How do they compare to a resistor of the same value?
3
Programming / Re: Linux Dependency Black Hole
« Last post by mag_therm on Today at 04:22:08 pm »
Hi tatel, That is interesting.
Yes I have downloaded the firmware  C files from git  and have been examining them. But I dont have C IDE or debug, (And not used C for 36 years, so a lot to learn)
So thought MCUX and a devel board  would give me everything including debug.

Also I have been thinking today, with the ease of uploading the firmware, and as I only need < 10 frequencies I could just build 10 firmwares each with a fixed dataset for the Si5351.
A little UI and bash to replace firmware on frequency change , and with the latest qnuradio ( python based)  which allows users to build their own DSP,     could be an easy solution at least initially
4
Test Equipment / Re: Choosing between entry-level 12-bit DSOs
« Last post by Fungus on Today at 04:21:43 pm »
1) oscilloscope is not properly BW limited, so Sinc filter is unable to reconstruct perfectly, instead of nice sine, it creates AM sine.

140MHz is below Nyquist.
5
ENI 403L wideband class A linear amplifier 150 kHz ~ 250 MHz, designed to give up to 3W output.

Showing low RF output. All discrete component design so should be an easy repair.

£125 Collection or shipping available
6
Programming / Re: Linux Dependency Black Hole
« Last post by tatel on Today at 04:18:26 pm »
Another thing, developing tools, libraries, etc, take a big chunk of hard disk space, so you could find your Pi doesn't have that much space available. You could perhaps add some hardware, or do the development on a regular PC. In that case you would be creating binaries for an architecture in a machine with another, different architecture. To do that, you should look at "cross-compiling"

It basically means you first built a toolchain able to do what you want. That's usually how OpenWRT is built, and I'm pretty sure it will be the same for the Pi.
7
Test Equipment / Re: Choosing between entry-level 12-bit DSOs
« Last post by Mechatrommer on Today at 04:17:14 pm »
Riddle me this:
Signal theory also says there's only one curve that fits a set of sampled points in a bandwidth limited signal.
The "AM" signal fits perfectly so how can we say it's possible to reconstruct the original sine wave? It contradicts theory.
the possibility is i already mentioned...

1) oscilloscope is not properly BW limited, so Sinc filter is unable to reconstruct perfectly, instead of nice sine, it creates AM sine.
2) the filter probably assumes (algorithm used is for) "uniform sampling distance" where in reality is not.
3) or simply, DHO900 is not using proper Sinc filter? (if shapirus can provide me with CSV data of the sampled 142MHz @ 312.5MSps that produced the AM shape on DSO, i may try to replot it in my VisaDSO with its latest implementation of Sinc (internet open source copy pasted implementation) so we can see if same AM shape is produced)

https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem

maybe we can look the same test made by shapirus on SDS800X if scope can produce the same AM shaped signal very near to (but not reaching) Sr / 2. if SDS800X is properly BW limited and Sinc filter/interpolation is implemented correctly i suspect it will not create such AM shape, it should be nice 142MHz sine (constant amplitude on each cycle) unlike the picture you linked earlier (on Rigol DHO900) if sampled at slightly higher than 284MSps (such as 312.5MSps). ymmv.
8
General Technical Chat / Re: Is LinkedIn worth keeping?
« Last post by mendip_discovery on Today at 04:17:06 pm »
I go in there every now and then to just laugh at the corporate head shots they have. Some of course have cool pictures, as they are way too cool for school, you know picture of them and their midlife crisis.

EDIT: For a laugh, I logged in on a private tab, and within a few scrolls past the adverts, a message/bot popped up asking if I was looking for a job. Feck me it's 9 adverts and maybe an odd post by someone I know. Its really not worth it.
9
Buy/Sell/Wanted / FS: Cranage Plipman EMC Emissions tester 30 kHz ~ 30 MHz
« Last post by kloss on Today at 04:16:53 pm »
Cranage Plipman EMC Emissions tester

30 kHz ~ 30 MHz professional EMC emissions tester, portable in carry case with mains connection cable and charger.

Connect to either mains or RF input to monitor emissions either from the mains or from RF signals.

Photo available showing working, receiving BBC R4 LW from small indoor aerial (not included).

Calibration carried out last year so spot on frequency.

£200 Collection or shipping available
10
Microcontrollers / Re: CH32V003 using I2C mpu6050
« Last post by jlsilicon on Today at 04:14:44 pm »
If this helps - without the old commented code :

Code: [Select]

/*

  Create project as : ch32v003 - f4p6  (- Not 103/203)
  - copy main.c from /EVT/EXAM/.../I2C_mpu6050/User/

 FAQs :
 - Typo used id 0x58 , should be 0x68
 - Wrong I2C pins for 003 : not PA1=SDA PA2=SCL , should be PC1=SDA PC2=SCL

The VCC and GND pins of the CH32V103 development board are connected to the VCC and GND pins of the MPU6050 module.
 PC1 = SDA : The PC1 pin of the CH32V003 development board is connected to the SDA pin of the MPU6050 module
 PC2 = SCL : The PC2 pin of the CH32V003 development board is connected to the SCL pin of the MPU6050 module

//The VCC and GND pins of the CH32V103 development board are connected to the VCC and GND pins of the MPU6050 module.
// PA1 = SDA : The PA1 pin of the CH32V103 development board is connected to the SDA pin of the MPU6050 module
// PA2 = SCL : The PA2 pin of the CH32V103 development board is connected to the SCL pin of the MPU6050 module

Mpu6050 : Id Address = 0x68 wrt , 0x69 rd

 - Compiles Downloads , Returns same data : Temp=175, AX=-11823 , AY=-11823 , AZ=-11823 , GX=-11823 , AGY=-11823 , GZ=-11823

 - TX = PA9
 - RX = PA10

*/

///

#include "debug.h"

//


u8   AT24CXX_ReadOneByte(  u16 ReadAddr ) ;
void AT24CXX_WriteOneByte( u16 WriteAddr, u8 DataToWrite ) ;
void AT24CXX_Read(         u16 ReadAddr, u8 *pBuffer, u16 NumToRead ) ;
void AT24CXX_Write(        u16 WriteAddr, u8 *pBuffer, u16 NumToWrite ) ;


///


#ifndef __MPU6050_H
#define __MPU6050_H


// // #include "iic.h"
// #include "debug.h"


//MPU6050 AD0
/*
#define MPU_AD0_H               GPIO_SetBits(  GPIOA,GPIO_Pin_15)    // SDA
#define MPU_AD0_L               GPIO_ResetBits(GPIOA,GPIO_Pin_15)  // SDA
*/
// 003-c8t6 : - SCL=A6 , SDA=A7 :
#define MPU_AD0_H               GPIO_SetBits(  GPIOC,GPIO_Pin_1)    // SDA
#define MPU_AD0_L               GPIO_ResetBits(GPIOC,GPIO_Pin_1)  // SDA
/*
// 203-c8t6 : - SCL=C2 , SDA=C1 :
#define MPU_AD0_H               GPIO_SetBits(  GPIOC,GPIO_Pin_1)    // SDA
#define MPU_AD0_L               GPIO_ResetBits(GPIOC,GPIO_Pin_1)  // SDA
*/


 #define MPU_ACCEL_OFFS_REG        0X06    //accel_offs
 #define MPU_PROD_ID_REG           0X0C    //prod id

#define MPU_SELF_TESTX_REG      0X0D    //X
#define MPU_SELF_TESTY_REG      0X0E    //Y
#define MPU_SELF_TESTZ_REG      0X0F    //Z
#define MPU_SELF_TESTA_REG      0X10    //A
#define MPU_SAMPLE_RATE_REG     0X19    //
#define MPU_CFG_REG             0X1A    //
#define MPU_GYRO_CFG_REG        0X1B    //
#define MPU_ACCEL_CFG_REG       0X1C    //
#define MPU_MOTION_DET_REG      0X1F    //
#define MPU_FIFO_EN_REG         0X23    //FIFO
#define MPU_I2CMST_CTRL_REG     0X24    //IIC
#define MPU_I2CSLV0_ADDR_REG    0X25    //IIC
#define MPU_I2CSLV0_REG         0X26    //IIC
#define MPU_I2CSLV0_CTRL_REG    0X27    //IIC
#define MPU_I2CSLV1_ADDR_REG    0X28    //IIC
#define MPU_I2CSLV1_REG         0X29    //IIC
#define MPU_I2CSLV1_CTRL_REG    0X2A    //IIC
#define MPU_I2CSLV2_ADDR_REG    0X2B    //IIC2
#define MPU_I2CSLV2_REG         0X2C    //IIC2
#define MPU_I2CSLV2_CTRL_REG    0X2D    //IIC2
#define MPU_I2CSLV3_ADDR_REG    0X2E    //IIC3
#define MPU_I2CSLV3_REG         0X2F    //IIC3
#define MPU_I2CSLV3_CTRL_REG    0X30    //IIC3
#define MPU_I2CSLV4_ADDR_REG    0X31    //IIC4
#define MPU_I2CSLV4_REG         0X32    //IIC4
#define MPU_I2CSLV4_DO_REG      0X33    //IIC4
#define MPU_I2CSLV4_CTRL_REG    0X34    //IIC4
#define MPU_I2CSLV4_DI_REG      0X35    //IIC4

#define MPU_I2CMST_STA_REG      0X36    //IIC
#define MPU_INTBP_CFG_REG       0X37    // /
#define MPU_INT_EN_REG          0X38    //
#define MPU_INT_STA_REG         0X3A    //

#define MPU_ACCEL_XOUTH_REG     0X3B    //X 8
#define MPU_ACCEL_XOUTL_REG     0X3C    //X 8
#define MPU_ACCEL_YOUTH_REG     0X3D    //Y 8
#define MPU_ACCEL_YOUTL_REG     0X3E    //Y 8
#define MPU_ACCEL_ZOUTH_REG     0X3F    //Z 8
#define MPU_ACCEL_ZOUTL_REG     0X40    //Z 8

#define MPU_TEMP_OUTH_REG       0X41    //
#define MPU_TEMP_OUTL_REG       0X42    //8

#define MPU_GYRO_XOUTH_REG      0X43    //X 8
#define MPU_GYRO_XOUTL_REG      0X44    //X 8
#define MPU_GYRO_YOUTH_REG      0X45    //Y 8
#define MPU_GYRO_YOUTL_REG      0X46    //Y 8
#define MPU_GYRO_ZOUTH_REG      0X47    //Z 8
#define MPU_GYRO_ZOUTL_REG      0X48    //Z 8

#define MPU_I2CSLV0_DO_REG      0X63    //IIC0
#define MPU_I2CSLV1_DO_REG      0X64    //IIC1
#define MPU_I2CSLV2_DO_REG      0X65    //IIC2
#define MPU_I2CSLV3_DO_REG      0X66    //IIC3

#define MPU_I2CMST_DELAY_REG    0X67    //IIC
#define MPU_SIGPATH_RST_REG     0X68    //
#define MPU_MDETECT_CTRL_REG    0X69    //
#define MPU_USER_CTRL_REG       0X6A    //
#define MPU_PWR_MGMT1_REG       0X6B    //1
#define MPU_PWR_MGMT2_REG       0X6C    //2
#define MPU_FIFO_CNTH_REG       0X72    //FIFO
#define MPU_FIFO_CNTL_REG       0X73    //FIFO
#define MPU_FIFO_RW_REG         0X74    //FIFO
#define MPU_DEVICE_ID_REG       0X75    //ID

#define MPU_ADDR                0X68

//#define MPU_READ    0XD1

//#define MPU_WRITE   0XD0

u8 MPU_Init(void);                              //MPU6050
u8 MPU_Write_Len(u8 addr,u8 reg,u8 len,u8 *buf);//IIC
u8 MPU_Read_Len(u8 addr,u8 reg,u8 len,u8 *buf); //IIC
u8 MPU_Write_Byte(u8 reg,u8 data);              //IIC
u8 MPU_Read_Byte(u8 reg);                       //IIC

u8 MPU_Set_Gyro_Fsr(u8 fsr);
u8 MPU_Set_Accel_Fsr(u8 fsr);
u8 MPU_Set_LPF(u16 lpf);
u8 MPU_Set_Rate(u16 rate);
u8 MPU_Set_Fifo(u8 sens);

short MPU_Get_Temperature(void);
u8 MPU_Get_Gyroscope(short *gx,short *gy,short *gz);
u8 MPU_Get_Accelerometer(short *ax,short *ay,short *az);


#endif


///


//fsr:0,250dps;1,500dps;2,1000dps;3,2000dps
u8 MPU_Set_Gyro_Fsr(u8 fsr)
{
            AT24CXX_WriteOneByte( MPU_GYRO_CFG_REG , fsr << 3 )  ;
return( 0 );
}

u8 MPU_Set_Accel_Fsr(u8 fsr)
{
       AT24CXX_WriteOneByte( MPU_ACCEL_CFG_REG , fsr << 3 )  ;
return( 0 );
}


u8 MPU_Set_LPF(u16 lpf)
{
u8 data = 0;

    if(      lpf >= 188 )
        data=1;
    else if( lpf >= 98 )
        data=2;
    else if( lpf >= 42 )
        data=3;
    else if( lpf >= 20 )
        data=4;
    else if( lpf >= 10 )
        data=5;
    else
        data = 6;

    AT24CXX_WriteOneByte( MPU_CFG_REG , data )  ;

return(0);
}


u8 MPU_Set_Rate(u16 rate)
{
u8 data;

    if(rate > 1000)
        rate = 1000;
    if(rate < 4)
        rate = 4;
    data = 1000 / rate - 1 ;

           AT24CXX_WriteOneByte( MPU_SAMPLE_RATE_REG , data );    //

return MPU_Set_LPF( rate / 2 ); //LPF
}


short MPU_Get_Temperature(void)
{
u8 buf[2];
short raw;
float temp;

    AT24CXX_Read(            MPU_TEMP_OUTH_REG , buf , 2 );

    raw  = ((u16)buf[0]<<8) | buf[1];
    temp = 36.53 + ((double)raw) / 340;

return( temp * 100 );
}


u8 MPU_Get_Gyroscope(short *gx,short *gy,short *gz)
{
u8 buf[6],res = 0 ;

         AT24CXX_Read(            MPU_GYRO_XOUTH_REG , buf , 6 );

        *gx = ((u16)buf[0]<<8) | buf[1];
        *gy = ((u16)buf[2]<<8) | buf[3];
        *gz = ((u16)buf[4]<<8) | buf[5];
        printf("GYRO : X=%d , Y=%d , Z=%d  \r\n",*gx,*gy,*gz);

return res;;
}


u8 MPU_Get_Accelerometer(short *ax,short *ay,short *az)
{
u8 buf[6] , res = 0 ;

          AT24CXX_Read(            MPU_ACCEL_XOUTH_REG , buf , 6 );

        *ax = ((u16)buf[0]<<8) | buf[1];
        *ay = ((u16)buf[2]<<8) | buf[3];
        *az = ((u16)buf[4]<<8) | buf[5];

        printf("ACC  : X=%d , Y=%d , Z=%d  \r\n", *ax , *ay , *az );

return res;;
}


// int main(void)
// int main_1(void)
int  MPU6050_TEST(void)
{
short aacx,aacy,aacz;       //
short gyrox,gyroy,gyroz;    //
short temp;                 //

        while( 1 )
        {

            temp = MPU_Get_Temperature(); //
            MPU_Get_Accelerometer(&aacx,&aacy,&aacz);   //
            MPU_Get_Gyroscope(&gyrox,&gyroy,&gyroz);    //

            printf("\r\n Temperature:%d \r\n",temp);

             Delay_Ms(500);

        }
}

///


/**********************************************************************
*@Note:
  AT24Cxx
    READ EEPROM Start + 0xA0 + 8bit Data Address + Start + 0xA1 + Read Data + Stop.
    WRITE EERPOM Start + 0xA0 + 8bit Data Address + Write Data + Stop.
*******************************************************************************/

/* EERPOM DATA ADDRESS Length Definition */
#define Address_8bit  0
#define Address_16bit  1

/* EERPOM DATA ADDRESS Length Selection */
#define Address_Lenth   Address_8bit
//#define Address_Lenth   Address_16bit

/* Global define */
#define SIZE sizeof(TEXT_Buffer)

/* Global Variable */
const u8 TEXT_Buffer[]={"CH32V00x I2C TEST"};


/*********************************************************************
 * @fn      IIC_Init
 * @brief   Initializes the IIC peripheral.
 * @return  none
 */
void IIC_Init(u32 bound, u16 address)
{
printf("> IIC_Init() : bound=%d , address=%02X :\r\n" , bound , address );

    GPIO_InitTypeDef GPIO_InitStructure = {0};
    I2C_InitTypeDef  I2C_InitTSturcture = {0};

    RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE );
    RCC_APB1PeriphClockCmd( RCC_APB1Periph_I2C1, ENABLE );

    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_2;
    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF_OD;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init( GPIOC, &GPIO_InitStructure );

    GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_1;
    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF_OD;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init( GPIOC, &GPIO_InitStructure );

    I2C_InitTSturcture.I2C_Mode                = I2C_Mode_I2C;
    I2C_InitTSturcture.I2C_OwnAddress1         = address;
    I2C_InitTSturcture.I2C_ClockSpeed          = bound;
    I2C_InitTSturcture.I2C_DutyCycle           = I2C_DutyCycle_2;
    I2C_InitTSturcture.I2C_Ack                 = I2C_Ack_Enable;
    I2C_InitTSturcture.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
    I2C_Init( I2C1, &I2C_InitTSturcture );

    I2C_Cmd( I2C1, ENABLE );

    I2C_AcknowledgeConfig( I2C1, ENABLE );

printf("< IIC_Init() .\r\n");
}

/*********************************************************************
 * @fn      AT24CXX_Init
 * @brief   Initializes AT24xx EEPROM.
 * @return  none
 */

void MPU6050_Init(void)
{
    IIC_Init( 100000, 0x68 );
}


/*********************************************************************
 * @fn      AT24CXX_ReadOneByte
 * @brief   Read one data from EEPROM.
 * @param   ReadAddr - Read first address.
 * @return  temp - Read data.
 */
u8 AT24CXX_ReadOneByte(u16 ReadAddr)
{
    u8 temp=0;

    while( I2C_GetFlagStatus( I2C1, I2C_FLAG_BUSY ) != RESET );
    I2C_GenerateSTART( I2C1, ENABLE );

    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_MODE_SELECT ) );
    I2C_Send7bitAddress( I2C1, 0X68, I2C_Direction_Transmitter );

    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ) );


    // Send Address 8b / 16b : //

#if (Address_Lenth  == Address_8bit)
    I2C_SendData( I2C1, (u8)(ReadAddr&0x00FF) );
    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );

#elif (Address_Lenth  == Address_16bit)
    I2C_SendData( I2C1, (u8)(ReadAddr>>8) );
    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );

    I2C_SendData( I2C1, (u8)(ReadAddr&0x00FF) );
    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );

#endif


    I2C_GenerateSTART( I2C1, ENABLE );

    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_MODE_SELECT ) );
    I2C_Send7bitAddress( I2C1, 0X68, I2C_Direction_Receiver );

     while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED ) );
     while( I2C_GetFlagStatus( I2C1, I2C_FLAG_RXNE ) ==  RESET )
    I2C_AcknowledgeConfig( I2C1, DISABLE );

    temp = I2C_ReceiveData( I2C1 );
  I2C_GenerateSTOP( I2C1, ENABLE );

    return temp;
}


/*********************************************************************
 * @fn      AT24CXX_WriteOneByte
 * @brief   Write one data to EEPROM.
 * @param   WriteAddr - Write frist address.
 * @return  DataToWrite - Write data.
 */
void AT24CXX_WriteOneByte(u16 WriteAddr, u8 DataToWrite)
{
    while( I2C_GetFlagStatus( I2C1, I2C_FLAG_BUSY ) != RESET );
    I2C_GenerateSTART( I2C1, ENABLE );

    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_MODE_SELECT ) );
    I2C_Send7bitAddress( I2C1, 0X68, I2C_Direction_Transmitter );

    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ) );


    // Send Address 8b / 16b : //

#if (Address_Lenth  == Address_8bit)
    I2C_SendData( I2C1, (u8)(WriteAddr&0x00FF) );
    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );

#elif (Address_Lenth  == Address_16bit)
    I2C_SendData( I2C1, (u8)(WriteAddr>>8) );
    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );

    I2C_SendData( I2C1, (u8)(WriteAddr&0x00FF) );
    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );

#endif


    if( I2C_GetFlagStatus( I2C1, I2C_FLAG_TXE ) !=  RESET )
    {
        I2C_SendData( I2C1, DataToWrite );
    }

    while( !I2C_CheckEvent( I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED ) );
    I2C_GenerateSTOP( I2C1, ENABLE );
}


/*********************************************************************
 * @fn      AT24CXX_Read
 * @brief   Read multiple data from EEPROM.
 * @param   ReadAddr - Read frist address. (AT24c02: 0~255)
 *          pBuffer - Read data.
 *          NumToRead - Data number.
 * @return  none
 */
void AT24CXX_Read(u16 ReadAddr, u8 *pBuffer, u16 NumToRead)
{
    while( NumToRead )
    {
        * pBuffer ++ = AT24CXX_ReadOneByte( ReadAddr ++ );
         NumToRead -- ;
    }
}


/*********************************************************************
 * @fn      AT24CXX_Write
 * @brief   Write multiple data to EEPROM.
 * @param   WriteAddr - Write frist address. (AT24c02: 0~255)
 *          pBuffer - Write data.
 *          NumToWrite - Data number.
 * @return  none
 */
void AT24CXX_Write(u16 WriteAddr, u8 *pBuffer, u16 NumToWrite)
{
    while(NumToWrite--)
    {
        AT24CXX_WriteOneByte( WriteAddr , * pBuffer );
         WriteAddr ++ ;
         pBuffer ++ ;
          Delay_Ms(2);
    }
}


// // void MPU6050_Write(u16 WriteAddr, u8 *pBuffer, u16 NumToWrite)
void MPU6050_Write()
{
printf("> MPU6050_Write() : \r\n");

     AT24CXX_WriteOneByte(MPU_PWR_MGMT1_REG,0X80); //MPU6050
      Delay_Ms(100);

     AT24CXX_WriteOneByte(MPU_PWR_MGMT1_REG,0X00); //MPU6050

printf("= MPU6050_Write() -> MPU_Set_Gyro_Fsr() \r\n");

     MPU_Set_Gyro_Fsr(3);                    //+-2000dps

     MPU_Set_Accel_Fsr(0);                   //+-2g

     MPU_Set_Rate(50);                       //50Hz

printf("= MPU6050_Write() ... \r\n");

     AT24CXX_WriteOneByte(MPU_INT_EN_REG,0X00);    //

     AT24CXX_WriteOneByte(MPU_USER_CTRL_REG,0X00); //I2C

     AT24CXX_WriteOneByte(MPU_FIFO_EN_REG,0X00);   //FIFO

     AT24CXX_WriteOneByte(MPU_INTBP_CFG_REG,0X80); //INT


     AT24CXX_ReadOneByte( MPU_DEVICE_ID_REG );

         AT24CXX_WriteOneByte(MPU_PWR_MGMT1_REG,0X01); // CLKSEL,PLL X
         AT24CXX_WriteOneByte(MPU_PWR_MGMT2_REG,0X00); //

         MPU_Set_Rate(50);                       // 50Hz

printf("< MPU6050_Write() . \r\n");
}


/*********************************************************************
 * @fn      main
 * @brief   Main program.
 * @return  none
 */
int main(void)
{

    Delay_Init();
    USART_Printf_Init(115200);
    printf("\r\n\r\n: MPU6050 003 :\r\n");
     printf("- SystemClk:%d\r\n",SystemCoreClock);

    MPU6050_Init();

    Delay_Ms(500);

    ;

    MPU6050_Write();

    Delay_Ms(500);

    while( 1 )
    {

        printf("> mpu6050 Test ... \r\n");

        MPU6050_TEST();

         Delay_Ms(500);

    }

}

///

Pages: [1] 2 3 4 5 6 ... 10 Next