microcontroller thread #3

Discussion in 'General Science & Technology' started by cato, Jul 19, 2006.

Thread Status:
Not open for further replies.
  1. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    yeah, sorry, rookie mistake =]. I had it configured (well it was configured bu default) to use a different language suite. once I configured it to use c18 instead, everything was peachy =]
     
    Last edited: Aug 6, 2006
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. MetaKron Registered Senior Member

    Messages:
    5,502
    Now you've got me itching to do something with microcontrollers. I have everything as long as I don't mind working with SMT devices that I have on hand. I'm really tempted to spend some money on chips with legs on them instead of doing that.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. leopold Valued Senior Member

    Messages:
    17,455
    i agree.
    the I/O chips i worked with were nothing more than a set of registers with a couple of interrupt lines.
    from what i've read about these pics they not only provide I/O functions but they can also convert analog to binary, store bytes, and even alter their programming.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. MetaKron Registered Senior Member

    Messages:
    5,502
    They keep simple tasks simple so you don't have a lot of stuff between the program and the lines you want to control. They are fast enough that "bit-banger" ports are practical. It is sort of a shortcoming that the cheaper PICs don't have the kind of RAM you might want, but most of the tasks that you use an MCU for don't need kilobytes or megabytes of memory. I do wish that the under three dollar types had at least a few tens of kilobytes so they could spool text, but they're pretty good anyway.

    One trick that can be done is to interface these with memory sticks so that you can use even the newer cheaper gigabyte memory sticks. That's like 30 hours or so of sound recording or 20,000 snapshots at decent resolution. Some of the applications may look like the tail wagging the dog, but you basically acquire the data from a device and record it to a device. Both devices may have a lot more computing power than your controller, but you treat them as black boxes that just do what you tell them and use the controller to tell them.
     
  8. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    update: I think I got my "hello world" program done. I will test it in the morning. I still have to figure out how to get the program that interfaces with my board to run my program. with the stuff I did in class, they told us where the program started (memory location 1040) so all we had to do was type "go 1040" into hyper terminal.

    the program will just blink an led at a half second rate. I still have to figure out how the bit masks work. I tried PB7 and RB7 but neither worked, I had to use 0x80. I know it does not seem like much of a days work, but the coastguard festival is in town and I kinda got pulled away =]
     
  9. MetaKron Registered Senior Member

    Messages:
    5,502
    Are you using the same board you used in class?
     
  10. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    no, I used a 68hc11e9 in class, now I have a k149 with a PIC18LF458
     
  11. leopold Valued Senior Member

    Messages:
    17,455
    the part number sounds like it could be a motorola product.
    did this chip have 6 registers arranged in 2 sets of 3 called an 'A' side and a 'B' side?
     
  12. MetaKron Registered Senior Member

    Messages:
    5,502
    Is there even a communications program installed on your chip? What I'm used to is simply switching on the power supply and watching what it does. It's not going to talk to your terminal without a communications program installed.

    You can't use the communications protocol that is used for programming the chip at runtime. It has to be in program mode to use that.
     
  13. leopold Valued Senior Member

    Messages:
    17,455
    the chips i'm familiar with had to be read by the cpu.
    the I/O chip sent an INT to the cpu to tell it the byte was available.

    it was a really simple setup
     
  14. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    I am about to pull my hair out! I am using micropro.exe (came with the board) and it seems to communicate, it lets me program the board, then verify that it has been programmed. but I have no idea what is going on after that! is it running my program automatically? hell if I know, I can't find anything that would be a command to run it. I don't have anyplace to type a command such as "go 1040."

    I used an led setup at first, and when it failed to flash, I thought maybe my LED was bad, so I put a voltmeter to the pins and got squat! maybe I have to enable the use of that pin first? I wish I could know that it was running my code, then I could tell if it was a code problem or what.

    right now its 100% humidity, 90 degrees and I just got back from being lost for 45 minutes looking for the only place in 50 miles that sells brake pads (because its fucking sunday) that I have to put on in a rain soaked driveway! after getting low on gas and having the pump refuse my debit card, I almost had a stroke.

    maybe I should hang it up for a while. =/
     
  15. MetaKron Registered Senior Member

    Messages:
    5,502
    The K149 that I can find doesn't seem to support breadboarding. Are you taking the chip out and putting it on another circuit?

    You have a couple of things to look for here. Is your oscillator configuration correct for what you are using for the oscillator? This one doesn't have an internal oscillator mode. That's in 2.1 in the documentation for the chip.

    Pin 1 (MCLR) needs to be high. I am presuming that you are using the DIP version.
     
  16. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    hmm, maybe I don't have an oscilator. I just assumed there was one, since it supports ICSP.
     
  17. cato less hate, more science Registered Senior Member

    Messages:
    2,959
  18. MetaKron Registered Senior Member

    Messages:
    5,502
    That oscillator is on the programmer. There is a certain default. I think it's for the crystal with the two capacitors.

    You have crystal, RC, or external clock as sources. Read the documentation carefully and choose the one you like or have the parts for. You might find a clock or crystal on an old motherboard especially if you have some really old ones like 386 boards. Just to get it running, just use the RC type they have listed.

    You are using the type of PIC that I would have liked to use, with enough room to run some video, Basic or C programs, games, whatever. It's a lot like those older small computers only better because it is faster and easier to hook up.
     
  19. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    damn! I thought the fucker had a crystal on it! why the fuck does it have in circuit serial programming if you can't use the programmer in the circuit!?

    I am so pissed off right now...
     
  20. MetaKron Registered Senior Member

    Messages:
    5,502
    The crystal or RC circuit are attached to the chip when it is in circuit, so ICSP will work just fine. It's pretty easy.
     
  21. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    yeah, I was hoping to not have to hook anything up. now I have to get parts, breadboard, solder, and fuck around with it before I can even test it.

    the whole reason I bought this fucking programmer was because I thought ICSP implied it could be run from the programmer without addition parts.

    ...fuck...

    well, how do you think I should connect this thing to a breadboard? I was thinking about soldering two 20 pin data robbons to the bottom of the ZIF, and find something to adapt it to a breadboard. do you know what kind of connector can go from a data ribbon to a breadboard? moreover, where can I get some 20 pin data ribbons(preferably not buy them from a store [rip off])? I don't have any extra computer parts laying around. my brother in law might have some. I will see him next weekend.
     
  22. MetaKron Registered Senior Member

    Messages:
    5,502
    Use the 6 pin header.
     
  23. cato less hate, more science Registered Senior Member

    Messages:
    2,959
    you mean the ICSP pins? I would like to have a way to breadboard all of my I/O pins, without having to remove the MCU each time. unless you know of a better way
     
Thread Status:
Not open for further replies.

Share This Page