Jump to content
 

All Activity

This stream auto-updates     

  1. Earlier
  2. I am trying to configure the PIC16F753 using the MCC, however the PWM peripheral is not showing up in Device Resources and when I try to add a resource it does not appear there. According to its data sheet ( https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/40001709D.pdf ) on page 8 and its description on ( https://www.microchip.com/en-us/product/pic16f753 ) it should be able to use PWM. Is there something simple I am missing? Or is anyone else having this issue?
  3. I apologize for not responding sooner and welcome to microforum. Are you able to measure the actual baudrate produced by your settings? If you are getting data out that is more than 5% away from 19200, then the issue can be traced to the accuracy of the internal oscillator and you have a few options. 1) take advantage of the autobaud feature. This feature was added specifically for LIN so it is compatible with the typical LIN bus framing. 2) use the OSCTUNE feature (if available) to fine tone the FOSC until you achieve the required baud rate. Note, this value could be different for every device. 3) adjust the SPBRG values a little bit to compensate for the real oscillator frequency. 4) use an external crystal to create an FOSC at the required value. Good luck
  4. I have a program in MPLAB that works correctly when sending messages through the LIN system at a baud rate of 9600, but when I change it to 19200 it does not come out. I am using the MPLAB Code configurator V4 tool and in the window for Eusart I put the 19200 which are the Baud Rates to which I want to transfer. It is expected to know the values in the eusart.c file of SP1BRGL and SP1BRGH for the Baud Rate corresponding to 19200. Tried with SP1BRGL values of 0x40,0X65,0xFE, 0x3B, 0x3D keeping SP1BRGH at 0x00. Also in the application in the Registers of the variables of Sp1BRGL and SP1BRGH so that they correspond to a Baud Rate of 19200. For the calculation, the table for pic16 was used, it is expected in high transfer speed with a 16 Mhz oscillator an SPBRG of 51 but it still did not work. I do not know what I am doing wrong, to read the data I am using a LIN analyzer tool and everything works at a Baud rate of 9600 but I take it to be 19600 for the application.
  5. I just downloaded the latest MPLAB (V5.50) and MCC (V5.03, Classic), setup a project with the 18LF46K22 and added the MSSP peripheral. This driver has callbacks for all the major states. When a device is not present there will be a NAK in the address phase. The callback you will need is configured with void I2C1_SetAddressNackCallback(i2c1_callback_t cb, void *ptr); So you can create a callback for the NAK as follows: typedef struct { i2c1_address_t address; bool present; } address_present_t; i2c1_operations_t callbackAddrNak(void *funPtr) { address_present_t *Present = funPtr; Present.present = false; return I2C1_STOP; } // this code comes from the i2c1_master_example provided by MCC uint8_t I2C1_Read1ByteRegister(i2c1_address_t address, uint8_t reg) { uint8_t returnValue = 0x00; address_present_t present; present.address = address; while(!I2C1_Open(address)); // sit here until we get the bus.. I2C1_SetAddressNackCallback(callbackAddrNak,&present; // setup the address NACK callback with the address data I2C1_SetDataCompleteCallback(rd1RegCompleteHandler,&returnValue); I2C1_SetBuffer(&reg,1); I2C1_MasterWrite(); while(I2C1_BUSY == I2C1_Close()); // sit here until finished. if(present.present == FALSE) { // do something appropriate. // some memories fail to respond (generate a NAK) when they are busy. // a missing device will also result in a NAK. } return returnValue; } Note: A NAK can be the "normal" operation of some devices such as a memory. Often an EEPROM will refuse to ACK their address when they are busy writing. You use a process called NAK polling. If you do the device scan during a time when you can expect all devices to be active and ready, then you should be able to generate a map of the available addresses. Good Luck
  6. This is a follow through of the discussion at https://www.microforum.cc/topic/90-help-with-mcc-generated-i2csimple-getting-stuck-in-a-loop/ I have a need to poll the I2C bus to detect presence or absence/failure of a device in a system controlled by a PIC18LF46K22. The code base is generated by MPLAB's MCC. The post above addressed that type of situation. I tried to work through that discussion in comparing it to the current code generated by MCC and have noted too many differences. That discussion was 2 years ago and I'm sure there have been many changes to MCC since that time. So, the question boils down to: In the current scheme as generated by MCC is there a way for the application to determine that an I2C Address has been NAK'ed? Thanks for any pointers...
  7. I dislike windows 10 taskbar previews and was wondering how I can disable them, I have tried the hack using regredit but to no avail. It did work for a long time but after a number of updates it no longer works.Every search on the web gives the same old regedit hack ao I am wondering if there is something else I can do. Thanks in advance.
  8. 1. Trying out MPLabX5.5 with Using the MPLAB-X Simulator to debug UART code - What every embedded programmer should know about ... - microforum.cc.html 2. Extracted the SimulatorUART.zip file,opened the project 2.1. 2.2. Upgrade 2.3. 2.4. 2.5. MCC 2.6. 2.7 Debug make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory 'D:/Software/Microchip/SimulatorAndUART/SimulatorUART-WhatEveryoneShoulKnowEtc/SimulatorUART.X' make -f nbproject/Makefile-default.mk dist/default/debug/SimulatorUART.X.debug.elf make[2]: Entering directory 'D:/Software/Microchip/SimulatorAndUART/SimulatorUART-WhatEveryoneShoulKnowEtc/SimulatorUART.X' "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -c -D__DEBUG=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/mcc_generated_files/device_config.p1 mcc_generated_files/device_config.c "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -c -D__DEBUG=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/mcc_generated_files/eusart.p1 mcc_generated_files/eusart.c "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -c -D__DEBUG=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/mcc_generated_files/interrupt_manager.p1 mcc_generated_files/interrupt_manager.c "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -c -D__DEBUG=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/mcc_generated_files/mcc.p1 mcc_generated_files/mcc.c "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -c -D__DEBUG=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/mcc_generated_files/pin_manager.p1 mcc_generated_files/pin_manager.c "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -c -D__DEBUG=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/main.p1 main.c Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 "D:\Programs\xc8\v2.32\bin\xc8-cc.exe" -mcpu=16F18875 -Wl,-Map=dist/default/debug/SimulatorUART.X.debug.map -D__DEBUG=1 -DXPRJ_default=default -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -Wl,--memorysummary,dist/default/debug/memoryfile.xml -o dist/default/debug/SimulatorUART.X.debug.elf build/default/debug/mcc_generated_files/eusart.p1 build/default/debug/mcc_generated_files/device_config.p1 build/default/debug/mcc_generated_files/interrupt_manager.p1 build/default/debug/mcc_generated_files/mcc.p1 build/default/debug/mcc_generated_files/pin_manager.p1 build/default/debug/main.p1 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 mcc_generated_files/eusart.c:113:: warning: (520) function "_EUSART_is_tx_ready" is never called mcc_generated_files/eusart.c:118:: warning: (520) function "_EUSART_is_rx_ready" is never called mcc_generated_files/eusart.c:123:: warning: (520) function "_EUSART_is_tx_done" is never called mcc_generated_files/eusart.c:171:: warning: (520) function "_getch" is never called mcc_generated_files/pin_manager.c:124:: warning: (520) function "_PIN_MANAGER_IOC" is never called Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 186 Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "D:/Programs/Microchip/MPLABX/v5.50/packs/Microchip/PIC16F1xxxx_DFP/1.7.146/xc8\pic\dat\ini\16f18875.ini" at line 195 Memory Summary: Program space used 27Dh ( 637) of 2000h words ( 7.8%) Data space used 94h ( 148) of 400h bytes ( 14.5%) EEPROM space used 0h ( 0) of 100h bytes ( 0.0%) Configuration bits used 5h ( 5) of 5h words (100.0%) ID Location space used 0h ( 0) of 4h bytes ( 0.0%) make[2]: Leaving directory 'D:/Software/Microchip/SimulatorAndUART/SimulatorUART-WhatEveryoneShoulKnowEtc/SimulatorUART.X' make[1]: Leaving directory 'D:/Software/Microchip/SimulatorAndUART/SimulatorUART-WhatEveryoneShoulKnowEtc/SimulatorUART.X' BUILD SUCCESSFUL (total time: 6s) Loading symbols from D:/Software/Microchip/SimulatorAndUART/SimulatorUART-WhatEveryoneShoulKnowEtc/SimulatorUART.X/dist/default/debug/SimulatorUART.X.debug.elf... Loading code from D:/Software/Microchip/SimulatorAndUART/SimulatorUART-WhatEveryoneShoulKnowEtc/SimulatorUART.X/dist/default/debug/SimulatorUART.X.debug.elf... Program loaded with pack,PIC16F1xxxx_DFP,1.7.146,Microchip Loading completed 2.7. Output-Simulator Tab W0106-SIM: This device only has partial support for use internal oscillator as timer clock slection peripheral. not implemented W0106-SIM: This device only has partial support for use internal oscillator as timer clock slection peripheral. not implemented W0106-SIM: This device only has partial support for use internal oscillator as timer clock slection peripheral. not implemented Resetting SFRs Resetting peripherals Resetting SFRs Resetting peripherals Running 2.8. 2.9. Stimulus>GreenButton 2.10. 2.11. UART1 output no change 2.12. Stimulus- 2.13. 2.14. Applied Stimulus 3 times 2.15. Each time “Synchronous Stimulus Applied Successfully” and "Stimulus removed..." message, 2.16. But no change in UART1 output. 2.17. And Output>Simulator shows 2.18. W0106-SIM: This device only has partial support for use internal oscillator as timer clock slection peripheral. not implemented 2.19. W0106-SIM: This device only has partial support for use internal oscillator as timer clock slection peripheral. not implemented 2.20. W0106-SIM: This device only has partial support for use internal oscillator as timer clock slection peripheral. not implemented Resetting SFRs Resetting peripherals Resetting SFRs Resetting peripherals Running E0108-SIM: Failed simulator operation: java.lang.NullPointerException com.microchip.mplab.mdbcore.simulator.pic16.peripherals.UART.RxUART.processPacketInjection(RxUART.java:132) com.microchip.mplab.mdbcore.simulator.pic16.peripherals.UART.RxUART$UARTRxInjectionListener.notify(RxUART.java:120) com.microchip.mplab.mdbcore.simulator.scl.RegisterInjectionDefault.addValues(RegisterInjectionDefault.java:123) com.microchip.mplab.mdbcore.simulator.scl.Instruction.executePacketIn(Instruction.java:1336) com.microchip.mplab.mdbcore.simulator.scl.Instruction.executeCall(Instruction.java:922) com.microchip.mplab.mdbcore.simulator.scl.Instruction.execute(Instruction.java:321) com.microchip.mplab.mdbcore.simulator.scl.Process.run(Process.java:166) com.microchip.mplab.mdbcore.simulator.scl.SCLDefault.run(SCLDefault.java:275) com.microchip.mplab.mdbcore.simulator.scl.SCLDefault.run(SCLDefault.java:291) com.microchip.mplab.mdbcore.simulator.pic16.ProcessorMidRange$RunExecution.stepInstruction(ProcessorMidRange.java:389) com.microchip.mplab.mdbcore.simulator.pic16.ProcessorMidRange.executeInstruction(ProcessorMidRange.java:262) com.microchip.mplab.mdbcore.simulator.pic16.ProcessorMidRange.singleStep(ProcessorMidRange.java:448) com.microchip.mplab.mdbcore.simulator.Simulator.RunTarget(Simulator.java:339) com.microchip.mplab.mdbcore.debugger.MCDebugger$1.run(MCDebugger.java:576) java.lang.Thread.run(Thread.java:748) 2.21. 3. 4. Please let me know where the problem is 5.
  1. Load more activity
 


  • Popular Contributors

    Nobody has received reputation this week.

  • Who's Online (See full list)

    There are no registered users currently online

  • Forum Statistics

    • Total Topics
      87
    • Total Posts
      406
×
×
  • Create New...