From eac39cdc77ad5fdaf7b245cbce5c92f105ac75bf Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Fri, 11 Dec 2015 18:28:43 +0530 Subject: AVR ADC checked after some modifications --- 2.3-1/macros/Hardware/AVR/AVRADCSetup.bin | Bin 4168 -> 4168 bytes 2.3-1/macros/Hardware/AVR/AVRADCSetup.sci | 2 +- 2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin | Bin 0 -> 5760 bytes 2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci | 39 ++++++++++++++++++++++++++++++ 2.3-1/macros/Hardware/AVR/lib | Bin 836 -> 860 bytes 2.3-1/macros/Hardware/AVR/names | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin create mode 100644 2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci (limited to '2.3-1/macros/Hardware') diff --git a/2.3-1/macros/Hardware/AVR/AVRADCSetup.bin b/2.3-1/macros/Hardware/AVR/AVRADCSetup.bin index 6cf45dc9..44e3d790 100644 Binary files a/2.3-1/macros/Hardware/AVR/AVRADCSetup.bin and b/2.3-1/macros/Hardware/AVR/AVRADCSetup.bin differ diff --git a/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci b/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci index d9897fc3..ce9117d0 100644 --- a/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci @@ -2,7 +2,7 @@ function AVRADCSetup(prescalar,adc_ref) // Function to initialise ADC of AVR // // Calling Sequence -// AVRSetupADC(uint8 prescalar, uint8 adc_ref) +// AVRADCSetup(uint8 prescalar, uint8 adc_ref) // // Parameters // prescalar: prescalar to be used for generating ADC clock (0-7) diff --git a/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin new file mode 100644 index 00000000..6ae56fda Binary files /dev/null and b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin differ diff --git a/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci new file mode 100644 index 00000000..7e1c234f --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci @@ -0,0 +1,39 @@ +function AVRPWMSetup(timer, prescalar, waveform_mode, output_mode) +// Function to initialise PWM of AVR +// +// Calling Sequence +// AVRSetupADC(timer, prescalar, waveform_mode, output_mode) +// +// Parameters +// timer: timer to be used for PWM generation (0,1,2) +// prescalar: prescalar to be used for generating PWM waveform (0-7) +// waveform_mode: decides type of waveform generation +// 0 -> Normal mode +// 1 -> Phase correct mode +// 2 -> CTC mode +// 3 -> Fase PWM mode +// output_mode: decides the compare output mode. (0-3) +// behaviour of the output is different for different inputs +// depending upon 'waveform_mode' chosen. +// ***Refer datasheet for more description about above modes +// +// Description +// This function initialises PWM of AVR with given parameters. 'timer' +// decides which of the three (0,1,2) timers available to be used. The +// 'prescalar' is needed for deciding PWM clock. Select appropriate prescalar +// depending on MCU clock. Choose required pwmmode using 'waveform_generation' +// and 'output_mode'. Please refer datasheet for more description of 'wafefom_mode' +// and 'output mode'. +// Examples +// AVRPWMSetup(0,1,2,2) +// +// See also +// AVRPMWSetDuty +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib index d08afbd3..aa4d6113 100644 Binary files a/2.3-1/macros/Hardware/AVR/lib and b/2.3-1/macros/Hardware/AVR/lib differ diff --git a/2.3-1/macros/Hardware/AVR/names b/2.3-1/macros/Hardware/AVR/names index 6e5b61bd..afd171ec 100644 --- a/2.3-1/macros/Hardware/AVR/names +++ b/2.3-1/macros/Hardware/AVR/names @@ -2,6 +2,7 @@ AVRADCSetup AVRDigitalIn AVRDigitalOut AVRDigitalSetup +AVRPWMSetup AVRReadADC GetAVRSupportFunctions GetPeripheral -- cgit From 66ae4f251032aca6b7063353beee6c387a58418e Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Thu, 17 Dec 2015 14:48:36 +0530 Subject: Code generation for Arduino changed. DC motor added to Arduino. --- 2.3-1/macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 0 -> 3564 bytes 2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci | 31 +++++++++++++++++++++++++ 2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.bin | Bin 0 -> 2428 bytes 2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.sci | 24 +++++++++++++++++++ 2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin | Bin 5760 -> 5760 bytes 2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci | 2 +- 2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin | Bin 0 -> 3552 bytes 2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci | 31 +++++++++++++++++++++++++ 2.3-1/macros/Hardware/AVR/lib | Bin 860 -> 932 bytes 2.3-1/macros/Hardware/AVR/names | 3 +++ 10 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 2.3-1/macros/Hardware/AVR/AVRGetTimerValue.bin create mode 100644 2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci create mode 100644 2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.bin create mode 100644 2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.sci create mode 100644 2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin create mode 100644 2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci (limited to '2.3-1/macros/Hardware') diff --git a/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.bin b/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.bin new file mode 100644 index 00000000..26b4b47e Binary files /dev/null and b/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.bin differ diff --git a/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci b/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci new file mode 100644 index 00000000..ab0146aa --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRGetTimerValue.sci @@ -0,0 +1,31 @@ +function counts = AVRGetTimerValue(timer) +// Function to set the prescalar for timer. +// +// Calling Sequence +// AVRgetTimerValue(timer, prescalar) +// +// Parameters +// timer: timer to be set up (0,1,2) +// prescalar: prescalar to be used for generating PWM waveform (0-7) +// ***Refer datasheet for more description about timer +// +// Description +// This function sets prescalr for timers. 'timer' decides which of the +// three (0,1,2) timers available to be used. The 'prescalar' is needed for +// deciding timer clock. Select appropriate prescalar depending on MCU clock +// and requirement. +// +// +// Examples +// AVRTimerSetup(0,1) //Timer 0 with no scaling +// +// See also +// AVRGetTimerValue +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.bin b/2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.bin new file mode 100644 index 00000000..f3c9e3e4 Binary files /dev/null and b/2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.bin differ diff --git a/2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.sci b/2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.sci new file mode 100644 index 00000000..0042540a --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRPWMSetDuty.sci @@ -0,0 +1,24 @@ +function AVRPWMSetDuty(timer, duty) +// Function to set duty for PWM of AVR +// +// Calling Sequence +// AVRPWMSetDuty(uint8 timer, uint8 duty) +// +// Parameters +// timer: timer to be used for PWM generation (0,1,2) +// duty: duty for PWM waveform (0-100) +// +// Description +// This function sets duty for PWM waveform according to given parameters. +// +// Examples +// AVRPWMSetDuty(0,10) //Sets 10% duty for timer 0 output. +// +// Authors +// Siddhesh Wani +// +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin index 6ae56fda..971e43ee 100644 Binary files a/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin and b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.bin differ diff --git a/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci index 7e1c234f..1bee050d 100644 --- a/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRPWMSetup.sci @@ -2,7 +2,7 @@ function AVRPWMSetup(timer, prescalar, waveform_mode, output_mode) // Function to initialise PWM of AVR // // Calling Sequence -// AVRSetupADC(timer, prescalar, waveform_mode, output_mode) +// AVRPWMSetup(timer, prescalar, waveform_mode, output_mode) // // Parameters // timer: timer to be used for PWM generation (0,1,2) diff --git a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin new file mode 100644 index 00000000..65e8f454 Binary files /dev/null and b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin differ diff --git a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci new file mode 100644 index 00000000..6316cdd7 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci @@ -0,0 +1,31 @@ +function AVRTimerSetup(timer, prescalar) +// Function to set the prescalar for timer. +// +// Calling Sequence +// AVRTimerSetup(timer, prescalar) +// +// Parameters +// timer: timer to be set up (0,1,2) +// prescalar: prescalar to be used for generating PWM waveform (0-7) +// ***Refer datasheet for more description about timer +// +// Description +// This function sets prescalr for timers. 'timer' decides which of the +// three (0,1,2) timers available to be used. The 'prescalar' is needed for +// deciding timer clock. Select appropriate prescalar depending on MCU clock +// and requirement. +// +// +// Examples +// AVRTimerSetup(0,1) //Timer 0 with no scaling +// +// See also +// AVRGetTimerValue +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib index aa4d6113..b1986824 100644 Binary files a/2.3-1/macros/Hardware/AVR/lib and b/2.3-1/macros/Hardware/AVR/lib differ diff --git a/2.3-1/macros/Hardware/AVR/names b/2.3-1/macros/Hardware/AVR/names index afd171ec..126da77a 100644 --- a/2.3-1/macros/Hardware/AVR/names +++ b/2.3-1/macros/Hardware/AVR/names @@ -2,8 +2,11 @@ AVRADCSetup AVRDigitalIn AVRDigitalOut AVRDigitalSetup +AVRGetTimerValue +AVRPWMSetDuty AVRPWMSetup AVRReadADC +AVRTimerSetup GetAVRSupportFunctions GetPeripheral InsertPeripheralInList -- cgit