NeoPixel Simulation with PIC16Fxxxx

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
rintronic
Professional User
Posts: 32
Joined: Mon 2009-09-21 21:06

NeoPixel Simulation with PIC16Fxxxx

Post by rintronic »

Hi Ettore,

We have been trying to prepare a Lab for the University to simulate an 8 LED NeoPixel strip and have not had success, we have tried with many different models of PICs, and the same result.

The main issue is that the combinational logic of the CLC1 module does not output any wave or even after forcing some states, the correct wave.

We understand that the simulation might have some aspects not close to reality but just wanted to be sure if this kind of CLCx module, is not implemented in full.

We have followed Microchip's guidelines from this link (https://mplabxpress.microchip.com/mplab ... etails/503), and the hardware programmed on different PICs work, also we are including the Proteus project as well as the MplabX project.

Hope you can provide a solution for this simulation.

Thanks.

Regards.

Roberto Iglesias
Attachments
LabsProjects.rar
(505.44 KiB) Downloaded 126 times
rintronic
Professional User
Posts: 32
Joined: Mon 2009-09-21 21:06

Re: NeoPixel Simulation with PIC16Fxxxx

Post by rintronic »

Hi Ettore,

We have been successful in making the simulation work, although it is very slow, and also had to make use of very different resources in order to have the SPI generate the SKD, SDO, and the CLCx signals.

One question we have is if it does make any sense to change or set the speed of the PIC used, under its properties, because no matter what value we set it up there, there is no change in the simulation speed at all.

Please let us know, as we have observed this same behavior on other micros being simulated.

Thanks.

Regards,

Roberto Iglesias.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: NeoPixel Simulation with PIC16Fxxxx

Post by Ettore »

As far as I remember your firmware configures the PIC for INTOSC use (internal oscillator) so the clock frequency is under firmware control.
The property "Processor Clock Frequency" refers to the crystal frequency when some external clock mode is configured (i.e. XT, HS).
Kind regards,
Ettore Arena - Labcenter Electronics.
rintronic
Professional User
Posts: 32
Joined: Mon 2009-09-21 21:06

Re: NeoPixel Simulation with PIC16Fxxxx

Post by rintronic »

Hi Ettore,

Ok, I will try some external clock topologies and verify this.

Also there are two additional issues we have found, as the CLCx doesn't output any signal on VSM, whereas the physical device on a protoboard does, and also if we connect the oscilloscope to the CLCx, once we have a signal been generated, the signal is displayed but can't turn on the NeoPixels, if we disconnect the oscilloscope, then the NeoPixels work again.

That is weird but we assume that the oscilloscope doesn't load the PIC.

Thanks.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: NeoPixel Simulation with PIC16Fxxxx

Post by Ettore »

rintronic wrote: Also there are two additional issues we have found, as the CLCx doesn't output any signal on VSM, whereas the physical device on a protoboard does,
Yes, I know that and I have fixed it for 8.13 for when it will be released.
rintronic wrote: ...and also if we connect the oscilloscope to the CLCx, once we have a signal been generated, the signal is displayed but can't turn on the NeoPixels, if we disconnect the oscilloscope, then the NeoPixels work again.
I think it's because the NeoPixels is purely modelled digital part which requires very strict timings and oscilloscope introduces one analogue node with may invalidate the digital timings itself. You may try to add a BUFFER primitive - from Modelling Primitives->Digital (Buffer & Gates) - in the between of oscilloscope and CLCx signal.
Kind regards,
Ettore Arena - Labcenter Electronics.
rintronic
Professional User
Posts: 32
Joined: Mon 2009-09-21 21:06

Re: NeoPixel Simulation with PIC16Fxxxx

Post by rintronic »

Hi Ettore,

Great support from you, we really appreciate it.

Will wait for 8.13 for new labs at the university, but meanwhile will try your advice on the use of the buffer primitive.

Again, thanks a lot for all your support.

Regards,

Roberto Iglesias
Post Reply