Skip to content

Instantly share code, notes, and snippets.

View nmannan97's full-sized avatar

Naeem Mannan nmannan97

  • SJSU student
View GitHub Profile
@nmannan97
nmannan97 / RTOS,Lab7,EE138
Last active May 25, 2018 06:06
RTOS lab to make operating system for a PID controlled motor. One button would make a motor run at 1500 RPM with PID. A second button would control the position. The last would allow for free movement of the motor.
//***************Lab 7*************/
/*Notes:
~Mutex = mutual exclusion
~A semaphore that is used for mutual exclusion must always be returned
~A mutex is a type of semaphore
~To create a mutex type semaphore, use the xSemaphoreCreateMutex() API function.
~xSemaphoreTake( xMutex, portMAX_DELAY );
~ The following line will only execute once the mutex has been successfully obtained.
~xSemaphoreGive( xMutex ); The mutex MUST be given back!
~main() simply creates the mutex, creates the tasks, then starts the scheduler
@nmannan97
nmannan97 / RTOS,Lab7,EE138
Created May 25, 2018 05:42
RTOS lab using FreeRTOS 8.0.1 for Atmel studios for a SAMD20J and pre-made PCB board for hardware interfacing. Operating System made from scratch to utilize a better timing management instead of the basic programming. RTOS was utilized to control a PID system for a motor to move at 1500 RPM on command by user input from a keypad. On a separate c…
//***************Lab 7*************/
/*Notes:
~Mutex = mutual exclusion
~A semaphore that is used for mutual exclusion must always be returned
~A mutex is a type of semaphore
~To create a mutex type semaphore, use the xSemaphoreCreateMutex() API function.
~xSemaphoreTake( xMutex, portMAX_DELAY );
~ The following line will only execute once the mutex has been successfully obtained.
~xSemaphoreGive( xMutex ); The mutex MUST be given back!
~main() simply creates the mutex, creates the tasks, then starts the scheduler