- On the website : http://www.kerhuel.eu/RTWdsPIC
- The blockset contains few examples.
Lubin
Search found 616 matches
- Mon May 05, 2008 11:37 pm
- Forum: Requirement, Installation & Configuration
- Topic: 100% beginners
- Replies: 4
- Views: 13722
- Mon May 05, 2008 11:32 pm
- Forum: dsPIC Peripherals
- Topic: A more friendly way to create a chip select with SPI ?
- Replies: 3
- Views: 12753
Re: A more friendly way to create a chip select with SPI ?
Hi Martin, This is your original solution: interfacage_SPI_original.png The first solution I propose is to disable the Chip first, and enable it just after... interfacage_SPI_Sol1.png The second solution I propose is to configure the SPI read/write so as to read and write a data. In this way, the SP...
- Wed Apr 30, 2008 11:34 pm
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Data Logging to LabVIEW
- Replies: 2
- Views: 14897
Re: Data Logging to LabVIEW
Hi Masaki, bits 7-4: Number of the channel (0 to 15) bits 3-2: type of data corresponding to the number of bytes composing the data (1 to 4) bits 1-0: signature of the byte controls = "01" Correct ! Protocol.png If it's so, my next question is what happens if data happen to have confusing values res...
- Wed Apr 30, 2008 11:10 pm
- Forum: dsPIC Peripherals
- Topic: Question about SPI
- Replies: 0
- Views: 9042
Question about SPI
Hi Michal, I respond to your mail on the forum. Is this using internal hardware SPI module in dsPIC, or it's using softwarable SPI from blockset It use the hardware SPI peripheral. If I want to use i.e. 6 SPI modules to communicate with 6 peripheral devices, but my PIC has only 2 modules, can I to d...
- Mon Apr 28, 2008 10:41 pm
- Forum: bug reports
- Topic: C Function Call error for output size != 1
- Replies: 1
- Views: 9741
Re: C Function Call error for output size != 1
Thanks for repporting that bug.
It is now corrected and will be available in the next release (next to V0.97)
Lubin
It is now corrected and will be available in the next release (next to V0.97)
Lubin
- Mon Apr 28, 2008 9:07 pm
- Forum: bug reports
- Topic: CAN module with dspic33fj256gp710 or pic24fj128ga010
- Replies: 3
- Views: 13705
Re: CAN module with dspic33fj256gp710 or pic24fj128ga010
Hi Martin, 33f pic family endowed with a CAN module have the ECAN peripheral implemented. As mentionned in the release note, ECAN is not support yet. Only te CAN peripheral is supported so far. ECAN peripheral is on the road map... The fastest and easiest way to implement the ECAN driver is to use t...
- Sat Apr 26, 2008 7:34 pm
- Forum: General Remark and Questions
- Topic: Creating my own block set
- Replies: 1
- Views: 3960
Re: Creating my own block set
Look at the help of the mathworks Real time embedded coder.
It's quite a piece of work ; Good luck !
Lubin
It's quite a piece of work ; Good luck !
Lubin
- Sat Apr 26, 2008 4:44 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: Some help needed model for self-balancing
- Replies: 8
- Views: 22712
Re: Some help needed model for self-balancing
Oups, mistakes,
zoh method must be used to discretize the model, not tustin (becaue input is fixed for 20ms). The parameters for the Q vector changes.
the script is :
zoh method must be used to discretize the model, not tustin (becaue input is fixed for 20ms). The parameters for the Q vector changes.
the script is :
- Sat Apr 26, 2008 4:36 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: Some help needed model for self-balancing
- Replies: 8
- Views: 22712
Re: Some help needed model for self-balancing
If you have all sensor and if they are not too noisy, it may work :) The state space model must be correct otherwise the controllor will not be adapted. I modify the B vector that I missed up on the previous script. With this new vector, the position of the robot can be controlled. I also set the sa...
- Sat Apr 26, 2008 3:06 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: Some help needed model for self-balancing
- Replies: 8
- Views: 22712
Re: Some help needed model for self-balancing
Hi, I could not open the pdf link you provide ; so I realized the model in discret time on simulink (Te = 1ms) : ModeleRobot.png If you want a model in continuous time, change 1/z with a block 1/s. You also have to change the Az,Bz,Cz,Dz and K coefficient to their continuous time equivalent. I made ...
- Sat Apr 26, 2008 1:37 pm
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Request Support for DSPIC33FJ64(128)MC802
- Replies: 9
- Views: 21617
Re: Request Support for DSPIC33FJ64(128)MC802
Hi Mariano, ECAN engine with the standard CAN libraries. I.E. I think you should be able to use any chip with ECAN as if it had CAN, the main differences are only in timing When I looked how I could adapt the C code written for CAN driver to the ECAN driver, it seems that there are many differences....
- Thu Apr 24, 2008 11:26 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: Some help needed model for self-balancing
- Replies: 8
- Views: 22712
Re: Some help needed model for self-balancing
Hi, I guess that you need a state space model. LQR is the method to compute your controller (the K gain). State space model can be done very easily using simulink using only gain blocks (that can make calculation with vectors and matrix) and a block 1/s or 1/z depending if you are modeling your syst...
- Thu Apr 24, 2008 11:17 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: Question about Filter
- Replies: 3
- Views: 14779
Re: Question about Filter
I will have a look on kalman filter to estimate the gyro bias. But I could not give a date when I will do it.
You could do it anyway !
You could do it anyway !
- Thu Apr 24, 2008 11:15 pm
- Forum: General Remark and Questions
- Topic: circuit interface between MATLAB and dsPIC?
- Replies: 5
- Views: 11092
Re: circuit interface between MATLAB and dsPIC?
a connection to upload the .hex file into the dsPIC ? <<< use tiny bootloader with 5 pin MCLR ,VDD ,GND ,TX ,RX right ? :? More or less true: If you use a boot loader (like tinybld ; google it !) you need first to program your chip with the bootloader soft. To do so, you will have to buy a programm...
- Thu Apr 24, 2008 11:00 pm
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Request Support for DSPIC33FJ64(128)MC802
- Replies: 9
- Views: 21617
Re: Request Support for DSPIC33FJ64(128)MC802
Hi Mariano, Thanks for that info. I did not update my dsPIC list from a while now. I will have a look soon and will try to get samples from Microchip. When are you planning to use theses parts ? (are you waiting for the update of the dsPIC toolbox ?) Anyway, note that the ECAN peripheral is still no...
- Tue Apr 15, 2008 9:19 am
- Forum: General Remark and Questions
- Topic: dsPIC33F DMA
- Replies: 1
- Views: 3793
Re: dsPIC33F DMA
DMA is not used yet by the blockset. DMA will be used when the CAN peripheral block will be extended to support the more recent ECAN peripheral.
Lubin
Lubin
- Tue Apr 08, 2008 12:09 pm
- Forum: Requirement, Installation & Configuration
- Topic: MPLAB matlab
- Replies: 2
- Views: 11012
Re: MPLAB matlab
I do not have enough information to help.
Are you compiling inside matlab or using MPLAB ?
Similar question have been posted on the forum. Could you check if one response would not correct the problem ?
Lubin
Are you compiling inside matlab or using MPLAB ?
Similar question have been posted on the forum. Could you check if one response would not correct the problem ?
Lubin
- Fri Apr 04, 2008 10:26 am
- Forum: General Remark and Questions
- Topic: Data Comunication - rs232GUI - Signed Number
- Replies: 1
- Views: 4408
Data Comunication - rs232GUI - Signed Number
Hi Alberto, Receiving signed data is a problem of interpretation. The m code that plot data as signed for int16 data type is done. Just press the "dflt signe" (for default signed) at the top of the rs232gui user interface and this m code will replace current m code in the interface. rs232GUI_dfltSig...
- Sat Mar 29, 2008 11:41 am
- Forum: Advanced Simulink & RTW Questions
- Topic: How much RAM area can a program use?
- Replies: 12
- Views: 30090
Re: How much RAM area can a program use?
C code seems Ok, Sampling time of some blocks or subsystem seems to be the problem on your model. Any blocks with a sample time set of inf ( or set to -1, where value inf is inherited) will execute only once at the initialisation time. Using the "Sample Time Color" option of the Port/Signal display ...
- Wed Mar 26, 2008 1:23 am
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Implementing the C Function Call
- Replies: 5
- Views: 22848
Re: Implementing the C Function Call
Will check that. One advantage to initialize the way you do is that your initialization is last (not erased by the "standard initialisation code) However, I noticed a possible bug on the file myQEI.c, in the initialisation function : void QEIInit(void) { // Configure I/O Ports ADPCFG = 0xFFFF; //ADP...
- Wed Mar 26, 2008 12:55 am
- Forum: Advanced Simulink & RTW Questions
- Topic: How much RAM area can a program use?
- Replies: 12
- Views: 30090
Optimizing RAM usage
Hi Masaki, I provide few tricks to optimize RAM usage. First of all, checking the "inline parameters" greatly reduce RAM usage. (It means that all constant variables are stored inside the ROM memory rather than inside the RAM) inline.png About storing data inside a vector; I noticed that the generat...
- Fri Mar 21, 2008 1:09 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: How much RAM area can a program use?
- Replies: 12
- Views: 30090
Re: How much RAM area can a program use?
Hi Masaki, I do not know exactly what simulink is doing in your case. It may be some Simulink tricks. It would be easier to see the mdl file to propose tips. Could you send it (either with the forum upload function or by email if you can't upload (In the last case, tell me if I can publish it on the...
- Fri Mar 21, 2008 1:47 am
- Forum: General Remark and Questions
- Topic: Dspic and ICD2 problem
- Replies: 2
- Views: 6549
Re: Dspic and ICD2 problem
You could also check that the your chip is correctly powered.
If the chip is not powered, the return code is either FF or 0 and will give a "wrong" chip ID.
Btw, I'm not an ICD2 expert ! (use a bootloader like tinybld, much faster and easier)
Lubin
If the chip is not powered, the return code is either FF or 0 and will give a "wrong" chip ID.
Btw, I'm not an ICD2 expert ! (use a bootloader like tinybld, much faster and easier)
Lubin
- Fri Mar 21, 2008 1:34 am
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Implementing the C Function Call
- Replies: 5
- Views: 22848
Re: Implementing the C Function Call
Hi Mariano, I was working on this post while you posted your solution. I keep it there since it was a piece of work. to resume, I declared the global variable using a different way. (yours may be better for this example). I do not like the way you initialize the QEI peripheral. It would make better ...
- Sat Mar 08, 2008 4:28 pm
- Forum: bug reports
- Topic: Output Compare block - Behaviour at edges values for OC1max
- Replies: 4
- Views: 14728
Re: Output Compare block - Behaviour at edges values for OC1max
Yes, hardware PWM signal generation can be done using the "motor PWM peripheral"Masaki wrote:does your software support hardware PWM signal generation?
Lubin
- Fri Mar 07, 2008 1:19 am
- Forum: General Remark and Questions
- Topic: Some help needed reg data conversion for this model
- Replies: 2
- Views: 8195
Re: Some help needed reg data conversion for this model
Barry, I did not understand what the purpose of the model you posted is. However, I corrected few tricks. But I guess that it will not do the job you are expecting. I posted a second model to use for simulation. I replaced the ADC block by a sinus generator block. It makes you able to simulates the ...
- Fri Mar 07, 2008 1:03 am
- Forum: General Remark and Questions
- Topic: RTWdsPIC for MATLAB 7R1
- Replies: 1
- Views: 3831
Re: RTWdsPIC for MATLAB 7R1
Incompatibility with earlier version of matlab make new version of the blockset not working on matlab prior to matlab 2006a.
I do not plan to extend the compatibility with old matlab version, but to continue to support matlab from the version 2006a to the actual matlab version.
I do not plan to extend the compatibility with old matlab version, but to continue to support matlab from the version 2006a to the actual matlab version.
- Tue Mar 04, 2008 2:51 am
- Forum: Requirement, Installation & Configuration
- Topic: Configure Model won't open
- Replies: 1
- Views: 9651
Re: Configure Model won't open
Hi, Configure Model for dsPIC Target This configures some simulink parameters (fixed step solver etc...) but do not change the target. To change the target to 30f6010A, open the " dsPIC MASTER " block. http://www.kerhuel.eu/RTWdsPIC/Blocks/Img/Master.png You will find the list of the supported chips...
- Sat Mar 01, 2008 6:16 pm
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Encoder interface?
- Replies: 3
- Views: 13463
Re: Quadrature Encoder interface? (QEI)
Hi Jim, I will be honest: the Quadrature Encoder Interface (QEI) Peripheral is not in my road map yet. I did not use it yet and I am not planning to use it in the near future. So, I will add it to the blockset if I get some free time to do it, or if many guys ask for it. Note however that you could ...
- Thu Feb 28, 2008 9:22 pm
- Forum: bug reports
- Topic: probleme - Matlab Version
- Replies: 3
- Views: 13718
Re: probleme - Matlab Version
The block "Interface Tx-Matlab" is available in all the version of the toolbox.
Anyway, you could also start the user interface of this block by typing "rs232gui" at the matlab prompt.
Anyway, you could also start the user interface of this block by typing "rs232gui" at the matlab prompt.
- Wed Feb 27, 2008 9:54 pm
- Forum: bug reports
- Topic: Output Compare block - Behaviour at edges values for OC1max
- Replies: 4
- Views: 14728
Re: OC1max value in Output Compare block
Masaki, I post the information from your mail here. Problem_OutputCompare_fastEvents.png In each experiments, I set MaxChannel of OC block to 1e-4, 2e-5,1e-5 to get 10kHz, 50kHz, 100kHz PWM signals. Channels Input Type is set to be 10 to get variable Down duration. What I notice is that the ratio of...
- Tue Feb 26, 2008 10:09 pm
- Forum: bug reports
- Topic: Output Compare block - Behaviour at edges values for OC1max
- Replies: 4
- Views: 14728
Re: OC1max value in Output Compare block
Hi Masaki, I upload the file I received by mail. testan1.gif What I think strange is that the pulse duration changes x2000, x400, x200 times. These numbers should be the same as OC1max values, as they represent the maximum Allowable input to Output Capture block. The pulse duration is the one define...
- Mon Feb 25, 2008 11:08 pm
- Forum: bug reports
- Topic: Slow Compilation Time
- Replies: 2
- Views: 11363
Re: RTW vs. RTW embedded coder
I notice this inconvenient. As I am building more and more complex models, it takes more and more time to get compiled. However, I am usually using a faster computer and it is Ok (lets say 25 sec from the 'click' push button to get the .hex file). Compilation time also depend if you ask for an html ...
- Mon Feb 25, 2008 10:53 pm
- Forum: General Remark and Questions
- Topic: circuit interface between MATLAB and dsPIC?
- Replies: 5
- Views: 11092
Re: circuit interface between MATLAB and dsPIC?
Hi Kiara,
Are you talking about
- a connection to upload the .hex file into the dsPIC ?
- a connection to get and plot data in real time through UART and COM port on the computer ? (send data is also possible)
Are you talking about
- a connection to upload the .hex file into the dsPIC ?
- a connection to get and plot data in real time through UART and COM port on the computer ? (send data is also possible)
- Sat Feb 23, 2008 4:36 pm
- Forum: General Remark and Questions
- Topic: IMU inertial Measurement Unit
- Replies: 3
- Views: 6900
Re: IMU inertial Measurement Unit
Hi Laura Andrea,
You will find on the IMU page the model that generate the C code to interface a dsPIC 30f4012 with the gyro ADIS16080. It is very fast to change the MCU from 30f4012 to 30f4013.
Lubin
You will find on the IMU page the model that generate the C code to interface a dsPIC 30f4012 with the gyro ADIS16080. It is very fast to change the MCU from 30f4012 to 30f4013.
Lubin
- Thu Feb 21, 2008 12:19 am
- Forum: General Remark and Questions
- Topic: Block ordering ?
- Replies: 1
- Views: 4762
Re: Block ordering ?
Hi Johan, I could not get time to post an example. I try to make the explanation understandable... If you want to force the execution order of blocks that are not connected, this option allows to add either an input, an output, or both to the block. These virtual connections allow to force the order...
- Wed Feb 20, 2008 1:50 pm
- Forum: General Remark and Questions
- Topic: Mplab Or Matlab RTW compilation ?
- Replies: 7
- Views: 14795
Re: Mplab Or Matlab RTW compilation ?
the C30 compiler is not included into your environment path.
try to re-install the C30 compiler from microchip.
follow the procedure described on this page
Beware carrefull : The path must be included to the environment
Then, try again to type
>> !pic30-gcc -v
at the matlab prompt.
try to re-install the C30 compiler from microchip.
follow the procedure described on this page
Beware carrefull : The path must be included to the environment
Then, try again to type
>> !pic30-gcc -v
at the matlab prompt.
- Tue Feb 19, 2008 11:59 pm
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Support for CAN Module?
- Replies: 34
- Views: 73351
Re: Support for CAN Module?
CAN peripheral is available on current version of the dsPIC blockset. I will write the doccumentation soon.
ECAN is not available yet. Is anybody interrested by ECAN ?
ECAN is not available yet. Is anybody interrested by ECAN ?
- Tue Feb 19, 2008 1:26 pm
- Forum: General Remark and Questions
- Topic: Mplab Or Matlab RTW compilation ?
- Replies: 7
- Views: 14795
Re: Mplab Or Matlab RTW compilation ?
From the error message, it's not very clear if - it does not find the compiler - it does not find the file dsPIC_OutputCompare_Interrupt.c could you type >> !pic30-gcc -v at the matlab prompt to see if it find the C30 compiler ? you should get >> !pic30-gcc -v Using built-in specs. Target: pic30-cof...
- Tue Feb 19, 2008 9:15 am
- Forum: General Remark and Questions
- Topic: Mplab Or Matlab RTW compilation ?
- Replies: 7
- Views: 14795
Re: Mplab Or Matlab RTW compilation ?
Is the C30 compiler (from microchip) installed on your system ?
- Mon Feb 18, 2008 11:21 pm
- Forum: Advanced Simulink & RTW Questions
- Topic: Question about Filter
- Replies: 3
- Views: 14779
Re: Question about Filter
Low pass filter with a cut off frequency at 1 Hz : 1Hz means 2*pi rad/s which is approximatively 6 rad/s. matlab code : >> Filter_1Hz = tf([6],[1 6]) Transfer function: 6 ----- s + 6 >> bode(Filter_1Hz) >> You will get : Filter_1Hz.png We have a 45° phase and a -3db cut off at 6 rad/s which is appro...
- Mon Feb 18, 2008 11:10 pm
- Forum: Request for new functions / Peripheral / Chip support
- Topic: Question about I2C
- Replies: 2
- Views: 12351
Re: Question about I2C
Hi Johan, On the example I have build, I read only - 4 data for states 1 ; 3 and 5 - 2 data for states 2 ; 3 and 6 But you can easily adapt it to read 18 and 12 data. I use an Enabled Subsystem to choose wether I am reading 4 or 2 data. Enable_Subsystem.png The model : Model_General.png I use a bus ...
- Mon Feb 18, 2008 8:47 pm
- Forum: bug reports
- Topic: Some help needed : Error while compiling
- Replies: 3
- Views: 15356
Re: Some help needed : Error while compiling
I suggest to compile from simulink (matlab)
to get your .hex file, uncheck the "generate code only", see post : viewtopic.php?f=1&t=89#p225
to get your .hex file, uncheck the "generate code only", see post : viewtopic.php?f=1&t=89#p225
- Mon Feb 18, 2008 8:45 pm
- Forum: General Remark and Questions
- Topic: Mplab Or Matlab RTW compilation ?
- Replies: 7
- Views: 14795
Re: Mplab Or Matlab RTW compilation ?
The MASTER block set the diagram for a 30f6012 dsPIC (not 6011). RA2 do not exist on the dsPIC 30f6012, nor on the dsPIC 6011. I changed RA2 into RB3. To import the C code generated, you must follow the procedure described here . To get the .hex file from simulink in a "one click button procedure", ...
- Mon Feb 18, 2008 8:15 pm
- Forum: Requirement, Installation & Configuration
- Topic: error while opening Master Block or compiling model
- Replies: 3
- Views: 14636
Re: error while opening Master Block or compiling model
The blockset is not compatible yet with the MPLAB plugging that open and "import" the C code generated into MPLAB. I recommend compiling the mdl schematic into a .hex file from simulink. You can import C code using the "custom C function block" (only on the registered version of the blockset). If yo...
- Thu Feb 14, 2008 4:55 pm
- Forum: Requirement, Installation & Configuration
- Topic: How to change directory?
- Replies: 20
- Views: 40986
Re: How to change directory?
There is a know bug for 24fj PIC. I do not know why, if anybody has a suggestion. The solution is described on the release page: http://www.kerhuel.eu/RTWdsPIC/ReleaseNotes.html Know bug : before compiling schematic for dsPIC 24f, you must remove the line 56 of Generic.h file which is in "C:\Program...
- Thu Feb 14, 2008 1:28 pm
- Forum: Requirement, Installation & Configuration
- Topic: How to change directory?
- Replies: 20
- Views: 40986
Re: How to change directory?
I can't see the error on the image (it is cut) however, I guess that it says that the linker script ***.gld is missing.
This script is provided with the C30 compiler. Could you check that you installed it and that it is present in the correct directory?
This script is provided with the C30 compiler. Could you check that you installed it and that it is present in the correct directory?
- Thu Feb 14, 2008 12:59 am
- Forum: Request for new functions / Peripheral / Chip support
- Topic: RTWdsPIC: I2C & Complete version ?
- Replies: 4
- Views: 14276
Re: RTWdsPIC: I2C & Complete version ?
I2C is available now. (see release informations)
Go to http://www.kerhuel.eu/RTWdsPIC/download.html to download the last version of the blockset.
Go to http://www.kerhuel.eu/RTWdsPIC/download.html to download the last version of the blockset.
- Wed Feb 13, 2008 8:50 pm
- Forum: Requirement, Installation & Configuration
- Topic: How to change directory?
- Replies: 20
- Views: 40986
Re: How to change directory?
It's corrected, C30 can now be installed in the directory : C:\Programmi\Microchip\MPLAB C30 or in the directory : C:\Program Files\Microchip\MPLAB C30
Could you give a try to the new version ? (download it on from website)
Could you give a try to the new version ? (download it on from website)
- Wed Feb 13, 2008 7:23 pm
- Forum: Requirement, Installation & Configuration
- Topic: How to change directory?
- Replies: 20
- Views: 40986
Re: How to change directory?
This is a bug !
I'll correct that. Thanks for screenshoot and bug description...
I'll correct that. Thanks for screenshoot and bug description...