Can not add anything to my schematic

Create new topics, add your comment, remark, bugs...
Post Reply
squall315
Posts: 4
Joined: Thu Jun 10, 2010 7:18 pm

Can not add anything to my schematic

Post by squall315 » Fri Jan 21, 2011 10:37 am

Hi Lubin,

I'm using a Programmable Gain Array to amplify 6 channels at the same time connected to a dspic 33fj128gp802. As I want a 2kHz refresh rate on each channel, I'm working at 12kHz and this PGA is controlled by SPI. When I do that, my program is working fine and the Calculus Time Step gives me 1200 for T and 3333 for PR1 as I work at 40MIPS.

After that, when I try to add anything to my schematic, even things really simple like an inverter on my blinking led, my program is not working anymore at all.
I tried to compare the codes generated when it is working and when it is not but nothing changed in the configuration registers.

When it is working, the blinking led frequency and the SPI clock are correct. The weird thing is when I compile my working program at 2kHz instead of 12kHz, it gives me 4000 for T whereas the difference in the number of instructions should not be so different.

So, as I have really no idea of what is going on, do you have any idea? Is it possible that my dsPic is used at 100% but the calculus time step block is giving me false values ?

Thanks,

Fabien

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Can not add anything to my schematic

Post by LubinKerhuel » Tue Feb 15, 2011 10:49 pm

Hi fabien,

Weird problem! Not sure to get it all ; it might be helpful to post the model so as to get more insight.

Anyway, you might try to use the Busy flag port (see Master block) and a scope to check what's really going on.

Lubin

squall315
Posts: 4
Joined: Thu Jun 10, 2010 7:18 pm

Re: Can not add anything to my schematic

Post by squall315 » Thu Feb 24, 2011 4:33 pm

Hi Lubin,

The busy flag is never coming back to 0 which is what I thought. The weird thing is my SPI clock and blinking LED frequency are correct and the value indicated by T of the Calculus Time Step block must be incorrect as I end up with a 30% occupation.

The goal of that experience was to know if I could work with that frequency so I have my answer but I don't understand how adding something to the schematic can make my program not work at all and not make it slower. And I think we can not take into account the T value if the microcontroller is always occupied.

Fabien

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests