Page 1 of 1

BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Fri Mar 02, 2018 6:30 pm
by Q Branch
This is something I was working on at the end of last year, but for various reasons it's been shelved until now.
It's my take on how to navigate through the 12-hour supervised assessment period from a student's point of view.
I have no insider knowledge from Pearson - everything is based on what I interpret (or misinterpret) from the various documents and books available.

This first posting is based on the 7 P's - Perfect Planning and Preparation Prevents Poor Performance.
I call this pre-planning because it's something that can be done in advance of the 12 hour period. At least that's my understanding unless anyone has an alternative view.

My argument goes like this: If I'm in industry and expecting a product specification from a customer, I don't need to know the details of the job before I allocate or ring fence some resource for the job and put a rough plan in place.

first_attempt_egg_timer.jpg (152.66 KiB) Viewed 19574 times

Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Mon Mar 05, 2018 3:08 pm
by The G
Very helpful indeed! And structured in a way aligned with the mark-scheme and sample learner answers from BTEC.

BTEC Unit 6 - SAMs (the egg timer) Session 1

Posted: Mon Mar 05, 2018 9:20 pm
by Q Branch
Thanks G, things are going slower than I expected because of interruptions, but I'll keep things going as best I can.

This is "Session 1" where the student has to make sense of the client brief (easier said than done).
Pearson have left us with a few issues to ponder here as detailed in the Teachers_Notes etc.

Again - this is just my take on it - feel free to use it as an organ donor for your own use.

BTEC Unit 6 - SAMs (the egg timer) Session 2

Posted: Fri Mar 09, 2018 2:20 pm
by Q Branch
If I read the specification correctly, this is where we have to compare at least 2 microcontrollers and pick one.
It's like asking for two quotes for the annual church hall emergency lighting check.
We already know the answer before we ask the question, the lowest bid always wins :roll: .

Likewise, it will be the microcontroller and board that you spent most of your 120 GLH on.

Most of this can be prepared in advance and edit the appropriate parameters and comments in the table as required to save time during the session.

Any hardware that you need to add, LEDs, piezo sounders etc - you need to have the datasheets and images to hand because you do not have internet access during the assessment.

There's no teachers notes with this one - it's just as it is.
Next session, I'll need to do some notes to explain how my software design process works.

Re: BTEC Unit 6 - SAMs (the egg timer) Session 3

Posted: Thu Mar 22, 2018 11:24 pm
by Q Branch
Sorry for the delay in getting Session 3 uploaded, but I was getting "Ofsted ready".
Now I can get back to some proper work.

The design is complete and the skeleton of the program is there.

Re: BTEC Unit 6 - SAMs (the egg timer) Session 3 - Flowcode 7 software

Posted: Thu Mar 22, 2018 11:41 pm
by Q Branch
This is the Flowcode 7 code for Session 3.
It's based on an earlier "hardware test" program with the LED and piezo sounder tests added for the egg timer.
Pressing keys SA0 to SA5, SB6 and SB7 cause the LCD to display their state ('0' or '1'),
Pressing key SB6 causes the piezo to sound, releasing SB6 silences the piezo.
Pressing key SB7 causes the big LED to illuminate, releasing SB7 turns the LED off.

If there's a bug that causes odd behavior later in the development cycle - this is the code to download to the board and make sure the hardware is still ok.

The key_task and Timer_2_ISR will be used without modification for the egg timer design.
The LED and LCD need tasks written to handle them as per the design.
main also needs quite a bit of work.

Re: BTEC Unit 6 - SAMs (the egg timer) Session 4

Posted: Tue Mar 27, 2018 10:11 pm
by Q Branch
At the half way point it's starting to come together.

The "Quick Start 3½ minute egg" and "Cancel" keys work.
The LCD, LED and piezo sounder work as per the design.

The "SET TIME" and "START" functions will come in Session 5 and you can see the hooks where they fit in the Flowcode.

Re: BTEC Unit 6 - SAMs (the egg timer) Session 4 - Flowcode 7 software

Posted: Tue Mar 27, 2018 10:23 pm
by Q Branch
At Power ON / Reset, you get the Welcome Message for a few seconds or until you press a key.
Then you get "SET TIME", but the only option you have there is "QUICK START"
Then you're "COOKING" until "DONE" or you "CANCEL".
If you let it run until "DONE", press "CANCEL" to silence the piezo and return to "SET TIME"

More to follow.
key_functions.jpg (100.46 KiB) Viewed 19159 times

Re: BTEC Unit 6 - SAMs (the egg timer) Session 5

Posted: Fri Mar 30, 2018 10:55 am
by Q Branch
"The person that never made a mistake, never made anything" - a quote from my first boss.
The first version of any software will have some bugs and there were a few in the Session #4 software.
The software from Session #5 has all the "must have" aspects of the client brief (and some bug fixes :oops: ).

Re: BTEC Unit 6 - SAMs (the egg timer) Session 5 - Flowcode 7 Software

Posted: Fri Mar 30, 2018 10:59 am
by Q Branch
Everything now works for the "must have" parts of the client brief.
There's some enhancements on the way for the fancy stuff.
key_functions.jpg (103.27 KiB) Viewed 19082 times

Re: BTEC Unit 6 - SAMs (the egg timer) Session 6

Posted: Sat Mar 31, 2018 12:10 am
by Q Branch
Just adding the fancy stuff now - overcooked and test mode up and running.
No teachers notes for this session.

Re: BTEC Unit 6 - SAMs (the egg timer) Session 6 - Flowcode 7 Software

Posted: Sat Mar 31, 2018 12:19 am
by Q Branch
Unless I (or you) find any issues, this is my final software solution (apart from adding some comments).
The operation manual will have the detailed design etc.
test_mode.jpg (92.3 KiB) Viewed 19060 times

Re: BTEC Unit 6 - SAMs (the egg timer) Session 7

Posted: Thu Apr 12, 2018 9:49 pm
by Q Branch
I found one minor bug :oops: while documenting the system and some annoying behavior :lol: while running on the hardware during this session.

The next (and final) session will include the operating instructions including full documentation of the software.

Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Tue Apr 17, 2018 11:48 am
by The G
DESTROY THE EGG :lol: :mrgreen: :lol:

You have done a lot of work preparing all of this - much appreciated that you are willing to share the resources!

I hope that eventually I shall be competent enough to contribute and not just try to learn a new subject. I really empathise with students who are learning this for the first time and going into this exam next week. I personally don't believe that a student can accomplish anything close to what you have in the allocated 12 hours!

Re: BTEC Unit 6 - SAMs (the egg timer) DESTROY THE EGG

Posted: Tue Apr 17, 2018 2:03 pm
by Q Branch
Thanks G.

The 2 line display looked a little lonely with only one word on the top line, so I added some "user experience" :lol: as it says in the blurb.

The main objective of this exercise from my point of view was to create a solution, following the Pearson documents that can be used as an organ donor by students to pull apart and use for their own projects, learning some useful tricks on the way.

I've skipped over what I called the "underpinning knowledge" in another post.
There's a lot to do an that front and I'm currently exploring my options on that for the future :idea: .

I've got one more post ( session 8 ) to go in order to finish off the task and complete the documentation.
Beyond that I will post a "lessons learned" section on what I've found along the way.

Thanks again for your comments and it's good that people are running the code and taking it apart to recycle as I intended.

Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Wed Apr 18, 2018 2:39 pm
by Jacob1
Thanks for showing us your solution of this!

I had a go at the egg timer over Easter, but did not have the knowledge of how to activate a buzzer at the end of the each timer routine, which I now do. Your sessions are really useful, especially the content you have done for the design section, such as the comparison of the micro controllers.

So thanks for your time, from a students perspective studying this course, this is a massive help in terms of maximizing the planning we can do for the exam next week,


Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Wed Apr 18, 2018 5:13 pm
by The G
Something that has come up in the preparation for the exam is that no internet is allowed. It is going to be quite difficult to compare alternative hardware and solutions without knowing what the scenario actually is in advance. Also potential improvements / technological advancements. And no online datasheets - would we need a paper copy of all components datasheets... hmmm... I wonder if I should drop an email to Pearson...

Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Wed Apr 18, 2018 7:54 pm
by Jacob1
Could we say that we have revised the technical data in our heads? But yes we would need datasheet copies if we are to compare hardware in detail


Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Thu Apr 19, 2018 10:17 am
by Q Branch
Wow - thanks folks - this topic is proving to more popular than I expected.

The original plan was to do a basic, intermediate and advanced solution, but I ran out of time and opted for the advanced solution first.

If you come from a mechanical background, there's tricks you learn on the way like putting a nut on a bolt before you stick it in a vice and take a hacksaw to it. Why? - because it makes your life easier and you don't have to spend the next 20 minutes trying to re form the thread on the bolt.

All branches of engineering have their tricks - engineering is really a blend of art and science. The only way to learn one of the tricks is to have somebody else who knows the trick, show you. I've tried to include some of the more useful ones in the solution to give you reasonable chance of success in a few weeks time.

There's not enough time to do everything from scratch during the assessment, so the more preparation you can do the better.

My take on the comparison of hardware goes like this:
You are going to use one hardware platform for the assessment and if you're reading this forum it's going to be the Matrix one.
I can't see a problem preparing (in advance) a table of say Arduino v Matrix like I did and when you are presented with the assessment, fill in the blanks in the last column. On the comparison of ADCs between Arduino and Matrix, I said something like "I don't intend to use analogue inputs in my solution". Choose the features you are going to use and find a good or neutral reason to steer your decision towards the board you are going to use.

Also, in the real world, if you already use a PIC or Atmel based platform for something, you will have knowledge of that platform including software you already know works, so you will be heavily biased to choose what you are already using.

We seldom write software by starting with a blank page and typing until it's finished. We use libraries and/or functions we (or someone else) have written previously. Some of my favourites have been with me since the early 1980s, starting in Z80 assembler, then translated to other processor assembler, C and now translated into Flowcode.

Other people may have a different view, but knowing how things work in the industry, I don't see a problem with this although I have not asked Pearson for their opinion.

Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Thu Apr 19, 2018 11:51 am
by Jacob1

I completely agree with being able to plan before the assessment, in terms of using datasheets for the comparison of the microcontrollers. I have done this now, but I am concerned about whether I can use this for the assessment, as if we have no internet then Pearson will suspect I have done this outside of the exam period.

However, if they want us to select the hardware, inputs and outputs etc, we would need to use the datasheets in order to obtain the info, unless we are meant to revise this detail in our heads. I believe my teacher has contacted Pearson about this, but I think for the exam I will only have a few parameters and advantages and disadvantages for the microcontrollers, not as detailed as yours! Simply because, this detail I can say I have revised for the assessment and modified where needed.

So unless Pearson say we can use datasheets and obtain technical info before the exam, I think I will just have to go with less detail and include actual photographs of the components instead. This is ashame as I would like to go into the detail you have for the design section! :?


Re: BTEC Unit 6 - SAMs (the egg timer) sample solution

Posted: Tue Apr 30, 2019 11:30 am
by Branden
Hi I found this post helpful I was wondering if you could help me with activity 2 with the testing part