完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
大家好,我是前软件工程师(MSC),刚刚加入PIC社区的原因如下:我一直与Ralph Baer建立了第一个家庭视频游戏控制台(Brown Box)。在2003,拉尔夫用PIC18F48复制了Brown Boxes的复制品来复制老的行为。基于晶体管的硬件可以像1968一样玩游戏。与此同时,更强大的PIC出来了,视频移到了HD。由于担心那些有价值的棕色盒子复制品的未来,我把代码扔掉,希望能模拟它,看看它是如何工作的,并改进一些方面。H作为播放器(桨)运动,并且生成HDMI视频以与现代屏幕更兼容。问题是,我不能访问源代码(虽然它可能是)并且必须处理二进制。第一次尝试,我用一个便宜的PIC K150板来读取18F445并尝试运行COD。E(如果这个想法绝对不能导致某些东西,我就买不起更昂贵的实验套件)。我的第一个问题是K150生成的HEX文件是否与现有软件兼容。如果是这样,我需要一个PIC模拟器,它允许两件事:1)模拟4×4开关矩阵(4输出PI)。ns,4个输入引脚)。这些开关最初启用/禁用硬件电路,以形成特定的游戏:显示/隐藏播放器(桨),播放器与球交互,中央网启用/隐藏等)模拟525线NTSC视频输出,主要来自RA6和可能的2或3个其他引脚(不确定)哪个SOULD驱动一个彩色相位生成器,用来设置固定的背景颜色(如最初设计的)。是否有一个模拟器允许所有这些都使用我的十六进制文件?否则,你将如何尝试模拟代码?我考虑在原始板上运行代码时调试代码,但是这可以允许拆解、修改、组装和上传吗?因此,需要确保我的“K150”HEX文件可以用来将芯片返回到原来配置的情况下麻烦…谢谢,戴维
以上来自于百度翻译 以下为原文 Hello, I'm a former software engineer (MSc) and just joined the PIC community for the following reason: I have been in close touch with Ralph Baer who created the first home videogame console (the Brown Box). In 2003 Ralph made replica Brown Boxes using a PIC18F458 to replicate the behavior of the old transistor-based hardware to play the games as they did in 1968. In the meantime, more powerful PIC came out and video moved to HD. Being worried about the future of those valuable Brown Box replicas, I dumped the code in the hope to simulate it to see how it code works, and improve some aspects such as player (paddles) motion, and generate hdmi video to be more compatible with modern screens. The problem is, I can't access the source code yet (although it may be possible) and have to deal with the binary. For a first try, I used a cheap PIC K150 board to read the 18F458 and try running the code (I wouldn't afford a more expensive lab kit if the idea can definitely not lead to something). My first question is whether the hex file generated by the K150 is compatible with existing software. If so, I need a PIC a simulator which allows two things: 1) Simulate a 4 x 4 switch matrix (4 output pins, 4 input pins). Those switches originally enabled/disabled hardware circuits in order to form a specific game: display/hide a player (paddle), player vs ball interraction, central net enabled / hidden, etc. 2) Simulate a 525-line NTSC video output, mainly from RA6 and possibly 2 or 3 other pins (not sure) which should drive a color phase generator used to set a fixed background color (as originally designed). Is there a simulator that allows all this using my hex file ? Else, how would you try to simulate the code ? I thought about debuging the code while running on the original board, but can this allow disassembling, modifying, assembling and uploading ? Hence the need to make sure my "K150" hex file can be used to put the chip back to original config in case of trouble... Thanks, David |
|
相关推荐
19个回答
|
|
|
它应该是。HEX文件遵循英特尔标准。PIC18F芯片使用简单的8位WoRDS(而不是PIC16F芯片所需的双字),所以没有技巧。MPLAB8和MPLABX中的模拟器只模拟PIC,而不是外部设备,所以可能不会做您想要的。Proteus可能。http://www. LabCist.com /我从来没有使用过它,所以不能肯定。我的建议是在真实的硬件上运行它。在PIN 40RB6/PGC上的PI740RB6/PGC在PIN 39是如果,然后拿起一个PICTIT3程序员/调试器(大约47美元从Microchip直接,或更便宜的克隆在易趣网上),你可以调试芯片在电路中。你根本不需要K150。
以上来自于百度翻译 以下为原文 It should be. Hex files follow the Intel standard. PIC18F chips use simple 8 bit woirds (not the double words that PIC16F chips required), so there's no tricks. The Simulators in MPLAB8 and MPLABX only simulate the PIC, not external devices, so probably won't do what you want. Proteus might. https://www.labcenter.com/ I've never used it, so can't be sure. My suggestion would have been to run it on real hardware. Does that board keep the programming pins free? RB7/PGD on pin 40 RB6/PGC on pin 39 If yes, then pick up a PICkit3 programmer/debugger (about $47 from Microchip direct, or cheaper clones on eBay), and you can debug the chip in circuit. You won't need the K150 at all. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
谢谢你的回答!K150是一个“没有知识的第一次尝试”:“复制BROXN盒有一个带3根线的以太网母插头。在检查原理图后,我看到在开关矩阵中使用PIN 39和40:32-40作为输出,33-36作为输入,因此在每个输入/输出之前有一个4x4矩阵和一个二极管。以太网插头转到VPP/GND/39/40,所以我假设我可以在真正的硬件上使用一个除错器,因为没有一个开关将PIN 39和40连接到任何地方。问题是,我能做什么,并且有可能以这种方式容易地更新代码吗?此外,我能使用更快的PIC来允许更多的执行和提高视频清晰度吗?据我所知,程序通过RAM缓冲器生成扫描线,每个扫描线都有一个预定义的像素数,这些像素是根据PIC所允许的。因此,使用更快和更强的PIC,每扫描线的像素数越多。这只是以后的想法。谢谢,戴维
以上来自于百度翻译 以下为原文 Thanks for your answers ! The K150 was a "first try without knowledge" :) The replica Broxn Box has an ethernet female plug with 3 wires. After checking the schematic I see that pins 39 & 40 are used in the switch matrix: 37-40 as outputs and 33-36 as inputs hence a 4x4 matrix with one diode before each input / output. The ethernet plug goes to Vpp / Gnd / 39 / 40 so I presume I can use a debuger this way on the real hardware as far as none of the switches connect pin 39 and 40 anywhere. The questions are, what will I be able to do and is it possible to update the code easily this way ? Moreover: could I be able to use a faster PIC to allow more execution and improve video definition ? So far as I understand, the program generates the scanlines through a RAM buffer and each scanline has a predefined number of pixels which was set according to what the PIC could allow. Hence a larger number of pixels per scanline using a faster and stronger PIC. That's just an idea for later. Thanks, David |
|
|
|
|
|
虽然模拟器不模拟PIC外部的设备,但它提供SCL支持。SCL是一种类似于VHDL的脚本语言,可以用来在模拟的PIC设备中注入你想要的任何值,无论你想要什么时候。换句话说,您可以使用SCL自己建模外部设备。SCL上的文档是用MPLAB X.装运的,您可以在DOCS子文件夹中找到它。
以上来自于百度翻译 以下为原文 While the simulator does not model devices external to the PIC, it provide SCL support. SCL is a VHDL-like scripting language that can be used to inject whatever values you want into the simulated PIC device, at whatever times you'd like. In other words, you can use SCL to model the external devices yourself. Documentation on SCL is shipped with MPLAB X. You can find it in the docs sub-folder. |
|
|
|
|
|
据我所知,我可以使用MPLAB ICD3套件,它具有以太网插头来驱动PIC,以便使用原始硬件。但是,皮卡似乎没有使用相同的。是否有更便宜的适配器或ICD3是唯一的选择?此外,ICD3软件和驱动程序在Windows 10下工作吗?谢谢,戴维
以上来自于百度翻译 以下为原文 So far as I understand, I can use the Mplab ICD3 kit which has the ethernet plug to drive the PIC in order to use the original hardware. However, the PicKit don't seem to use the same. Is there a cheaper adaptor or is the ICD3 the only option ? Also, does the ICD3 software and driver work under Windows 10 ? Thanks, David |
|
|
|
|
|
它们是相同的信号,只是一个不同的连接器。很容易做一个适配器。如前所述,你可以使用PK2或PK3.Y。回答你之前的问题,这些调试器允许你编程芯片,但也可以单步执行代码并检查所有内存,并在指令地址上用硬件断点运行全速。
以上来自于百度翻译 以下为原文 They are the same signals, just a different connector. It's easy to make an adaptor. As mentioned, you can use a PK2 or PK3. Yes. Answering your earlier questions, these debuggers let you program the chip, but also single step code and examine all memory, and run full speed with a hardware breakpoint on an instruction address. |
|
|
|
|
|
我想PK3更好吗?正如上面所建议的,我做了一个快速的搜索,找到了几个,从最初的微芯片到大约50美元到几个克隆,大约10美元。我想他们都是这样工作的吗?其中一个甚至还有一个额外的40针ZIF插座(不确定我是否需要这个,如果我可以从原板转储)。
以上来自于百度翻译 以下为原文 I suppose the PK3 is better ? As suggested above I made a quick search and found several, from the original Microchip at around $50 to several clones for about $10. I suppose they all work the same way ? One of these even comes with an additional 40-pin ZIF socket (not sure I'll ever need this if I can dump from the original board). |
|
|
|
|
|
一般来说,PK3是更好的。PK2已经完全逆向工程,所以一些人已经编写软件来控制它来编程它从未设计过的芯片。PK2不受MIDABX(当前IDE)的支持。PK3是。
以上来自于百度翻译 以下为原文 In general yes the PK3 is better. The PK2 has been fully reverse engineered, so some people have written software to control it to program chips it was never originally designed for. The PK2 is NOT supported by MPLABX, the current IDE. PK3 is. |
|
|
|
|
|
我检查了我的复制品棕色盒子板,画出了4×4开关矩阵的粗略草图。实际上,当16个开关中没有一个时,PIC的引脚39和40仍然连接到另一个未用的4针线性插头,这恰好是一个ICSP连接器:ICSP:1 VPP(1)+10K到电路板。5V(来自电池+ 7805)ICSP:2 PGD(40)ICSP:3 PGC(39)ICSP:4 GNDI我应该考虑一个定制的PICTIT3适配器线如下:ICSP:1到PK3-1(/MCLR+VPP)ICSP:2到PK3:4(PGD+ICSPDAT)ICSP:3到PK3:5(PGC+ICSPLK)ICSP:4到PK3:3(VSS),如果我错了请纠正我,但是使用调试模式B。OARD将由皮卡3而不是电池+调节器供电?有电流限制吗?或者我应该用电池给电路板供电,而不把P1连接到拾取器3的VSS上?谢谢!
以上来自于百度翻译 以下为原文 I checked my replica Brown Box board and drew a crude sketch of the wiring of the 4 x 4 switch matrix. In fact when none of the 16 switches are ON, pins 39 and 40 of the PIC are still connected to another unused 4-pin linear plug, which happens to be an ICSP connector: ICSP:1 Vpp (1) + 10K to board's 5V (from batteries + 7805) ICSP:2 PGD (40) ICSP:3 PGC (39) ICSP:4 Gnd Should I consider that a custom PicKit3 adaptor wires as follows: ICSP:1 to PK3:1 (/MCLR + Vpp) ICSP:2 to PK3:4 (PGD + ICSPDAT) ICSP:3 to PK3:5 (PGC+ ICSPCLK) ICSP:4 to PK3:3 (Vss) Correct me if I'm wrong, but to use the debug mode the board will be powered by the PicKit 3 instead of the batteries + regulator ? Is there a current limit ? Or should I power the board with the batteries and not connect P1 to Vss of the PicKit 3 ? Thanks ! |
|
|
|
|
|
嗨,Power从匹克特3提供的最大限制为30毫安。板也可以由自己的电源供电时,编程或调试与皮卡3。有一个设置在MPLAB无论目标板或皮卡3是提供Power.MPLAB将抱怨如果目标功率没有检测到。在预期的情况下,Vdd仍然应该连接在板和皮卡3之间,PK3:2在PigIt 3中有电压电平转换器应该连接到目标电源电压,可以通过不连接VDD来欺骗,并且设置拾取3来提供电源,与板一样的电压。迈西尔
以上来自于百度翻译 以下为原文 Hi, Power supplied from PICkit 3 is limited to 30 mA maximum. Board may just as well be powered by it's own power supply when Programming or Debugging with PICkit 3. There is a setting within MPLAB whether Target board or PICkit 3 is to supply Power. MPLAB will complain if Target power is not detected when expected. Vdd should still be connected between Board and PICkit 3, PK3:2 there are voltage level translators in PICkit 3 that should be connected to Target supply voltage. It is possible to cheat, by not connecting Vdd, and set PICkit 3 to supply power, same voltage as board. Mysil |
|
|
|
|
|
谢谢。这意味着4引脚ICSP插头缺少连接板+5V到PK3:2的引脚。我猜在使用较老的MPLAB-ICD3时,这种连接不是必需的。另外,我想知道如何在没有丢失连接的情况下调试板。
以上来自于百度翻译 以下为原文 Thanks. That means the 4-pin ICSP plug is missing a pin connecting the board's +5V to PK3:2 . I guess that connection wasn't necessary when using the older MPLAB-ICD3 ? Else I wonder how the board could have been debuged without a missing connection ! |
|
|
|
|
|
如上文所解释的作弊:可以通过不连接VDD来欺骗,并设置拾取3提供电源,与板相同的电压。迈西尔
以上来自于百度翻译 以下为原文 By cheating as explained above: It is possible to cheat, by not connecting Vdd, and set PICkit 3 to supply power, same voltage as board. Mysil |
|
|
|
|
|
好的,但到目前为止,我还没有给电路板供电,看看它画了多少电流。
以上来自于百度翻译 以下为原文 Ok but so far I haven't powered the board to see how much current it draws. |
|
|
|
|
|
PK3被设计为使用VDD连接来感测驱动PGD和PGC的电压电平。如前所述,您可以通过告诉它提供电源(但不连接VDD)和指定与您的板使用相同的VDD电压来欺骗。编辑:双检查到4针连接器的接线。OsWord没有连接到Vdd,但是PK3和ICD3都必须与MCLR有连接。
以上来自于百度翻译 以下为原文 The PK3 is designed to use the Vdd connection to sense the voltage levels to drive PGD and PGC with. As mentioned, you can cheat by telling it to supply power ( but not connecting Vdd) and specifying the same Vdd voltage as your board uses. Edit: Double check the wiring to that 4 pin connector. It's possible to work without a connection to Vdd, but both PK3 and ICD3 must have a connection to MCLR. |
|
|
|
|
|
这里是ICSP插头的基本示意图。请注意,我的原理图质量不好,没有完成。我还没有检查板的当前抽签。不确定它是否小于30Ma,最好用电池供电。
以上来自于百度翻译 以下为原文 Here's the basic schematic of the icsp plug. Note that my schematic is poor quality and not complete. I haven't checked the current draw of the board. Not sure if it's less than 30mA. Better having it powered with the batteries. Attached Image(s) |
|
|
|
|
|
好的,正如你第一次提到的,它连接到GND、PGC、PGD和VPP(这是MCLR)。你需要使用上面提到的“欺骗”来伪造VDD,所以你不能从PK2/3提供电源。(或者你可以添加一个线来创建第五连接)。
以上来自于百度翻译 以下为原文 ok, so as you first mentioned, it's connected to gnd, PGC, PGD, and VPP (which is MCLR). You need to use the mentioned "cheat" to fake Vdd, so you can't supply power from the PK2/3. (or you could add a wire to create the 5th connection). |
|
|
|
|
|
我用PK3成功地卸载了PIC(在FF中只有一个不同的部分,其余的似乎与PUP150所产生的相同)。我想知道如何在特定的上下文中模拟代码:模拟游戏选择的4×4开关矩阵的可能性。端口RB4…7用于选择四组ON/OFF开关(每一个都跟随二极管)中的一个,以及在二进制输入中使用的端口RB0…3,以读取这些开关的状态。这可以是一个脚本,比如“当RB3=1(RB0=1,RB1=0,RB2=1,RB3=0)。-设置0~5V模拟电压到端口AN0…7的可能性,以设置玩家的X/Y位置和球英语。这将是有趣的是能够改变这些电压在仿真过程中定位球员。-最重要的是:模拟NTSC视频输出。该视频电路由彩色相位发生器(3 D触发器)构成,它采用OSC2的14318MHz信号,并将其除以4,得到NTSC中使用的3.58MHz。彩色相位发生器具有最后两个触发器的D和Q的5个输出。这些输出用于产生4个单独的颜色+使用电阻分压器突发。另外两个电阻分压器产生黑色和白色的电压。这7行(总共6种颜色+突发)进入模拟多路复用器。RD0、RD1和RD2进入多路选择器的选择线。我真正想要的是找到一个仿真器来产生代码生成的视频(至少在非实时中获得一些帧),当然设置输入来选择游戏并显示玩家。谢谢。
以上来自于百度翻译 以下为原文 I successfully dumped the PIC using PK3 (only difference is a whole section at FF, the rest seems identical of what the PICK150 produced). I would like to know how I could emulate the code under a specific context: - the possibility of simulating the 4 x 4 switch matrix for the games selection where ports RB4...7 are used to select one of the four groups of ON/OFF switches (each followed by a diode), and ports RB0...3 used in binary input to read the states of those switches). This could be a script, like "WHEN RB3=1 (RB0=1,RB1=0, RB2=1, RB3=0). - the possiblity of setting a 0-5V analog voltage to ports AN0...7 to set the players X/Y location and ball english. It would be interesting to be able to change these voltages during emulation to locate the players. - most importantly: simulating the NTSC video outout. The video circuit is made of a color phase generator (3 D-type flip-flops) which takes the 14.318MHz signal at OSC2 and it divides it by 4 to get 3.58MHz used in NTSC. The color phase generator has 5 outputs from D and /Q of the last two flip-flops. Those outputs are used to generate 4 individual colors + burst using resistor dividers. Two other resistor dividers generate the voltages for colors black and white. Those 7 lines (total 6 colors + burst) go to an analog multiplexer. RD0, RD1 and RD2 go to the multiplexer's selection lines. What I would really like is to find an emulator to produce the video generated by the code (at least getting some frames even in non-realtime) and of course set the inputs to select the games and show the players. Thanks. |
|
|
|
|
|
嗨,所有0xFF的部分是未编程/未使用的闪存,所以当你有硬件时,你可以修改或扩展程序,为什么要效仿?我认为恢复源代码可能更有趣,以便能够重建程序。如果可以以某种方式访问原始源代码,那将是最好的。否则,将代码拆解为汇编源,可能用于重建程序。关于拆卸/反编译程序,但是从拆解中恢复可理解的和可理解的源代码,可能是大量的手工工作,即使你找到一个工具来生成一个分解指令的文件。迈西尔
以上来自于百度翻译 以下为原文 Hi, The section of all 0xFF is flash memory that is unprogrammed / unused, so may be available to modify or expand the program Why do you want to emulate, when you have hardware? I think it may be more interesting to recover the source code, in order to be able to rebuild the program. If you could in some way get access to original source, it would be best. Otherwise disassembling the code to assembly source, that may be used to rebuild the program. There have been some threads about disassembly /decompiler, but recovering sensible and understandable source code from disassembly, may be a lot of manual work, even if you find a tool to produce a file of disassembled instructions. Mysil |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1121浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 20:57 , Processed in 1.141893 second(s), Total 110, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1906