完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
您好,我使用2个PIC16F690通过SPI发送数据。我使用了由Microchip SPI.H和SPI.C提供的指南来制作我自己的SPI处理器功能。为了知道我的代码实际上是闪现的,我已经在同一个引脚上的2个LED上连接了相同的引脚RC4。EY使用相同的电压线,LED都打开。目标是让奴隶向主人发送数据,然后让主人在数据中读取并显示数据。然而,当我在主PIC上闪存软件时,我进入模拟器,验证通过UTART接收到的数据是正确的,而没有打印出来。当我从模拟器中停止调试器时,它会把我带到函数CARYGGSPIHANDLREAR读()函数中的SPIHandler .c文件中,特别是BF位是否被设置的循环条件。代码的片段是卡住的:(SSPSTATbits.BF)!因此,似乎BF从来没有被设置在第一位,我假设我的发送函数从奴隶那里出了什么问题,但是我不确定到底是什么。我知道这可以用中断来完成,但是我想让它先用轮询来工作。我使用RA2作为连接到SSNBAR引脚(RC6)的从属选择线。SCK(RB6)引脚连接在一起的两个微型和SDI引脚(RB4)的主人是连接到SDO(RC7)从奴隶。同样地,SDO(RC7)的主从连接到SDI(RB4)的奴隶。电压是5V,但我也尝试了3.3V,它仍然不工作。唯一的区别是LED的亮度更高,因为目标是让奴隶向主人发送数据,并有主人发送的字符发送,奴隶做SPI发送,而主人做SPI读取。最初,我有2个单独的功能,用于发送和读取,如Microchip教程所做的,但是正如其他人建议的,启动事务时,必须加载SpBuf,这是写命令,因此读和写现在一起被称为CARYGGX传输(CHAR)函数。恩,我仍然无法显示通过SPI发送的字符,所以我现在不知道从何处去。Pleasehelp,非常感谢您的建议。
SLav.txt(1.06 KB)-下载51次SpixHANDLR.C.TXT(7.77 KB)-下载了59次SpIMPHANDLRIEH.H.TXT(1.61 KB)-下载了55次 以上来自于百度翻译 以下为原文 Hello, I am using 2 pic16f690 to send data via SPI. I have used the guide provided by microchip spi.h and spi.c to make my own SPI handler functions. To know that my code is actually being flashed, I have connected 2 LED's on both pics on the same pin, RC4. When I flash either of the micro's, since they're using the same voltage line, both LEDs turn on. The goal is to get the slave to send data to the master, then have the master read in that data and display it. However, when I flash the software on the master pic, then I go into the simulator to verify the data being received is correct via UART using printf, nothing gets printed. When I stop the debugger from the simulator, it takes me to SPIHandler.c file in the function char_g_SPIHandler_Read() function, specifically the loop condition of whether the BF bit is being set. The snippet of code is when stuck is: while(SSPSTATbits.BF != SPIHANDLER_SSPSTAT_STATUS_READY); So, it seems like BF is never being set in the first place, which I presume something is wrong with my send function from the slave, but I am not sure what exactly. I am aware that this could be done using interrupts but I want to get it working with polling first. I am using RA2 as the slave select line which connects to the SS_bar pin (RC6). SCK (RB6) pins are connected together on both micros and SDI pin (RB4) of master is connected to SDO (RC7) on slave. Likewise, SDO (RC7) of master is connected to SDI (RB4) of slave. Voltage is 5V but I've also tried 3.3V and it still doesn't work. Only difference is that LED's are more bright which is expected. Since the goal is to get the slave to send data to the master and have the master display that character being sent, the slave does the spi send and the master does the spi read. Originally, I had 2 separate functions for send and read as done by the microchip tutorial, but as suggested by others, to initiate the transaction, you must load SSPBUF which is the write command, so the read and the write are done together now in a function called char_g_transmission(char). Even then, I still can't display the character sent via SPI so I don't know where to go from here now. Please help, any suggestions are greatly appreciated. Attachment(s) master.txt (1.56 KB) - downloaded 63 times slave.txt (1.06 KB) - downloaded 51 times SPI_Handler_C.txt (7.77 KB) - downloaded 59 times SPI_Handler_H.txt (1.61 KB) - downloaded 55 times |
|
相关推荐
19个回答
|
|
|
你使用模拟器还是调试器?模拟器不会与你的真实硬件交互。我怀疑这会在真实的硬件中运行,因为你丢失了几乎所有的配置设置。至少你需要设置从哪个时钟运行。
以上来自于百度翻译 以下为原文 Are you using the simulator, or the debugger? The simulator will not interact with your real hardware. I doubt this will run in real hardware, as you are missing almost all of the CONFIG settings. At the very least you need to set which clock to run from. |
|
|
|
|
|
我使用模拟器,并点击调试主要项目,因为它是在UART IO选项。我不想购买额外的硬件来打印数据,比如LCD或硬件调试器(如果是这样的话)。是否有不同的方法来测试不使用额外的硬件?我只是想看看这是否有效,因为我仍然不知道它是否,而且已经很长时间试图使这工作。我不知道模拟器没有和真实的硬件交互。我也不知道。我认为它们是可选的。我将添加它们,但我仍然需要一种方法来测试这一点。
以上来自于百度翻译 以下为原文 I am using the simulator and hit debug main project since it is in UART IO Options. I don't want to buy additional hardware to get the data to print, like an LCD or a hardware debugger (if that's one of the ways). Is there a different way to test that doesn't use additional hardware? I just want to see if this works since I still don't know if it does and it's been a long time trying to get this to work. I didn't know the simulator didn't interact with real hardware. Also, the pragma configurations are a requirement? I didn't know that either. I thought they were optional. I will add them but I still need a way to test this. |
|
|
|
|
|
你没有提到你用什么程序来把程序“闪存”到PIC中。它是PICTIT3还是ICD3?(它们都是调试器)
以上来自于百度翻译 以下为原文 You have not mentioned what programmer you are using to "flash" the program into the PIC. Is it a PICkit3 or an ICD3? (They are both debuggers also) |
|
|
|
|
|
我使用的是PICTIT3,但如果需要的话,也可以有皮卡2。
以上来自于百度翻译 以下为原文 I am using the pickit3 but also have a pickit2 readily available if its ever needed. |
|
|
|
|
|
在这种情况下,您可以使用PK3作为调试器。您需要在调试模式下对芯片进行编程,而不是运行模式。请确保您的开发工具设置为“PICTIT3”,而不是“模拟器”。您使用MPLABX还是MPLAB8?
以上来自于百度翻译 以下为原文 In that case, you can use the PK3 as a debugger. You need to program the chip in debug mode, not run mode. Make sure your development tool is set to "PICkit3", not "Simulator". Are you using MPLABX, or MPLAB8? |
|
|
|
|
|
我使用MPLAB X IDE V4.00。所以我尝试设置我的时钟来测试这个使用调试器。然而,我遇到了一个问题!我不小心把HS当作FoSC,我认为它只适用于外部高速频率(如果我错了,请纠正我)。我真正想要做的是使用内部振荡器,它既可以是:1μ.PrimaMaungFiCc=IncCLK//振荡器选择位(ItoSc振荡器:RA4/OSC2/CKOUT引脚上的CKKOUT函数,RA5/OSC1/CKIN上的I/O函数)2。CIO振荡器:在RA4/OSC2/CKOUT引脚上的I/O功能,RA5/OSC1/CKIN上的I/O功能不确定2个I应该使用哪一个。不管怎样,当我尝试将配置位更改为其中一个时,我得到以下错误:Mist.C:15:错误:(1389)尝试用CIDCLK(是HS)(908)退出状态=1重新编程配置设置“FoSC”,我被Hs卡住了,我不能重置它。现在,我的LED都没有打开,因为我闪耀两个PIC的错误配置位。如何设置正确的,哪一个是正确的?
以上来自于百度翻译 以下为原文 I am using MPLab X IDE v4.00. So I tried setting my clock to test this using the debugger. However, I ran into a problem! I accidentally put HS as FOSC, which I think is for external high speed frequencies only (correct me if I'm wrong). What I really wanted to do was to use the internal oscillator which is either: 1. #pragma config FOSC = INTRCCLK // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN) 2. #pragma config FOSC = INTRCIO // Oscillator Selection bits (INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN) Not sure which of the 2 I should use. Anyway, when I tried changing my configuration bit to one of these, I got the following error: Master.c:15: error: (1389) attempt to reprogram configuration setting "FOSC" with INTRCCLK (is HS) (908) exit status = 1 Basically, I'm stuck with HS and I cannot reset it. Now, both my LED's don't turn on since I flashed both PIC's with the wrong configuration bit. How do I set the correct one, and which one is the correct one? |
|
|
|
|
|
你想在哪里改变配置?它应该只是在你的源中改变这一行,重新编译和重新编程PIC。不管以前的设置是什么。我能猜到的是,你的源中有两条语法条,它们都在试图设置FoSC。
以上来自于百度翻译 以下为原文 WHERE are you trying to change the configuration? It should just be a matter of changing that line in your source, re-compiling, and reprogramming the PIC. It doesn't matter what the previous setting was. All I can guess is that you have two #pragma lines in your source both trying to set FOSC. |
|
|
|
|
|
是的,就是这样。这是新手错误。现在使用调试器,我在PICTIT3模式,我的PICTIT3连接,只是闪亮的PIC和我的LED都在。如果我去调试-gt;调试主要项目,我会遇到以下错误:需要调试头来调试这个设备。这是使用调试器的正确方法吗?我不能使用它,或者我做错了吗?
以上来自于百度翻译 以下为原文 yup, that was it. It was a rookie mistake. Now to use the debugger, I'm in pickit3 mode with my pickit3 connected, just flashing the PIC and both my LED's are on. If I go to debug->debug main project, I get the following error: A debug header is required to debug this device. Is this the right way to use the debugger and I just can't use it or I'm doing it wrong? |
|
|
|
|
|
该死,对不起,我不记得PIC16F690是一个真正的旧设备之一,它需要一个特殊的ICD版本来进行电路调试。通常只有很低的引脚计数设备有这个限制。对不起,我误导了你。您不能在特定的PIC上使用皮卡的调试功能。您需要获得一个串行通道,并进行自己的调试,或者得到一个新的PIN兼容PIC16F设备,该设备具有调试内置的功能。
以上来自于百度翻译 以下为原文 Damn, sorry, I didn't remember that the PIC16F690 is one of the really old devices that requires a special ICD version to do in circuit debugging. Normally it's only the very low pin count devices that have that limitation. Sorry, I've misled you. You can't use the PICkit's debugging capabilities on that particular PIC. You either need to get a serial channel working, and do your own debugging, or get a newer pin compatible PIC16F device that does have debugging built in. |
|
|
|
|
|
很好,不用担心。它听起来像很多重做,需要重新为一个不同的PIC设备做SPIHANDLE文件。有一个PIC设备,特别是你推荐哪一个提供调试,但是可能需要尽可能少的返工,以便测试这一点。
以上来自于百度翻译 以下为原文 It's fine, don't worry. It does sound like a lot of rework having to re-do the SPIHandler files for a different pic device. Is there one PIC device in particular you recommend which does offer debugging but would need as little rework as possible in order to test this. |
|
|
|
|
|
FYY,如果你能交换芯片,最便宜的引脚兼容的设备是:PIC16F1534,接着是PIC16F1618,PIC16F1708,PIC16F1828,PIC16F1768。
以上来自于百度翻译 以下为原文 FYI, if you can swap chips, cheapest pin compatible device is: PIC16F15344 followed by PIC16F1618, PIC16F1708, PIC16F1828, PIC16F1768. |
|
|
|
|
|
好的,谢谢。我订购的前3个,因为它只是像1美元每一个。我会测试这个交流与电位器,同时芯片到达这样,我忙着。如果SPI与锅不工作,我将作出相应的改变,任何寄存器(如果我必须)与theReCurrimic PIC设备A因为他们到达和调试根据最初的要求。谢谢你的帮助。如果我在这个论坛上有任何问题,我很快就会回来。再一次,谢谢!(:
以上来自于百度翻译 以下为原文 OK, thank you. I ordered the first 3 since it's only like 1 dollar each anyways. I will test this communication with a potentiometer in the mean time the chips arrive that way I stay busy. If SPI with pot doesn't work, I'll make changes accordingly to any registers (if I have to) with those recommended pic devices as soon as they arrive and debug as originally desired. Thank you for all your help. I will come back soon for if I have any further questions on this same forum. Again, thank you! (: |
|
|
|
|
|
好的,所以我最终设置了PIC16F1618,以便能够使用调试器而不是没有它的PIC16F690。我做了如下的改变:PIC16F690 PIC16F1618SSPATAT SSP1STATSSPCON SSP1CON1ANSEL ANSELLANSELH ANSELB ANSECLSO而不是SSPSTAT,我用SSP1STAT替换它,SSPCON的ITEAD,用安塞尔代替SSP1CON1。0,ANSELH=0,用ASELLA=0,ANSELB=0,ANSELC=0代替。除了SDO以外,该引脚似乎是相同的,我不确定它是基于数据表的,它没有真正理解,所以我留下了它。这可能是个问题,但是SDO在哪里呢?我现在取代了PrimMA的主从微Micro://Copy1 PrimaAcOfC/FoCc=ItoSc//振荡器选择位-& gt;iToSc振荡器:在ClKin PIN上的I/O函数,PrWATE配置,pWRTE=关闭/ /上电定时器启用-&;CSET选择(MCLR/VPP引脚功能是数字输入){ PrimaMac配置=OF//FLASH程序存储器代码保护-&程序存储器代码保护被禁用} PrimaMaMatg配置BRONE = //Brown out RESET使能->Brown out RESET使能的γ-PrAPMA配置CLKOUTEN = OF//时钟输出使能-GT;CLK。输出函数已禁用。在ClkOUT PI///XY-PracMA配置IIOS= ON//内部/外部切换-G&T;内部外部切换模式下启用//OXY-PRADMA配置FCMANN = / /故障安全时钟监视器启用-GT;故障安全时钟监视器启用//CONT2ApRAPMA配置WRT=OF//FLASHMORY自写保护-GT;写保护OFF TraceMac配置PPS1WORE = /OF//外围PIN选择单向控制-gt;PPSLIK位可以通过软件μ-PrimaAcFig ZCD= Off//0-叉检测禁用位-GT;ZCD禁用来重复设置和清除。ZCD可以通过设置ZCDCONα-PracMon配置文件PLLEN=OF//PLL允许位-GT;4x PLL始终启用Underflow、PrimaTracMon配置STVLUN=OF//堆栈溢出/下溢复位允许->堆栈溢出或将导致复位Syr PracMA配置BRV=Lo//Brown out复位电压S。选择-GT;Brown out重置电压(VBOR),低跳闸点选择.Y.PrimaMac配置文件LPBOR=ON//Low Power Brown out RESET & GT;Low Power BOR是启用的。= WDTCPS1F//WDT周期选择-&软件控制(WDTPs),γ-PrAPMA配置,WDTE = OF//看门狗定时器启用-&WT禁用的γ-PracMA配置文件WDTCWS=WDTCWSSW//WDT窗口选择-&软件WDT窗口大小控制(WDTWS位)α-PrAPMA CONFIG WDTTCS = SWC//WDT输入时钟选择器-GT;软件控件,由WDTCS bitsNow控制,当进入调试主项目时,每个表都设置为0:SSP1STAT:BF=0CKe0SMP= 0SSP1CON1:SSPM=0CKP= 0SSPV= 0SSSPUFF=0i没有设置断点,并且设置它不会修复当前问题。看起来像SPIHandler,C和斯皮德勒。H实际上不被用于斯皮德勒。H被包括在内!我知道我的照片正在闪亮,因为这两个LED正在打开。有什么办法解决这个问题吗?
以上来自于百度翻译 以下为原文 OK, so I finally setup the pic16f1618 to be able to use the debugger instead of the pic16f690 which didn't have it. I did the following changes: PIC16F690 PIC16F1618 SSPSTAT SSP1STAT SSPCON SSP1CON1 ANSEL ANSELA ANSELH ANSELB ANSELC So instead of SSPSTAT, I replaced it with SSP1STAT. Intead of SSPCON, I replaced it with SSP1CON1 Instead of ANSEL = 0, ANSELH = 0, I replaced with ANSELA = 0, ANSELB = 0, and ANSELC = 0. The pinout seemed the same except SDO which I wasn't sure where it belongs based on datasheet, didn't really understand OUT, so I left it the same. This could be a problem, but where is SDO then? I replaced the pragma's with this now for both master and slave micro's: // CONFIG1 #pragma config FOSC = INTOSC // Oscillator Selection Bits->INTOSC oscillator: I/O function on CLKIN pin #pragma config PWRTE = OFF // Power-up Timer Enable->PWRT disabled #pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input) #pragma config CP = OFF // Flash Program Memory Code Protection->Program memory code protection is disabled #pragma config BOREN = ON // Brown-out Reset Enable->Brown-out Reset enabled #pragma config CLKOUTEN = OFF // Clock Out Enable->CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin //#pragma config IESO = ON // Internal/External Switch Over->Internal External Switch Over mode is enabled //#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable->Fail-Safe Clock Monitor is enabled // CONFIG2 #pragma config WRT = OFF // Flash Memory Self-Write Protection->Write protection off #pragma config PPS1WAY = OFF // Peripheral Pin Select one-way control->The PPSLOCK bit can be set and cleared repeatedly by software #pragma config ZCD = OFF // Zero Cross Detect Disable Bit->ZCD disable. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON #pragma config PLLEN = OFF // PLL Enable Bit->4x PLL is always enabled #pragma config STVREN = OFF // Stack Overflow/Underflow Reset Enable->Stack Overflow or Underflow will cause a Reset #pragma config BORV = LO // Brown-out Reset Voltage Selection->Brown-out Reset Voltage (Vbor), low trip point selected. #pragma config LPBOR = ON // Low-Power Brown Out Reset->Low-Power BOR is enabled #pragma config LVP = OFF // Low-Voltage Programming Enable->High-voltage on MCLR/VPP must be used for programming // CONFIG3 #pragma config WDTCPS = WDTCPS1F // WDT Period Select->Software Control (WDTPS) #pragma config WDTE = OFF // Watchdog Timer Enable->WDT disabled #pragma config WDTCWS = WDTCWSSW // WDT Window Select->Software WDT window size control (WDTWS bits) #pragma config WDTCCS = SWC // WDT Input Clock Selector->Software control, controlled by WDTCS bits Now, every register is set to 0 according to watches when going into debug main project: SSP1STAT: BF = 0 CKE = 0 SMP = 0 SSP1CON1: SSPM = 0 CKP = 0 SSPOV = 0 SSPBUF = 0 I haven't set up a breakpoint and setting it up won't fix my current problem. It seems like SPIHandler.c and SPIHandler.h aren't really being used for SPIHandler.h is being included! I know my pic is being flash properly because both LED's are turning on. Any idea of how to fix this? |
|
|
|
|
|
你的新PIC有PPS,所以你必须告诉它哪一个PIN用于外围输出。它比旧的芯片更灵活,但是在你能从外围设备得到输出之前给你一个更多的工作。阅读PIC16F1618数据表的第13章“外围引脚选择”,而不是一些外围设备。AL输入有默认引脚,但没有输出。
以上来自于百度翻译 以下为原文 Your new PIC has PPS, so you have to tell it which pin to use for peripheral outputs. It's a lot more flexible than the old chips, but gives you one more job to do before you can get an output from a peripheral. Read Chapter 13 "Peripheral Pin Select" of the pic16f1618 datasheet. Not that some peripheral inputs have default pins, but no outputs do. |
|
|
|
|
|
好的,这是全新的和奇怪的。TIS注册的任务不是说什么是输入,什么是输出?为什么我需要指定哪些引脚是输入,哪些引脚是输出再次?顺便说一下,我把RC4连接到LED,我不必指定它是通过PPS输出的,但是LED仍然亮着。
以上来自于百度翻译 以下为原文 okay, this is completely new and strange. Isn't the job of TRIS register to say what is an input and what is an output? Why do I need to specify which pins are inputs and which pins are outputs again? BTW, I connected RC4 to the LED and I didn't have to specify that it's an output through PPS but the LED still lit. |
|
|
|
|
|
你错过了这一点。TIS寄存器设置每个引脚的方向。PPS设备允许你将内置的外围设备的输出连接到几乎任何引脚。这使得布局PCB更加容易。也就是说,没有固定的SDO引脚,您可以把它放在几乎所有的GPIO引脚上。这是你的选择。只要通过一个端口锁存器打开一个LED根本不使用外围设备,这就是PPS没有效果的原因。如果没有分配给外围输出,每个引脚都回复到端口功能。
以上来自于百度翻译 以下为原文 You've missed the point. The TRIS registers set the direction of each pin. The PPS facility allows you to connect the output of the built in peripherals to almost any pin. That makes it much easier to layout your PCB. i.e. there is no fixed SDO pin, you can put it on almost any of the GPIO pins. It's your choice. Just turning an LED on via a PORT latch is not using a peripheral at all, which is why the PPS has no effect. Every pin reverts back to the PORT function if it is not assigned to a peripheral output. |
|
|
|
|
|
好的,我想我现在明白这个概念了。我做了以下两个主和从,仍然得到相同的结果:RC7PPS= 0x11;/*将RC7引脚设置为输出*/i选择0x11,因为数据表表示:RxPyp& lt;4:0& gt;输出信号SDO/SDA必须具有1000个DO值,我也需要用PPSROK做任何事情,这是强制的吗?而且,真的很奇怪,即使SSPEN是1,一切仍然是0。字面上,整个SPIHandler的东西都不起作用:
以上来自于百度翻译 以下为原文 OK, I think I understand the concept now. I did the following for both master and slave and still got the same results: RC7PPS = 0x11; /* Sets RC7 pin to an output */ I chose 0x11 because the data sheet says: RxyPPS<4:0> for output signal SDO/SDA must have a value of 10001 Do I need to do anything with PPSLOCK too, like is it mandatory? Also, it's really strange how not even SSPEN is a 1, everything is still a 0. Literally the entire SPIHandler stuff isn't working :( |
|
|
|
|
|
您还需要使用PPS来将SPI时钟连接到主控器上的输出引脚。正如我已经说过的,默认的赋值仅作为输入。如果使用该PIN,则只需要设置输出。如果为SCK使用不同的PIN,则必须通过PPS对SCK的输入和输出进行映射。这是在页面上的“注释”中记录的:“24.2.3 SPI主模式”,您可以让PPS开始解锁。我不知道为什么您没有看到SSPEN转到1。
以上来自于百度翻译 以下为原文 You also need to use the PPS to connect the SPI clock to an output pin on the Master. As I already said, the default assignment is only as an input. (Note, the default is to RB6. If you use that pin, you only need to setup the output. If you use a different pin for SCK, you have to map both input and output for SCK via PPS. This is documented in the "Note" on the page containing: "24.2.3 SPI MASTER MODE" You can just leave the PPS unlocked to start with. I don't know why you aren't seeing SSPEN go to 1. |
|
|
|
|
|
AAH,好吧,我明白了。我做了:RB6PPS= 0x10;/*设置RB6作为输出端口*/我如何知道哪些外围输入具有默认引脚,以及默认PIN值与RB6为默认输入CLK。如果只在主模式下设置CLK输出,那么它将是同一个引脚上的默认输入(RB6)。)但是,当SDO设置为输出时,它是否也是SDI的默认输入?此外,所有的设置都是0,因为我点击了运行调试Debug项目,但实际上我从来没有按下停止来逐行调试(我假设这是你应该怎么做)现在我在一行一行我正在检查char CARYGSPIHANDLLRY传输(Char Data)函数,因为SSPEN被设置为1CK= 1,所有其他设置为0(在主PIC)。当我进入那个函数时,我必须在BF被设置之前进入几次。因此,一旦BF=1,当我从奴隶中发送“S”时,SSPBUF的值是‘H’(0x68)。知道这是为什么发生的,如果这是正确的调试方式,因为这是我第一次在MPLAB X IDE V4.00中使用调试器,根据ASCII表:0110 1000(0x68)-& gt;h’0101 0011(0x53)-& gt;s。
以上来自于百度翻译 以下为原文 aah, ok I understand. I did: RB6PPS = 0x10; /* Sets RB6 as an output port */ How do I know which peripheral inputs have default pins and what that default pin value is like RB6 being default input CLK. If I only have to set CLK output on master mode, then it will be default input on that same pin (RB6). However, is it also default input for SDI when I set SDO as an output? Moreover, everything was set to 0 because I clicked run debug main project but I never actually pressed stop to debug line by line (I assume this is how you should do it) Now that I'm in line by line I'm checking the char char_g_SPIHandler_Transmission(char data) function, since SSPEN is set to 1 and CKE = 1 as well, everything else set to 0 (in master pic). As I'm stepping into that function, I had to step into a couple times before BF was set. So once BF = 1, the value of SSPBUF is 'h' (0x68) when I'm actually sending 'S' from the slave. Any idea why this is happening and if this is the correct way to debug since it's my first time using the debugger in mplab x IDE v4.00. Note, as per ASCII table: 0110 1000 (0x68) -> 'h' 0101 0011 (0x53) -> 'S' |
|
|
|
|
只有小组成员才能发言,加入小组>>
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:20 , Processed in 1.296730 second(s), Total 109, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1735