Search found 71 matches

by resodad
Fri Mar 29, 2013 3:36 pm
Forum: bug reports
Topic: ADC output vector BUG?
Replies: 0
Views: 8870

ADC output vector BUG?

Hi Lubin,
Please look a this model.
I would like ADC to output a vector of 10 values each 0.001 second.
The next block downstream averages the 10 samples.
The build shows the error:
strainBasedMotorDrive_v3.c:195:3: error: '_AD1IE' undeclared
Regards,
John
by resodad
Fri Apr 27, 2012 2:58 pm
Forum: bug reports
Topic: I2C does not build on PIC32
Replies: 3
Views: 10726

Re: I2C does not build on PIC32

Hi Lubin, My C expert, Konstantin, says: "Probably not, although it most likely will not be too much work to fix. In the I2CCON register in particular, going from the dsPIC family of microcontrollers to the PIC32, the I2CCON register gets renamed I2CxCON where x is the I2C module number. Also within...
by resodad
Wed Apr 25, 2012 1:37 pm
Forum: bug reports
Topic: I2C does not build on PIC32
Replies: 3
Views: 10726

Re: I2C does not build on PIC32

Hi Lubin,
Can you please tell me if this bug is a priority for you?
If it is not, I will work on the I2C code in C.
Thanks, John
by resodad
Wed Apr 04, 2012 2:31 pm
Forum: bug reports
Topic: I2C does not build on PIC32
Replies: 3
Views: 10726

I2C does not build on PIC32

Lubin,
Please look into this. I believe it is a bug.
There are two other related posts from 2010:
http://www.kerhuel.eu/forum/viewtopic.php?f=1&t=318
and
http://www.kerhuel.eu/forum/viewtopic.php?f=8&t=267
Thanks
John
desktopFig.jpg
by resodad
Wed Apr 04, 2012 2:24 pm
Forum: General Remark and Questions
Topic: I2C on PIC32
Replies: 3
Views: 13246

Re: I2C on PIC32

All,
This belongs in the BUG REPORTS forum.
I will re-post there.
John
by resodad
Tue Apr 03, 2012 9:21 pm
Forum: General Remark and Questions
Topic: I2C on PIC32
Replies: 3
Views: 13246

Re: I2C on PIC32

Hi Lubin,
I've got the same problem.
John
desktopFig.jpg
by resodad
Thu Mar 15, 2012 5:13 pm
Forum: Request for new functions / Peripheral / Chip support
Topic: Please support 32MX320F128H
Replies: 3
Views: 10591

Re: Please support 32MX320F128H

Until you get around to it,
How would I modify the code generated for one chip to work on a different chip?
by resodad
Thu Mar 08, 2012 9:51 pm
Forum: Request for new functions / Peripheral / Chip support
Topic: Please support 32MX320F128H
Replies: 3
Views: 10591

Please support 32MX320F128H

Hi Lubin,
Digilent has released the Cerebot MX3 cK board.
I would like to use it because It is small and cheap.
Please consider supporting the 32MX320F128H chip in your next blockset release.
Regards,
John
by resodad
Mon Jan 16, 2012 3:48 pm
Forum: General Remark and Questions
Topic: how to use custom c source code
Replies: 9
Views: 24421

Re: how to use custom c source code

Lubin,
LubinKerhuel wrote:Correct.
you might also add the folder where they are in the "include directory" box if the compiler did not find theses files.

Lubin
Like this? I ask because this produces an error (see my other post about GenericTypeDefs.h)
John
by resodad
Fri Jan 13, 2012 5:07 pm
Forum: Advanced Simulink & RTW Questions
Topic: Recive Multiple Data from the same UART
Replies: 1
Views: 7814

Re: Recive Multiple Data from the same UART

Vladimir,
You want to parse incoming data (UART Rx). I did similar for Tx. See the post "Rx Interrupt buffer size" linked here: http://www.kerhuel.eu/forum/viewtopic.p ... +uart#p453.

You might get some ideas that will work for you.
Regards,
John
by resodad
Thu Jan 12, 2012 4:34 pm
Forum: General Remark and Questions
Topic: how to use custom c source code
Replies: 9
Views: 24421

Re: how to use custom c source code

Like this?
by resodad
Thu Jan 12, 2012 2:39 pm
Forum: General Remark and Questions
Topic: how to use custom c source code
Replies: 9
Views: 24421

Re: how to use custom c source code

Hi Lubin, The attached screen image shows the configuration parameters and where I enter the names of the custom c files. Instead of "Simulation Target" they might also go under "Code Generation." Please verify--do I have it right? Does it work just as well to put the file names under"Code Generatio...
by resodad
Tue Jan 10, 2012 1:33 pm
Forum: bug reports
Topic: MPLAB 8.x project not generated properly during compile
Replies: 6
Views: 16404

Re: MPLAB 8.x project not generated properly during compile

Bryant,
I get this error:
"
The following error occurred processing the System Target File '':
Undefined function or variable "version".
"
when I build.
John
by resodad
Thu Jan 05, 2012 9:59 pm
Forum: General Remark and Questions
Topic: how to use custom c source code
Replies: 9
Views: 24421

how to use custom c source code

Hi Lubin, The help for the c function call block says: "The .c file containing the code of the function should be placed in the same directory as the .mdl file. If the c file is in another directory, it must be manually added in the "Simulation Parameters -> Real time workshop -> additional C file" ...
by resodad
Thu Jan 05, 2012 8:57 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Microchip Tech Support says: " I think the issue is that you are including the GenericTypeDefs after rtwtypes.h, and there the FALSE and TRUE are defined.\ So FALSE is replaced with (0U), so the parsing fails. You should try to include the timer.h before the rest of your own files. " I tried followi...
by resodad
Mon Dec 12, 2011 3:07 pm
Forum: General Remark and Questions
Topic: PIC32 Stater Kit and MATLAB
Replies: 3
Views: 12485

Re: PIC32 Stater Kit and MATLAB

Karan,
Everything on this forum is about code generation from Simulink. See the examples.
It is possible to write microcontroller programs directly in matlab m files, but I don't recommend that way.
John
by resodad
Thu Dec 08, 2011 8:00 pm
Forum: General Remark and Questions
Topic: PIC32 Stater Kit and MATLAB
Replies: 3
Views: 12485

Re: PIC32 Stater Kit and MATLAB

Hi Karan, Are you using a development board, or do you just have the PIC32 chip by itself? Do you mean using MATLAB .m file programming, or using Simulink? See my "Getting Started with Digilent Cerebot 32MX4" on the examples page under "Microchip Kits." or cut and paste this link: http://www.kerhuel...
by resodad
Tue Nov 22, 2011 3:49 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Hi Lubin and all, I am still very stuck on this problem. Please confirm that you can duplicate the problem (#2 above). the error is: " ...GenericTypeDefs.h:65:22: error: expected identifier before '(' token " But there is nothing wrong with the code in this file. It is Microchip sourced and proven. ...
by resodad
Tue Oct 11, 2011 3:57 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Lubin and all: I have found a clue about this problem. please note: 1. attachment SD_Datalogger2.mdl contains NO CUSTOM CODE. There is no build error when the MATLAB working folder is set correctly to the same location when the .mdl file is saved. HOWEVER, the same file produces the GenericTypeDefs ...
by resodad
Tue Oct 11, 2011 3:11 pm
Forum: bug reports
Topic: restorePath, and slbuild errors, matlab working directory ch
Replies: 8
Views: 19370

Re: restorePath, and slbuild errors, matlab working director

Thanks Lubin.
The new version is working so far.
John
by resodad
Tue Oct 04, 2011 6:48 pm
Forum: bug reports
Topic: restorePath, and slbuild errors, matlab working directory ch
Replies: 8
Views: 19370

Re: restorePath, and slbuild errors, matlab working director

Also,
if you remove the "if" block from ArmFireX2.mdl, it builds OK.
John
by resodad
Tue Oct 04, 2011 6:02 pm
Forum: bug reports
Topic: restorePath, and slbuild errors, matlab working directory ch
Replies: 8
Views: 19370

Re: restorePath, and slbuild errors, matlab working director

Here is a pair of files that may help track the error. The difference is the addition of a pulse block and a multiply block.
Please see if you get the same error as I do.
John
by resodad
Tue Oct 04, 2011 5:52 pm
Forum: bug reports
Topic: restorePath, and slbuild errors, matlab working directory ch
Replies: 8
Views: 19370

Re: restorePath, and slbuild errors, matlab working director

Lubin, this problem persists.it is a BIG problem since I cannot use the blockset.
I run Matlab R2011a as administrator.
The path includes ...\blocks and...\dspic.

neither of these help.

Why does the current folder jump up two levels?
Please let me know if you find a work around.
John
by resodad
Tue Oct 04, 2011 5:43 pm
Forum: Requirement, Installation & Configuration
Topic: Required Matlab components
Replies: 4
Views: 11644

Re: Required Matlab components

I see that Matlab coder is required to run embedded coder.
John
by resodad
Thu Sep 08, 2011 9:25 pm
Forum: Requirement, Installation & Configuration
Topic: Required Matlab components
Replies: 4
Views: 11644

Required Matlab components

Hi Lubin,
Can you please state what components / toolboxes are required to use the blockset?
e.g. Matlab, Simulink, Simulink Coder (formerly Real Time Workshop), and Embedded Coder...
did I miss anything?
Thanks,
John
by resodad
Tue Sep 06, 2011 12:33 pm
Forum: Advanced Simulink & RTW Questions
Topic: Interfacing with an VN100 (INS/AHRS SENSOR)
Replies: 5
Views: 14260

Re: Interfacing with an VN100 (INS/AHRS SENSOR)

Ismaeel,
I used SPI to read / write to EEPROM. It is somewhat different from your need, but some of the work may help you along. See my post:
SPI EEPROM Record and Playback on Explorer 16
Regards,
John
by resodad
Tue Aug 23, 2011 12:27 am
Forum: General Remark and Questions
Topic: trame ppm
Replies: 3
Views: 12122

Re: trame ppm

lecougar, use a 74LS04 inverter: http://www.datasheetcatalog.org/datashe ... 54LS04.pdf
John
by resodad
Fri Aug 19, 2011 5:47 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Lubin, No, there is no solution on microchip forum for this. The post I referred to had duplicate definitions, and that is not my case. CustomSD.c is written by my colleague here to manage file init/open/close/write commands: #include <p32xxxx.h> #include <stdlib.h> #include <string.h> #include <std...
by resodad
Fri Aug 19, 2011 12:59 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Lubin,
Are my files being executed out of order?

see this post on a microchip forum where there was a duplicate #define FALSE:
http://www.microchip.com/forums/m522926.aspx
John
by resodad
Thu Aug 18, 2011 6:49 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Lubin, maybe this is a clue? I tried replacing typedef enum _BOOL { FALSE = 0, TRUE } BOOL; /* Undefined size */ with typedef enum _BOOL { NO_FALSE = 0, YES_TRUE } BOOL; and the result was: sources/SD_Datalogger.c: In function 'SD_Datalogger_initialize': sources/SD_Datalogger.c:195:19: error: 'T1_IN...
by resodad
Thu Aug 18, 2011 6:01 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Lubin, Microchip tech support looked into it but could not find the problem. John
by resodad
Thu Aug 18, 2011 12:48 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

Re: build error in GenericTypeDefs.h

Thanks Lubin, I already tried that; now the error is "chased" to a new line of a different header file that depends on BOOL: In file included from ..\../CustomSD.c:8:0: ..\../FSIO.h:272:5: error: expected specifier-qualifier-list before 'BOOL' gmake: *** [CustomSD.o] Error 1 ### Real-Time Workshop b...
by resodad
Wed Aug 17, 2011 6:36 pm
Forum: bug reports
Topic: build error in GenericTypeDefs.h
Replies: 13
Views: 27467

build error in GenericTypeDefs.h

Hi Lubin, Is this a bug? the attached model generates this error when generating code: ..\../GenericTypeDefs.h:64:22: error: expected identifier before '(' token and the offending line of GenericTypeDefs.h is: typedef enum _BOOL { FALSE = 0, TRUE } BOOL; /* Undefined size */ which looks OK. I am usi...
by resodad
Tue Aug 09, 2011 8:36 pm
Forum: bug reports
Topic: restorePath, and slbuild errors, matlab working directory ch
Replies: 8
Views: 19370

restorePath, and slbuild errors, matlab working directory ch

Lubin and all, Here is an interesting problem: I attempt to build the attached model and Simulink produces "Undefined function or variable restorePath" and changes the working directory, e.g. I build in C:\Users\ij8977\Documents\MatlabWork\ArmFireX2 and then Matlab switches to C:\Users\ij8977\Docume...
by resodad
Tue Aug 09, 2011 5:12 pm
Forum: MPLAB IDE tricks
Topic: MPLAB X
Replies: 1
Views: 7964

MPLAB X

Blockset version 3.6 auto-generates a project folder for Microchip MPLAB X. Thanks Lubin--NICE! I am a beginner with MPLAB X, but these steps worked for me: Build the Simulink project and open MPLAB X. Click the Open Project icon (or File > Open Project… or Ctrl + Shift + O). Navigate to the Matlab ...
by resodad
Fri Jul 01, 2011 3:11 pm
Forum: dsPIC Peripherals
Topic: SD card data logger
Replies: 0
Views: 8800

SD card data logger

Hello Lubin and all, I would like to build a data logger and save data on an SD card. konsgn and I began work on this, but we are stuck ( see his post Re: PIC32 SPI Postby konsgn » Wed Apr 27, 2011 3:01 pm ). This was an attempt to adapt a c-language data logger given free by Microchip. Requirements...
by resodad
Thu Jun 16, 2011 9:03 pm
Forum: dsPIC Peripherals
Topic: OC minimum to maximum range
Replies: 1
Views: 6684

OC minimum to maximum range

Hello Lubin and all, I would like to produce a 1kHz PWM signal that varies in duty cycle from 0 to 100% in 10% steps. Please see attached simulink file. I control the duty cycle by counting presses of a button from 0 to 10. OC produces the correct signal except at 100%. At 100%, the wave form is hig...
by resodad
Wed May 11, 2011 3:07 pm
Forum: General Remark and Questions
Topic: PIC32 SPI
Replies: 7
Views: 21162

Re: PIC32 SPI

Lubin and all,
konsgn wrote: I've been working a lot on getting SD card capability for logging data ...
I have posted a .zip with all the relevant files in case that helps.
please comment on the method konsgn uses to write to an SD card. Is there a better way?
John
by resodad
Mon Mar 07, 2011 3:43 pm
Forum: Advanced Simulink & RTW Questions
Topic: Digital Output Write whole 16 bit word
Replies: 2
Views: 9236

Re: Digital Output Write whole 16 bit word

Thanks Lubin,
I will try the C file block; I am sure it is better than what I did. I attach my simulink file anyway for those of us who are scared of C :?
Thanks for the clear explanation of simultaneous write.
Cheers,
John
by resodad
Wed Mar 02, 2011 10:15 pm
Forum: Advanced Simulink & RTW Questions
Topic: Digital Output Write whole 16 bit word
Replies: 2
Views: 9236

Digital Output Write whole 16 bit word

Hi Lubin,
How can I send a 16 bit number to port B? The block only accepts a boolean type.
Also, please clarify the use of "Exact Simultaneous Write" in the digital output block.
Thanks,
John
by resodad
Tue Feb 15, 2011 6:56 pm
Forum: dsPIC Peripherals
Topic: UART
Replies: 1
Views: 7139

Re: UART

Hi Guillermo, I'm not sure what you're trying to accomplish. Do you need the data store for some other purpose? Maybe you can eliminate it? Why are you converting to double? Convert to uint8 after the sum keeps only the least significant 8-bit byte. You may have a problem with the order of execution...
by resodad
Fri Feb 04, 2011 2:00 pm
Forum: Requirement, Installation & Configuration
Topic: Getting Started PIC32 Cerebot
Replies: 1
Views: 8262

Getting Started PIC32 Cerebot

Here is an example to help newcommers get started. This is for Digilent's Cerebot 32MX4 development board, but useful for any board.
Lubin, if you think this is useful, please move it to Wiki Examples.
Regards, John
by resodad
Wed Feb 02, 2011 7:25 pm
Forum: Website
Topic: Set up a Wiki ?
Replies: 5
Views: 11569

Re: Set up a Wiki ?

Hi Lubin,
Where can I find help how to upload example files on the wiki? I tried and got:
"You do not have permission to create new pages. "
Also, is there still a sandbox? Where?
Thanks,
John
by resodad
Sun Jan 23, 2011 4:19 pm
Forum: General Remark and Questions
Topic: PIC32 SPI
Replies: 7
Views: 21162

Re: PIC32 SPI

Hi matgraci, Thanks for posting, I am trying your model. I am new to this... where did you save your c code? what did you name it? how did you connect it to the model? This is what I tried: Saved your code as SPIcode.c in the build directory, and entered the name SPIcode.c in the list of additional ...
by resodad
Wed Jan 12, 2011 5:33 pm
Forum: General Remark and Questions
Topic: PIC32 SPI
Replies: 7
Views: 21162

Re: PIC32 SPI

Hi Lubin, I am working with Konsgn to implement a SD card data logger on Cerebot 32MX4 (PIC32MX460F512L). I ran Microchip's example C program "MDD File System-SD Card" successfully. The setup uses SPI to read / write. Now to port to Simulink. We would like to have a Simulink block to write data over...
by resodad
Wed May 05, 2010 5:06 pm
Forum: General Remark and Questions
Topic: Enable a code Block at 480Hz
Replies: 3
Views: 6559

Re: Enable a code Block at 480Hz

Hi Jared, I think you mean to say you want to enable a block when the frequency of an EXTERNAL signal equals 480Hz. Is that right? If so, you might try connecting the signal to an input capture pin. set up the input capture to output period (type [4]) and compare the signal period to a constant ("co...
by resodad
Tue May 04, 2010 11:52 am
Forum: Requirement, Installation & Configuration
Topic: bad link
Replies: 7
Views: 14017

Re: bad link

Lubin, Sometimes the Microchip blockset works, sometimes it does not. I have not spent as much time with it as I have with yours. It's probably my error somewhere. I am trying to get the input capture block to send to UART. I will ask Microchip. Here is my brief comparison: Microchip Blockset: Good:...
by resodad
Mon May 03, 2010 5:40 pm
Forum: Requirement, Installation & Configuration
Topic: bad link
Replies: 7
Views: 14017

Re: bad link

Hi Lubin, I have both your blockset and the Microchip blockset installed. Is it normal for the microchip blockset to produce code with your name? See pasted below from the top of the c code generated by the attached model with only Microchip blocks. What's going on? Thanks, John /* * File: main.c * ...
by resodad
Sat May 01, 2010 12:07 pm
Forum: dsPIC Peripherals
Topic: SPI EEPROM Record and Playback on Explorer 16
Replies: 17
Views: 35553

Re: SPI EEPROM Record and Playback on Explorer 16

Hi Lubin,
LubinKerhuel wrote:place a link to this demo
That would be great. Then when I forget :? how to do it, I can easily find it.
Cheers,
John