![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| How to put this in the right light. I require Krumlink to do his own work. He can google for info and ask me questions. But I do not want him to post questions about his assignments on forums. Why? I would like to control his exposure to material/content.Up to now I did not provide any guidance in this area so I have no reason to be upset about Krumlinks last post asking for help with an assignment. I may relax this a bit after we cover the basics. For now I hope that everyone can understand and respect why it needs to be this way. If I wanted to write a textbook or publish a guide on the subject I would welcome comments and help. | |
| |
| | (permalink) |
| Well done both of you. I too wish to write a book and I'd love to collaborate on one. Edit: Here's the new Mongoose Poster. Last edited by blueroomelectronics; 13th November 2007 at 08:52 PM. | |
| |
| | (permalink) |
| Hi again, I've got my programmer all put together and I am running into some trouble. I need some advice on where to start debugging this thing. I read the pic and the firmware appears to be there. I have run the traces and checked with a multimeter a bunch of times (and I'll do it a few more times) but my computer doesn't even make a "bink bonk" sound to say I've plugged something in. What would be the minimum number of connections that I need to make to at least get the computer to know I've plugged something in. For example would my computer recognize, power, data lines, and the crystal or does this thing have to be perfect to be recognized? At least I get a green light when I plug it in, but then again any monkey with 1 resistor and 1 led could do that.
__________________ jeremy | |
| |
| | (permalink) |
| The crystal must be 20MHz and running with the 18pf to 22pf caps on the crystal. The 0.47 and 0.1 cap must be there, measure for 3.3V across the 0.47uf. And of course the USB connector and Ferrite bead have to be there. That's the bare minimum to get a USB connection. How did you wire it? Point to point, breadboard? Last edited by blueroomelectronics; 13th November 2007 at 11:24 PM. | |
| |
| | (permalink) |
| I etched a PCB at home and used jumpers where necessary. I get 0.00v across the ".47". I have a 20 Mhz crystal and two disc caps that say "22.". For the ferrite bead I have a ring and the power wire is wrapped around 6 times. My first real doubt is the capacitors because I'm not sure 22. means 22pf. edit: I took the chip off the PCB and breadboarded it. It still gets 0.00 volts and no "bink bonk" on the computer. I'm going to have to try another programmer to install the firmware. I think that is the problem. The kit149 that I'm using gives a eeprom error. that I mentioned a few posts back. More when I have progress.
__________________ jeremy Last edited by jeremygaughan; 14th November 2007 at 01:25 AM. | |
| |
| | (permalink) |
| It does sound like the PIC isn't programmed properly. I didn't think the K149 supported the 18F2550. Strangly the picall software needs the PGM pin pulled to GND, you could try holding down the pushbutton before plugging it in to the USB, see if the busy LED flashes. Last edited by blueroomelectronics; 14th November 2007 at 03:07 AM. | |
| |
| | (permalink) | |
| Quote:
It sounds interesting what do you have in mind. | ||
| |
| | (permalink) |
| Hey 3v0, I got a back and forth LED Scrolling thing working At my robotics meeting, it was really bad, because they were trying to get me to program the robot when I had no Idea what they were doing "add a if loop bla bla bla". They were trying to teach me something I had no experience with, so it was a very frustrating night. Then my internet went down, and my WIFI stopped working. | |
| |
| | (permalink) | |
| Quote:
We had to get the tools working and cover the edit - compile - program - run cycle. Now that we have done that we can start with flow control and decision making. Good about getting the assignment done. If all goes well we can do more this afternoon. | ||
| |
| | (permalink) | |
| Quote:
IMHO Simulators are great but there is something more exciting about flashing an actual LED. | ||
| |
| | (permalink) |
| I think it would be useful to the same examples coded in C and assembler. I have to agree about flashing the LED. Interaction with the physical world makes embedded programming interesting. | |
| |
| | (permalink) |
| Seems like Krumlink has taken to programming. It's like having control of thousands of little transistors. I've sent you a link to google docs with the Mongoose part list in your email. | |
| |
| | (permalink) |
| So I assume that will be lesson 1a Bill, who did you send it to? I dont know who you were talking to | |
| |
| | (permalink) |
| Krumlink will be quite good at programming. He is a quick study. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Junebug kit ready, (PICkit2 & tutor) | blueroomelectronics | Micro Controllers | 37 | 28th October 2007 03:47 AM |
| Assembly? | Marks256 | Micro Controllers | 43 | 28th July 2006 04:45 PM |
| Assembly compiler | Thunderchild | Micro Controllers | 4 | 12th March 2006 02:25 PM |
| Learning Assembly Programming Language | Johnson777717 | Micro Controllers | 4 | 22nd March 2004 03:00 PM |
| Assembly Language Question | Jeggyman | General Electronics Chat | 6 | 30th January 2004 10:54 PM |