Begginer dspic30f Questions

leviatan1 wrote on Saturday, May 10, 2014:

Hello, im beggining with FreeRTOS, and i want to put data in a port, lets say blink a led, i cant understand how to set port data with a task, i would like some examples i tried to understand the demos but i couldnt, can you help me? how to blink a led?

the second question is, if i set the configuration bits with a tx x8pll should i delete something in the freeRTOS source files? cause i set the config bits in the mplab ide.
please explain like im a total begginer because i am. thanks everyone who can help

davedoors wrote on Saturday, May 10, 2014:

i cant understand how to set port data with a task

There are lots of examples of flashing LEDs. In its simplest form

void flash_task( void *x ) {
while(1){
vTaskDelay(100);
toggle_led();
}
}

toggle_led() is the function you write to write to the port.

the second question is

As I remember you can set bits in the source code or in the MPLAB project, but not both. If the project defines the bits in the source code and you want to set them in the project then I guess you will have to delete something. Read the documentation for MPLAB.

leviatan1 wrote on Saturday, May 10, 2014:

FreeRTOS does not set anything for the cpu clock? i mean if i don’t do it, the FreeRTOS source code does not set anything that has to do with config bits?

I was asking about the toggle_led function in your example, how do i set a bit in a port? using Assembler? should i create a *.h file?

richard_damon wrote on Saturday, May 10, 2014:

FreeRTOS does not do anything to “setup” your basic processor, except for those things that it exclusively uses. It will configure the tick timer and related interrupt.

You need to configure the rest of the processor in the manner that you need.

If you are not familiar with the processor, I would suggest that you look at the basic Microchip provided examples to understand how the processor works, and how to write code for it.

tlafleur wrote on Sunday, May 11, 2014:

Prior to starting with an RTOS, you should understand the basics of the
processor your using…
Read the data sheet for the part, understand how I/O works and start
learning about all of the peripheral devices on the part…

Then its time to explore RTOS…

here is a good place to start…

Two great books on the PIC24/dsPIC:

Microcontrollers: From Assembly Language to C Using the PIC24 Family <—
great book, New edition do any time now

Programming 16-bit Microcontrollers in C. Flying the PIC24. | Pilot's Logbook <— 2nd best

http://www.amazon.com/Beginners-Guide-Programming-PIC24-dsPIC33/dp/1468152637/ref=sr_1_3?ie=UTF8&qid=1399777879&sr=8-3&keywords=reese++pic24

On Sat, May 10, 2014 at 4:15 PM, Richard Damon
richard_damon@users.sf.netwrote:

FreeRTOS does not do anything to “setup” your basic processor, except for
those things that it exclusively uses. It will configure the tick timer and
related interrupt.

You need to configure the rest of the processor in the manner that you
need.

If you are not familiar with the processor, I would suggest that you look
at the basic Microchip provided examples to understand how the processor
works, and how to write code for it.

Begginer dspic30f Questionshttps://sourceforge.net/p/freertos/discussion/382005/thread/1a82acc8/?limit=25#ce45

Sent from sourceforge.net because you indicated interest in
SourceForge.net: Log In to SourceForge.net

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net

~~ _/) _/) _/) ``` _/) ~~

Tom Lafleur
(858) 759-9692