Search found 10 matches

by graele
Thu Mar 19, 2009 7:56 pm
Forum: General Remark and Questions
Topic: Interrupt function instead of a while cicle?
Replies: 1
Views: 2357

Interrupt function instead of a while cicle?

Hello everybody.. The generated code substantially work with a for cicle of this type: for (;;) { /* Associate rt_OneStep() with a timer that executes at the base rate of the model */ while (!_T1IF); _T1IF = 0; rt_OneStep(); } so, that everytime the timer generates the interrupt, the flag changes an...
by graele
Sun Feb 08, 2009 5:56 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

Hi Lubin... I'm posting something on the Microchip forum, as you've suggested.. as soon as I'll solve the SPI problem I'll write you what was wrong.. 'cause actually the code seems to be fine, and also the electric connections.. By the way... do you have some code examples and electronic schema (PCB...
by graele
Sat Feb 07, 2009 4:33 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

I've implemented the whole circuit, and also the sending of data.. But still nothings.. I checked for the errata, but about the SPI there's nothing relevant... Does your SPI connection of your dsPIC work fine? Or did you just try the UART connection?? Please, let me know, and still thank you for the...
by graele
Sat Feb 07, 2009 3:30 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

Well... I've mapped the peripheral as you suggested, making the clock in and clock out coincident. But nothing... Then I've looked at the generated code, and I've noticed that it makes the peripheral mapping after enabling the SPI... while, I think, it should be the opposite.. so I changed the order...
by graele
Sat Feb 07, 2009 12:41 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

It keeps not working... I read each single instruction of the code, and everything seems perfect. In my trial, I just open the SPI1 port, after having mapped it on particular pins, in master mode... Then, using the oscilloscope, I read the pin designated for the SCK1OUT, but no clock there! What do ...
by graele
Fri Feb 06, 2009 3:23 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

No, everything's fine with the TRISB register.. I'm sorry...

Manu
by graele
Fri Feb 06, 2009 3:10 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

Ok, thank you very much!

I've added the file as you've indicated...

Just a quick question... is the TRISB register the one dedicated to specify if a pin of the PORTB is used
as input or as output? Because probably the mistake can be in the setting of the TRISB register...

Manu
by graele
Fri Feb 06, 2009 2:28 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

Well, i don't have a remote space to upload the model. Eventually, if you want, I can send it to you by email. I already checked the PIN mapping set in the C code generated.. and looking at the data sheet of the dsPIC it's seems like if there are no errors... I really don't understand why it works t...
by graele
Fri Feb 06, 2009 1:41 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Re: Problem using ADC and SPI

ah...i forgot to say (if it can be useful) that even if the ADC stop working, the dsPIC is still working generally
(because I can make a LED blinking without problems...)

Manu
by graele
Fri Feb 06, 2009 1:35 pm
Forum: General Remark and Questions
Topic: Problem using ADC and SPI
Replies: 15
Views: 8846

Problem using ADC and SPI

Hello! I've a strange problem using the ADC and the SPI. In particular, I'm trying to realize a controller using the dsPIC33FJ128GP802. I've no problems using just the ADC. I receive the signal, and I can use it without problem. But, if I try to communicate through the SPI1 port with a MCP4821 (DA c...