• AVR Freaks

PIC16F1705 COG Not working

Author
karelkrajca
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/04/08 12:04:47
  • Location: 0
  • Status: offline
2019/04/14 10:28:37 (permalink)
0

PIC16F1705 COG Not working

Hello,
 
could you please help me with setting COG in PIC16F1705 so that it works properly?
 
I set peripherals in MCC, but only PWM3 works (Logic Analyzer and PORTC). COG1A is still low and COG1B is still high regardless Steered PWM/Half-Bridge mode or Edge/Level Trigger is used. Also setting of G1ASDAC/G1ASDBD and G1POLA/G1POLB does not change the output. At least G1POL should change the polarity (?). COG1STR is set to waveform and static data low (COG4.X.zip + 2 jpegs).
 
I also used code in assembler (COG.asm - exactly per section 18.12, page 189, DS40001729C) with the same result (only one of outputs reverted when polarity changed what I remember, but no signal occured). Other assembler code (COG_test.asm) uses setting sequence copied from cog1.c file and also does not provide expected result.
 
What am I doing wrong? After generating code using MCC, I open main.c project without any additional code/change and then use "Debug Project" button and see result in Simulator Logic Analyzer. I use Simulator and MPASM compiler for assembler and XC8 for C.
 
I have not tried on real HW yet.
 
This is really annoying :-(
 
Thank you for help
Karel

Attached Image(s)

#1

2 Replies Related Threads

    DeutcheN
    Senior Member
    • Total Posts : 98
    • Reward points : 0
    • Joined: 2010/09/01 12:35:40
    • Location: DM43BH
    • Status: offline
    Re: PIC16F1705 COG Not working 2019/04/18 11:59:08 (permalink)
    +2 (2)
    Hi,
     
     I just ran your code on an actual device as is.  The COG outputs are alive and well.  This seems an issue with the simulator.
    #2
    karelkrajca
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/04/08 12:04:47
    • Location: 0
    • Status: offline
    Re: PIC16F1705 COG Not working 2019/04/23 09:00:18 (permalink)
    0
    Hi DeutcheN,
     
    thank you for good news. Was it C code or the assembly one?
     
    Thanks again
    Karel
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5