We have an ongoing project based around a ATTiny4313 AVR controller and among other features it requires a feature of PWM generation on 1 or 3 channels, depending upon selection by a button / switch. We are implementing the other features, while we want someone to come up with a code for the PWM generation because our team is busy with the rest.
PD3 = DOWN Button,
PD2 = UP Button,
PB2 (OC0A) = PWM_R,
PB3 (OC1A) = PWM_G,
PB4 (OC1B) = PWM_B.
What we want you to program is detailed in 4 cases :
POWER-ON: Code initializes the MCU, reads the last stored value of PWM in an EEPROM memory location (00h) and also reads PWM Channels to activate from EEPROM Memory location (01h). Based on the channels (1 OR 3), it initializes the PWM registers and starts generating PWM on either 1 or 3 channels with the PWM value from EEPROM (0 to 250).
Case-1: User presses & releases the UP button. Code increments the PWM value by 25. (So if it was 150, the increment will result in a value of 175). If the Value was 250, then do not increment - this is the Max value. Once the increment is done, the code should A) write this value back to the EEPROM location for PWM Value (00h), AND B) update the value on respective PWM channels (if channels is 1, then only generate PWM on OC0A, if it is 3, generate PWM on OC0A, OC1A & OC1B).
Case-2: User presses & releases the DOWN button. Code decrements the PWM value by 25. (So if it was 150, the decrement will result in a value of 125). If the Value was 0, then do not decrement - this is the Min value. Once the decrement is done, the code should A) write this value back to the EEPROM location for PWM Value (00h), AND B) update the value on respective PWM channels (if channels is 1, then only generate PWM on OC0A, if it is 3, generate PWM on OC0A, OC1A & OC1B).
Case-3: User presses & releases the UP and DOWN buttons simultaneously. Code checks the Channels variable - If Channels had 1, then put 3 in Channels variable; If Channels had 3, put 1 in Channels variable. After doing this, the code should A) write this value back to the EEPROM location for PWM Channels (01h), AND B) Activate / deactivate respective PWM channels with the present PWM value (if channels is 1, then only generate PWM on OC0A, if it is 3, generate PWM on OC0A, OC1A & OC1B).
This concept of the system is to generate PWM for LED brightness as well as colour control. Our target system has an RGB LED, but you can use individual colour LEDs for test. The user of the system can only be able to see the RED colour (1 channel PWM) OR White (3 channels of PWM). On top of that, they should be able to change the Colour of the LEDs by pressing & releasing the UP & DOWN buttons simultaneously. This needs to be stored in EEPROM because in the event of a Power failure OR power-down, the system should remember its previous state.
1) You will develop code in C, using WinAVR with AVR Studio. We have AVR Studio 4.16 with WinAVR-20081205, so your code should be compatible and compile without any errors on it.
2) Once you have the working code, test it on a board containing ATTiny4313. It can be a Bread-board OR a Perf- / vero-board mockup. Connect an RGB LED to the PB2, PB3, PB4 ports and verify your code is working. You may use individual colour LEDs if you do not have RGB LED.
3) Show us via webcam the working code on your board and deliver just the HEX file for us to test on our target PCB.
We will release 50% milestone when the HEX code is found working on our board, then you may deliver the complete Project sources and folder to us and we will release the remaining 50% payment.
NON-SERIOUS Bidders or who have a "hunch" they can do it, please do not waste our time. We already have this code implemented for 1-channel but due to lack of time and fast deadline we are outsourcing this work, so we know how much its worth. Please place sensible bids.
9 freelanceria on tarjonnut keskimäärin 70 $ tähän työhön
Sir, I have already worked on P.W.M generation on ATtiny 2313 and have a ready working board. So I am sure, I'll do this. Please check the attached file for confirmation. Regards, Mandeesh Singh