完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
请帮助!我正试着用PIC16F67和一个3位7段共阳极显示器来制作秒表。我需要代码和PIN配置。我想把这个放在我的摩托车模拟车速里程表里。这里我使用3位7S,因为秒表只需要高达9小时,因为我几乎骑不动。我的摩托车一小时。我目前的东西是PIC16F67 6*BC57 7晶体管* 3位7段显示*电阻AM使用XC8编译器。
以上来自于百度翻译 以下为原文 PLEASE HELP! I am trying to built a stopwatch using pic16f676 and a 3 digit 7 segment common anode display. i need the code and pin configuration.I am thinking of putting this inside my motorcycle analog speedometer.Here i use 3 digit 7S because the stopwatch needs to count only upto 9 hrs because i barely ride my motorcycle for an hour. the things i've currently are * PIC16F676 * BC557 transistors * 3 digit 7 segment display * resistors I am using XC8 compiler. |
|
相关推荐
19个回答
|
|
|
对不起,我帮不上忙,但我有一个关于你的目的项目的问题。你为什么要把秒表连接在车速表上?你的目标是测量你在摩托车上花费的时间?谢谢,祝你好运
以上来自于百度翻译 以下为原文 Sorry, I can't help you but I have a question about the of your purpose project. Why do you want connect a stopwatch in your speedometer? Your goal is measurement what time do you spend in your motocycle? Thanks and good luck |
|
|
|
|
|
我不会从那里开始计时应用。PIC16F67 6内部振荡器不是非常精确的(在整个温度范围内的+/- 5%),所以您需要一个晶体,并且PIC16F67中没有足够的引脚用于晶体,7个段,3个数字和一个点火输入。这个最小值是18针PIC。此外,你可能需要在两个部分和数字的晶体管,以获得足够的亮度,使其能够在直射阳光下可见,然后需要添加一个感光器,这样它可以自动昏暗,晚上不要让你眩目。
以上来自于百度翻译 以下为原文 I wouldn't start from there for a timing application. The PIC16F676 internal oscillator isn't very accurate (+/-5% over the full temperature range), so you'll need a crystal, and there aren't enough pins on the PIC16F676 for the crystal, 7 segments, 3 digits and an input for ignition on. The minimum for this would be an 18 pin PIC. Also you'll probably need transistors on both the segments and digits to get enough brightness for it to be visible in direct sunlight, and will then need to add a photosensor so it can dim automatically at night not to dazzle you. |
|
|
|
|
|
是的,我需要知道我花了多少时间骑马…所以…我可以排队我的快速时间表..我已经建立了一个数字电压表使用PIC16F67…所以我从中得到灵感。我认为某种定时器代码可以完成这项工作。
以上来自于百度翻译 以下为原文 Yes I need to know how much time I spend riding....so..I can line up my fast schedule.. l had built a digital voltmeter using pic16f676 ..so I get the inspiration from that. I thought some kind of timer code can do the job. |
|
|
|
|
|
如果目标是从点火开始时计算时间,你就不需要一个“点火”输入,你只需从那个信号中为你的电路供电。我同意,PIC16F66不是一个好的选择。有类似的PIC16F1XXX芯片具有更好的内部振荡器。
以上来自于百度翻译 以下为原文 If the aim is to count time from when the ignition is turned on, you don't need an "ignition on" input, you just power your circuit from that signal. I agree, the PIC16F676 is not a good choice though. There are similar PIC16F1xxx chips with much better internal oscillators. |
|
|
|
|
|
先生,实际上我是个新手。最近我用这个PIC制作了一个伏特计。我得到了代码和电路。它工作得很好。而且我不能访问PIC的不同范围,因为它们在我的地方是不可用的。我通常进口这些东西,并且运输会花费时间。所以,如果我写的代码正确,我可以在同一个电路中闪光。如果PIC不太准确,我可以容忍。谢谢你的建议,希望你能帮上忙。
以上来自于百度翻译 以下为原文 Sir actually I m a beginner.also very recently I made a voltmeter using this pic.I got the code and circuit.it works fine.also I cannot access PIC's of different range as they are not available in my locality.I usually import these things and shipping would take time. So if I write the correct code I could flash it in the same circuit.I can tolerate if the pic is not much accurate. Thanks for your advice.Hoping you would help. |
|
|
|
|
|
如果目标是从点火开始时计算时间,你就不需要一个“点火”输入,你只需从那个信号中为你的电路供电。我同意,PIC16F66不是一个好的选择。有类似的PIC16F1XXX芯片具有更好的内部振荡器。我知道了。通常当我的自行车钥匙在上面时,它指示了N(中性)光。它提供了5V的电源。是否足以发出PIC信号????当中档齿轮发生变化时,灯就会熄灭。
以上来自于百度翻译 以下为原文 If the aim is to count time from when the ignition is turned on, you don't need an "ignition on" input, you just power your circuit from that signal.I agree, the PIC16F676 is not a good choice though. There are similar PIC16F1xxx chips with much better internal oscillators. . I got that.usually when my bike key is on it indicates N (neutral) light glows.it provides a 5v supply.would it be enough to signal the pic??? When the neutral gear is changed light goes off. |
|
|
|
|
|
底线,你有12个I/O要玩。3个数字由7个段需要3个+7=10个引脚来驱动。一个BC55 7是一个可以切换到100mA的PNP晶体管。因此,假设你的7段显示是“公共阳极”,你从一个BC55 7提供每个阳极,并通过串联电阻连接七个阴极引脚。RS到PIC管脚。如果所有7个区段都在上,则每个区段限制为100/7=14mA。PIC引脚可以下沉到20mA最大值,因此14mA可以直接从PIC驱动。(您也可以安全地在200毫安下,允许您从所有I/O引脚组合中下沉或源极)。正向电压可能是2V,所以您的电流限制电阻器将需要(5V - 2V)/ 0.014=214欧姆。尝试200欧姆,因为你将失去电压在BC55 7和PIC引脚。所以,你的软件将需要把BC57 7晶体管一次一个,通过使他们的基脚低的顺序。这将使你的三个数字中的一个反过来。同时,你需要为你想要开启的每一个段驱动七个阴极管脚。你需要在整个序列中运行至少25秒,以避免可见的闪烁。注意,通过你的LED段的峰值电流。将是14Ma,但平均将有一点以下第三的这个,所以大约4.5Ma。正如伊恩所提到的,这可能不足以在日光下看到。你需要一些NPN晶体管,也许会把12V电源切换到线段以使其更亮。这将避免在你的PIC输入中应用12V。(你的摩托车的电池是12V还是6V?)
以上来自于百度翻译 以下为原文 Bottom line, you have 12 I/Os to play with. 3 digits by 7 segments requires 3+7 = 10 pins to drive. A BC557 is a PNP transistor that can switch up to 100mA. So , assuming your 7-segment display is "common anode", you supply each anode from a BC557, and connect the seven cathode pins via series resistors to PIC pins. If all 7 segments are on, you're limited to 100/7 = 14mA per segment. A PIC pin can sink up to 20mA max, so 14mA is ok to drive directly from the PIC. (You're also safely under the 200mA total you are allowed to sink or source from all I/O pins combined.) Assuming they are red LEDs, the forward voltage is likely to be 2V, so your current limiting resistors will need to be (5V -2V) / 0.014 = 214 ohms. Try 200ohms, as you will be losing voltage across the BC557 and the PIC pins. So, your software will need to turn the BC557 transistors on one at a time, by bringing their base pins low in sequence. This will enable one of your three digits in turn. At the same time, you need to drive the seven cathode pins low for each segment you want to turn on. You will need to run through the whole sequence at least 25 times a second to avoid visible flicker. Note, the peak current through your LED segments will be 14mA, but the average will be a little under a third of this, so about 4.5mA. As Ian mentioned, this may not be enough to see in daylight. You would need some NPN transistors, and maybe switch the 12V supply to the segments to make it brighter. This would take care to avoid applying 12V to your PIC inputs. (Is your motorbike's battery 12V or 6V?) |
|
|
|
|
|
|
|
|
|
|
|
我的摩托车的电池是12V。我可以使用1H或2复位。但问题是显示器的亮度。我正在考虑使用L7805稳压器,提供恒定的5V和一些XXMA电流,这是必要的如何做代码…我知道C,但只能做中间阶段。这里我是STUC。K.还有,什么是Hto7S-()函数和DISPLAY(),是使用7段显示器的程序??
以上来自于百度翻译 以下为原文 My motorbike's battery is 12v. I could use 1H or 2 reset.But the problem is with brightness of the display.I am thinking of using L7805 regulator that supply constant 5v and some xxmA current which would be necessary How to do the code...I know C but could do only an intermediate stage..here I m stuck. Also...what is HTO7S() function and Display() that are in programs using 7segment displays?? |
|
|
|
|
|
由于PIC引脚的短缺,我建议使用一个747 A BCD到7段解码器驱动程序。它将减少段控制引脚的数量从7到4,并且可以下沉40Ma,只有0.4V的下降,所以让你平均每三段多路复用显示的平均值为133Ma(不是7LS47 -这只对下沉24Ma来说是好的)。只有7个引脚用于三位数字显示,这就留下了PIC。16F67的5个引脚免费,其中之一是只输入/ MCLR/RA3引脚。在OSC1/RA5和OSC2/RA4上放置一个晶体,用于精确的计时,并且你仍然有足够的引脚来实现亮度控制、点火感测和按钮或其他开关来控制它的光电传感器。在走下这条路线之前,最好看看显示器是否亮。H的电流为13Ma每段通过玻璃在阳光直射下可见(只要用电池把它挂上一个电阻器就可以为每一个你想要发光的部分设置电流)。
以上来自于百度翻译 以下为原文 Due to the shortage of PIC pins I suggest using a 7447A BCD to 7 segment decoder driver. It will reduce the number of segment control pins from 7 to 4, and can sink 40mA with only 0.4V drop so will let you average 13.3mA per segment for a three digit multiplexed display (not 74LS47 - that's only good for sinking 24mA). With only 7 pins used for a three digit display, that leaves the PIC16F676 with 5 pins free, one of which is the input only /MCLR/RA3 pin. Put a crystal on OSC1/RA5 and OSC2/RA4, for accurate timekeeping and you've still got enough pins to implement a photosensor for brightness control, ignition sense and a pushbutton or other switch to control it. Before going down this route it would be advisable to see if the display is bright enough with a current of 13mA per segment to be visible through glass in direct sunlight (just hook it up to a battery with a resistor to set the current for each segment you want to light). |
|
|
|
|
|
我打算建议得到一个LED时钟模块,它也许可以被PIC控制,甚至被用来指示运行时间。但是我也有这样的想法,你可以使用一个三位数的LED电压表模块来设置0~99 99 VDC,并使用PIC来产生PWM信号COR。响应运行时间。这只需要从PIC到DVM的一根电线。因为5V的供应,你会被限制在4.99个小时,但这就足够了。如果没有,在12V的电源上添加一个增益为2的运算放大器。HTPSP//www-BangGo.COM/0Y56-ICH-DC-010302V-3-Wiel-RealValmier-DigalDePalPo-PANEL-P932666HTML?RMDSDS =搜索大约4美元。
以上来自于百度翻译 以下为原文 I was going to suggest getting an LED clock module which perhaps can be controlled by the PIC, or even used by itself to indicate running time. But I also got the idea that you might be able to use a three-digit LED voltmeter module set up for 0-9.99 VDC, and use the PIC to generate a PWM signal corresponding to running time. That would only require one wire from the PIC to the DVM. You'd be limited to 4.99 hours because of the 5V supply, but that should be enough. If not, add an op-amp with gain of 2 on the 12V supply. https://www.banggood.com/0_56-Inch-DC-0-1030200V-3-Wire-LED-Voltmeter-Digital-Display-Panel-p-932966.html?rmmds=search Only about $4. |
|
|
|
|
|
这有一个问题,你需要准确地从0.59跳到1,在更高的时间里同样需要。你会得到一些类似的东西:0.57…0.98…0.99…1,或者0.59。0.60…0.61…1.02。即使是0.01V偏移B ---它的上升,这只是0.2%的5V电源。
以上来自于百度翻译 以下为原文 That has the problem that you need to jump from 0.59 to 1.00 accurately, and the same for the higher hours. Odds are you'll get something like: 0.57 .. 0.98 .. 0.99 .. 1.00, or 0.59 .. 0.60 .. 0.61 .. 1.02. Even 0.01V offset b---ers it up and that's only 0.2% of the 5V supply. |
|
|
|
|
|
你可以用0到499分钟,这是8.31小时。或者习惯于小数小时,2.25小时而不是2:15以H:mm格式。或者得到一个LED时钟套件:HTTPS://wwwangBoo.com/电子-diy088nCH-do-Matrx-Del-Digi-Eng-电子-CROK-K-CAR-CROK-5V-MCIRO-USP-POWER -P11248 43.HTML.RMDSDS=搜索HTTPS://wwwBangGo.COM/6数字电子-CPLACK DY-KIT-PARS组件-9V12V-P926716.HTML?RMDSDS =搜索仅3美元!
以上来自于百度翻译 以下为原文 You could just use 0-499 minutes which is 8.31 hours. Or get used to fractional hours, with 2.25 hours instead of 2:15 in H:mm format. Or get an LED clock kit: https://www.banggood.com/Electronic-DIY-0_8inch-Dot-Matrix-LED-Digital-Electronic-Clock-Kit-Car-Clock-5V-Mciro-USB-Powered-p-1124843.html?rmmds=search https://www.banggood.com/6-Digital-LED-Electronic-Clock-DIY-Kit-Parts-Components-9V12V-p-926716.html?rmmds=search Only $3! |
|
|
|
|
|
我可以使用司机。我会检查零售店的部件是否可用或在线购买。我需要水晶。亮度很好。我的车速表有一些倾斜角度。因此,提供更多的倾斜到速度里程表段将纠正这个问题。
以上来自于百度翻译 以下为原文 I can use the driver .l will check the component avilablity on retail shop or buy it online. I have the crystal needed. Brightness is good.my speedometer has some angles of inclination. So..providing more inclination to the segment inside speedometer would correct the problem. |
|
|
|
|
|
我有你所建议的电压表模块,但是如何进行。你能详细地张贴吗??
以上来自于百度翻译 以下为原文 I have the voltmeter module that you have suggested but how to proceed. Can you post in detail?? |
|
|
|
|
|
我同意伊恩的观点。电压表的解决方案不会很好,因为你需要非常精确的电压控制才能使它平稳地从0.59跳到1.00。
以上来自于百度翻译 以下为原文 I would agree with Ian.M that the voltmeter solution wouldn't work very well, as you would need VERY precise voltage control to get it to jump smoothly from 0.59 to 1.00. Bottom line, it just wouldn't happen reliably. |
|
|
|
|
|
你只需要设置一个PWM输出和调整占空比从0到100%的0至5伏直流电。这将给出一个0到500的读数,可以是分钟,或者你可以为0到5.00小时增加小数点。可以使用从0到1023递增的整数变量,用于10位PWM。对于500分钟的显示,它将每500/1024=0.488分钟或29.3秒递增。在5小时内,每5.00/1024=0.00488小时(或17.57秒)。
以上来自于百度翻译 以下为原文 You just have to set up a PWM output and adjust duty cycle from 0 to 100% for 0-5 VDC. That will give a reading of 0-500 which could be minutes, or you can add a decimal point for 0-5.00 hours. You can use an integer variable incremented from 0-1023 for 10 bit PWM. For the 500 minute display, it would increment every 500/1024 = 0.488 minutes or 29.3 seconds. For the 5.00 hours it would increment every 5.00/1024 = 0.00488 hours (or 17.57 seconds). |
|
|
|
|
|
关键是你可以只显示分钟,而不是小时和分钟。这可能是完全好的,由OP决定是否可以接受。
以上来自于百度翻译 以下为原文 The key being that you can only display minutes, not hours and minutes. That may be perfectly fine, it's up to the OP to decide if that's acceptable. |
|
|
|
|
|
最坏的情况是:如果你不能提供TTL 724A,但只能提供一个具有较小电流能力的类似解码器,你可以为每个段添加一个晶体管来缓冲它并允许更多的驱动器。如果它的活动低,你可以使用PNP发射器追随者。如果它的有源高电平(例如4028),你可以使用带有基极电阻的NPN晶体管。两者都会给你比你的显示器需要更多的当前能力。PNP发射器追随者引入额外的电压下降,所以你不能使用蓝色的LED从5V -红色,黄色或绿色将是好的,或者你可以平移数字驱动器,使LED可以从HIHT电压运行,让你使用蓝色的。
以上来自于百度翻译 以下为原文 Worst case: If you can't source the TTL 7447A, but can only source a similar decoder with lesser current capability, you can add a transistor for each segment to buffer it and allow more drive. If its active low, you can use PNP emitter followers. If its active high (e.g. 4028, ) you can use NPN transistors with base resistors. Either will give you more current capability than your display needs. The PNP emitter followers introduce extra voltage drop, so you wouldn't be able to use blue LEDs from 5V - red, yellor or green would be OK, or you could level shift the digit drivers so the LEDs could be run from a hihrt voltage to let you use blue ones. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 02:16 , Processed in 1.570223 second(s), Total 110, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
9967