立即註冊 登錄
痞酷網_PIGOO 返回首頁

ysc的個人空間 https://bbs.pigoo.com/?28187 [收藏] [複製] [RSS]

留言板

facelist

您需要登錄後才可以留言 登錄 | 立即註冊


szjuang 2017-8-28 07:52 PM
ysc: 您好,電路圖上黃色長條代表銅箔接觸點,轉盤上有三點旋轉接觸銅片,這三點接觸銅片是短路在一起的,所以隨著轉盤轉動,被選擇的檔位電路板上相對應位置這三條黃 ...
您好,感謝您,小弟剛才將電表打開,果然看到您所說的轉盤那三個短路的接點,這樣對於追蹤各個功能項有很大的幫助,謝謝你!
另外,小弟最近看到論壇中有關 ESR 表的討論及DIY的文章,而手邊有幾顆回收場帶回表頭是好的指針電表,所以也想做一個試試,但ESR關鍵組件的表頭卻不知如何辯試其空接滿刻度的電流值,是否電表標示 DC 20Kohm/V 即代表此表頭是50uA的表頭?謝謝!
szjuang 2017-8-28 06:47 PM
您好,感謝分享 [電子儀表] DE-960TR指針式電表電路圖 實用資訊,這個電表小弟有收集到兩顆。
有一個關於此電路圖的問題請教,就是在上方每個量測功能選項,都畫有三條黃色橫槓,不知中間那一條橫槓是代表什麼?連到那些橫槓的線路會往哪走呢?
由於小弟不是本科,僅憑著一股濃濃的興趣進入電子領域,看起電路圖還是有些吃力,隨著時間的投入及爬文,漸漸地有些概念,但看到這張電路圖還是有些不懂,還請你多多指教,謝謝!
picco9 2014-7-4 11:14 PM
ysc: 關於你在「求助-T5電子開關更改點亮程序」的帖子
先說抱歉~打攪了
"拿掉這顆電容將三段式改為四段式"
它的原理是??(正想將三段改成四段) 先說聲 ...
請問此電容之位置為?謝謝!
picco9 2014-7-4 11:10 PM
ysc: 關於你在「求助-T5電子開關更改點亮程序」的帖子
先說抱歉~打攪了
"拿掉這顆電容將三段式改為四段式"
它的原理是??(正想將三段改成四段) 先說聲 ...
請問此電容之位置為?
picco9 2014-7-4 09:40 PM
關於你在「求助-T5電子開關更改點亮程序」的帖子
先說抱歉~打攪了
"拿掉這顆電容將三段式改為四段式"
它的原理是??(正想將三段改成四段) 先說聲謝謝!
antlu 2014-6-12 02:52 AM
ysc: 對了,昨晚忘了說,
我的程式在呼叫TIM4初始化副程式之後,有執行 RIM 指令,用來允許接受中斷, C應該有相對應的指令。 ...
ysc大:
   我的 STM8S903K3 後來發現沒有 TIM4 還有中斷設定打架,更改為 TIM1 中斷問題解決了!! 感謝!! C裡面用 rim() 啟動中斷!!
antlu 2014-6-9 01:45 PM
ysc: 阿乾大:
我是用組合語言寫的,C沒試過,
TIM4初始化就只有做如下4個指令而已,這樣TIM4就會每1mS中斷一次,
TIM4中斷向量在irg23沒錯。

TIM4_INIT:
        MOV        TIM4_ ...
YSC大:
  書上面說 中斷服務程式要放在主程式上面,我也照作了但是就沒見到他作用!! 以前在 8952上面 中斷的起始程式 和中斷服務程式都放在一起,但是 這STM8我就有點搞不清楚了!!
antlu 2014-6-9 12:43 AM
上面的這些大都從書本裡抄錄下來的!!
/*        BASIC INTERRUPT VECTOR TABLE FOR STM8 devices
*        Copyright (c) 2007 STMicroelectronics
*/
#include "stm8s_tim4.h"
typedef void @far (*interrupt_handler_t)(void);

struct interrupt_vector {
        unsigned char interrupt_instruction;
        interrupt_handler_t interrupt_handler;
};

@far @interrupt void NonHandledInterrupt (void)
{
        /* in order to detect unexpected events during development,
           it is recommended to set a breakpoint on the following instruction
        */
        return;
}

extern @far @interrupt void TIM4_IRQHandler(void);

extern void _stext();     /* startup routine */

struct interrupt_vector const _vectab[] = {
        {0x82, (interrupt_handler_t)_stext}, /* reset */
        {0x82, NonHandledInterrupt}, /* trap  */
        {0x82, NonHandledInterrupt}, /* irq0  */
        {0x82, NonHandledInterrupt}, /* irq1  */
        {0x82, NonHandledInterrupt}, /* irq2  */
        {0x82, NonHandledInterrupt}, /* irq3  */
        {0x82, NonHandledInterrupt}, /* irq4  */
        {0x82, NonHandledInterrupt}, /* irq5  */
        {0x82, NonHandledInterrupt}, /* irq6  */
        {0x82, NonHandledInterrupt}, /* irq7  */
        {0x82, NonHandledInterrupt}, /* irq8  */
        {0x82, NonHandledInterrupt}, /* irq9  */
        {0x82, NonHandledInterrupt}, /* irq10 */
        {0x82, NonHandledInterrupt}, /* irq11 */
        {0x82, NonHandledInterrupt}, /* irq12 */
        {0x82, NonHandledInterrupt}, /* irq13 */
        {0x82, NonHandledInterrupt}, /* irq14 */
        {0x82, NonHandledInterrupt}, /* irq15 */
        {0x82, NonHandledInterrupt}, /* irq16 */
        {0x82, NonHandledInterrupt}, /* irq17 */
        {0x82, NonHandledInterrupt}, /* irq18 */
        {0x82, NonHandledInterrupt}, /* irq19 */
        {0x82, NonHandledInterrupt}, /* irq20 */
        {0x82, NonHandledInterrupt}, /* irq21 */
        {0x82, NonHandledInterrupt}, /* irq22 */
        {0x82, TIM4_IRQHandler}, /* irq23  TIM4_IRQHandler*/
        {0x82, NonHandledInterrupt}, /* irq24 */
        {0x82, NonHandledInterrupt}, /* irq25 */
        {0x82, NonHandledInterrupt}, /* irq26 */
        {0x82, NonHandledInterrupt}, /* irq27 */
        {0x82, NonHandledInterrupt}, /* irq28 */
        {0x82, NonHandledInterrupt}, /* irq29 */
};
antlu 2014-6-9 12:42 AM
ysc大;
  最近我練習 STM8S903 發現我用 TIM4作計時器卻不會動作,可否指導一下 中斷的服務常式要如何設定?
#include "stm8s.h"
#include "stm8s_tim4.h"
u8 pcdis[]={0xd6,0x14,0xcc,0x5c,0x1e,0x5a,0xda,0x14,0xde,0x5e};
u8 pedis[]={0x01,0x00,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01};
u8 Temperature,Hundreds,Tens,Units;
u8 PowerOn,ON,OFF;
unsigned int count;

@far @interrupt extern void TIM4_IRQHandler(void);
void delay(unsigned int time);
void TransData(void);
void Display(void);
void KeyScan(void);
void LED_control(u8 LED);
void main (void)
{
        GPIO_Init(GPIOC,GPIO_PIN_ALL,GPIO_MODE_OUT_PP_HIGH_FAST);//DISPLAY 7SEGMENT
        GPIO_Init(GPIOD,GPIO_PIN_ALL,GPIO_MODE_OUT_PP_HIGH_FAST);//DISPLAY 3DIGIT
        GPIO_Init(GPIOE,GPIO_PIN_5,GPIO_MODE_OUT_PP_HIGH_FAST);//DISPLAY SEGMENT A
        GPIO_WriteLow(GPIOE,GPIO_PIN_5);
        GPIO_Init(GPIOA,GPIO_PIN_1|GPIO_PIN_3,GPIO_MODE_IN_PU_NO_IT);//INPUT +/- TIME
        GPIO_Init(GPIOB,GPIO_PIN_3,GPIO_MODE_IN_PU_NO_IT);//INPUT + FIRE POWER

        TIM4_DeInit();
        TIM4_TimeBaseInit  ( TIM4_PRESCALER_8,250);
        TIM4_ClearFlag(TIM4_FLAG_UPDATE);
  TIM4_SetCounter(250);
  TIM4_ITConfig(TIM4_IT_UPDATE,ENABLE);
  rim();
        TIM4_Cmd(ENABLE);       

        Temperature=250;
        PowerOn=0;//power off
        while(1)
        {
        KeyScan();
        TransData();
        Display();

        }
}

void KeyScan(void)
{
        if(GPIO_ReadInputPin(GPIOB,GPIO_PIN_3)==0)
        {
        delay(50);
        if(GPIO_ReadInputPin(GPIOB,GPIO_PIN_3)==0)
        {
                while(GPIO_ReadInputPin(GPIOB,GPIO_PIN_3)==0);
                PowerOn =~PowerOn;
        }
}
       
        if(GPIO_ReadInputPin(GPIOA,GPIO_PIN_1)==0)
        {
        delay(50);
        if(GPIO_ReadInputPin(GPIOA,GPIO_PIN_1)==0)
        {
                while(GPIO_ReadInputPin(GPIOA,GPIO_PIN_1)==0);
                Temperature+=21;
        }
}
        if(GPIO_ReadInputPin(GPIOA,GPIO_PIN_3)==0)
        {
        delay(50);
        if(GPIO_ReadInputPin(GPIOA,GPIO_PIN_3)==0)
        {
                while(GPIO_ReadInputPin(GPIOA,GPIO_PIN_3)==0);
                Temperature-=19;
        }
}
}


void delay(unsigned int time)
{
        while(time--);
}

void TransData(void)
{
        Hundreds=Temperature/100;
        Tens=(Temperature%100)/10;
        Units=Temperature%10;
}

void Display(void)
{

        if(Hundreds>0)
        {
                GPIO_Write(GPIOC,pcdis[Hundreds]);
                        if(pedis[Hundreds])
                                GPIO_WriteHigh(GPIOE,GPIO_PIN_5);
                                else
                                GPIO_WriteLow(GPIOE,GPIO_PIN_5);
                        }
                else
                GPIO_Write(GPIOC,0x00);//百位消零

                        GPIO_Write(GPIOD,0x10);
                        delay(500);               
                        GPIO_WriteLow(GPIOC,GPIO_PIN_ALL);
                        delay(5);

        GPIO_Write(GPIOC,pcdis[Tens]);
        if(pedis[Tens])
        GPIO_WriteHigh(GPIOE,GPIO_PIN_5);
        else
         GPIO_WriteLow(GPIOE,GPIO_PIN_5);


                        GPIO_Write(GPIOD,0x08);
                        delay(500);
                        GPIO_WriteLow(GPIOC,GPIO_PIN_ALL);
                        delay(5);
       

        GPIO_Write(GPIOC,pcdis[Units]);
        if(pedis[Units])
        GPIO_WriteHigh(GPIOE,GPIO_PIN_5);
        else
         GPIO_WriteLow(GPIOE,GPIO_PIN_5);
                        GPIO_Write(GPIOD,0x04);
                        delay(500);
                        GPIO_WriteLow(GPIOC,GPIO_PIN_ALL);//消除殘影
                        delay(5);
                               
}



@far @interrupt void TIM4_IRQHandler(void)
{
        count++;
TIM4_ClearITPendingBit(TIM4_IT_UPDATE);
        if(count==5000)
        {
Temperature++;
                count=0;
}
}


#ifdef USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *   where the assert_param error has occurred.
  * @param file: pointer to the source file name
  * @param line: assert_param error line source number
  * @retval : None
  */
void assert_failed(u8* file, u32 line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}
#endif

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
關閉

站長小叮嚀上一條 /1 下一條

禁閉室|手機版|連繫我們|痞酷網電子技術論壇

GMT+8, 2024-3-29 09:41 AM , Processed in 0.044487 second(s), 11 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.