Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - REDLINETECH

#2
OS software and RTOS / LAZARUS กับ Comport(RS232)
December 23, 2015, 02:32:03 PM
http://sourceforge.net/projects/lazarus/

ใช้เวอร์ชั่นอื่นติดปัญหาแก้ยังไม่ได้ครับ 2014 ติดตั้งแล้วเคเลย
ใช้แทน DELPHI ได้เลย ฟรีๆ
#5
ค่า sin() ใน C จะเป็น เรเดียล ครับจึงต้องแปลงองศาเป็นเรเดียลก่อนครับ

void Table_Sine_Wave(void)
{
   float  radians,pi=3.141,Sine_180[180];
   unsigned int degree;

    for(degree=0;degree<=180;degree++)
              { 
                        radians = degree*pi/180;

                   Sine_180[degree] =  sin(radians);
                     }
}
#7
เล่นเอาทีมงานผม เง็งซะนาน น้องเขาเขียนพอร์ทมาใช้งานที่ PA13 ,14 ดีบัค ยังไงก็ไม่ได้ น้องเขารายงานว่า เจี๊ยว5 แบบทดลอง มันไม่สมบูรณ์ โค๊ดก็ไม่เกิน 32เค เลย นั่งเพ่งกระแสจิตร 48 ชั่วโมงติดต่อกัน เจอครับ

#10
มีของดีผีบอกมาแนะนำครับ ไม่ต้องมีคาถากำกับ สร้างงานยากๆให้ง่ายขึ้นสำหรับค่าย ASTV อุ้ย ST ครับ มันจอร์ดมากจริงๆ ยิ่งกว่าได้แอบดูอั้มอาบน้ำอีกครับ
http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_pr-stm32cubef2_apr2014

มานเจนโค๊ดได้ค่อนไปทางดีเลยนะครับ ลดความยุ่งเหยิงลงไปได้เยอะมากๆเลยหละ ผมใช้กับ Keil ครบมากๆได้ทุกตัวเลย Coocox มันยังติดๆขัดๆอยูนะครับ
#12
ขอไหว้วอนสิ่งศักดิ์สิทธิ์ ดลให้ผู้รู้มาอธิบายเป็นวิทยาทานด้วยเถิดครับ แฮ่ เจ้า stm 32f407discu ของทาง st นี่แหละ พยายามอ่าน Hall sensor จนจะเป้นลม ยังหาทางไม่เจอ สัญญาณ oc1 , oc1n , oc2 , oc2n , oc3 , oc3n ไม่รู้เขาจะออกทางขาไหนเซ็ทคอนฟิกยังไง แต่ตัวอ่านเอนโค๊ดเดอร์ อ่านได้แล้ว แต่จะทำการอ่านด้วยแคปเจอร์ด้วยยังไม่ได้ ตอนนี้ใช้วิธิ ต่อขาไป TIM ตัวอื่นแคบแทน ยังไงฝากผู้รู้ด้วยนะครับ จะขอบพระคุณมาก ตามโค๊ดผมที่อ่านเอนโคํดเดอร์ ตามนี้ครับ อาจจะเทอะทะนะเพราะมือใหม่จริงๆ ช่วยชี้แนะด้วยครับ

void encoder(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
//EXTI_InitTypeDef EXTI_InitStructure;
  //*************************encoder********************************************
  //Enable or disable the AHB1 peripheral clock
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
        //Configure GPIO pin
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF ;
          GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz ;
          GPIO_InitStructure.GPIO_OType = GPIO_OType_PP ;
          GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN ;
        GPIO_Init(GPIOA, &GPIO_InitStructure);

         RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
                //Configure GPIO pin
                GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
                GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF ;
                  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz ;
                  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP ;
                  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN ;
                GPIO_Init(GPIOB, &GPIO_InitStructure);
        //Configure GPIO pin alternate function
        GPIO_PinAFConfig(GPIOA, GPIO_PinSource15, GPIO_AF_TIM2);
        //Configure GPIO pin alternate function
        GPIO_PinAFConfig(GPIOB, GPIO_PinSource3, GPIO_AF_TIM2);
        // TIM2 clock enable
               RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);
        TIM_EncoderInterfaceConfig(TIM2, TIM_EncoderMode_TI12, TIM_ICPolarity_Rising, TIM_ICPolarity_Rising);//
        TIM_SetAutoreload (TIM2, 0xffffffff);

        //**********************************************************************
       /* Enable the TIM1 global Interrupt */
       NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;
       NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
       NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
       NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
       NVIC_Init(&NVIC_InitStructure);
     //*******************************************************************

        TIM_Cmd (TIM2, ENABLE);
        TIM_SetCounter (TIM2, 0);
        // NVIC_EnableIRQ(TIM2_IRQn); // Interrupt Enable
         //  a = TIM_GetCounter  (TIM2);

  //***************************end encoder*****************************************
}