Session with Krumlink.
Krumlink is using MCC18 and an inchworm+. We are using the 18F mostly for the free compiler. The code we used today was rather quickly ported from the 16F88 and the CCS midrange compiler to the 18F330 and MCC18. I mailed the 18F1330 code to Krumlink and we changed just enough to get it to run on the 18F1320. The delay code is way off.
We started out with a program that blinked a single LED
Code to blink the same LED using LATB existed in the loop but it was commented out.
I explained the relationship between each bit of port B and how LATB could be used to set it.
For an assignment I asked Krumlink to use 6 LEDs (he is using the debugger) and create.
x00000
0x0000
00x000
000x00
0000x0
00000x
0000x0
000x00
00x000
0x0000
then repeat.
From installing the compiler to this point was 2.5 hours and I was bushed.
But that was not enough to keep his busy so I sent him two examples of blinky code using for loops without any explaination. He is going to figure out what it does an how/why it does it. It is going to be a challange to keep him busy.
Krumlink is using MCC18 and an inchworm+. We are using the 18F mostly for the free compiler. The code we used today was rather quickly ported from the 16F88 and the CCS midrange compiler to the 18F330 and MCC18. I mailed the 18F1330 code to Krumlink and we changed just enough to get it to run on the 18F1320. The delay code is way off.
We started out with a program that blinked a single LED
Code:
#define ACT_LED LATBbits.LATB2
...
main()
{
while(1)
{
ACT_LED = 0;
delay_ms(10);
ACT_LED = 1;
delay_ms(10);
}
}
Code:
// LATB = 0x00;
// LATB = 0x04;
Students are required to translate HEX digits to binary without thinking about it. Similar to learning math tables in grade school.
Krumlink added a 2nd LED. I expained enough to get him to see how he could alternate them. In short order he had several LEDs doing interesting things. Too early to talk about muxing.... Need to cover the basics like flow, data types, math... first.
For an assignment I asked Krumlink to use 6 LEDs (he is using the debugger) and create.
x00000
0x0000
00x000
000x00
0000x0
00000x
0000x0
000x00
00x000
0x0000
then repeat.
From installing the compiler to this point was 2.5 hours and I was bushed.
But that was not enough to keep his busy so I sent him two examples of blinky code using for loops without any explaination. He is going to figure out what it does an how/why it does it. It is going to be a challange to keep him busy.