Announcement

Collapse
No announcement yet.

Newby Bonehead Simple Project Question(s)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • jweir43
    started a topic Newby Bonehead Simple Project Question(s)

    Newby Bonehead Simple Project Question(s)

    I'm an old mossback microwave engineer trying to learn this new processor/controller language. I promise, if you come to me to ask how to build a hybrid Wilkenson splitter at 3 Gigs for less than a quarter I'll be kind and gentle to you, so if you could kindly and gently lead me into the basics of this new language with minimal lingo I'd be most appreciative.

    I have the ME Labs PCB Pro Compiler v 2.47 that I am in the process of converting to 3.0, and a U2 programmer for the LAB X1 board. They have been gathering dust for about ten years because the documentation they came with was so damned confusing I just gave up. Yes, I am fairly proficient in writing in the BASIC language (I taught it in college for a few years) so I really want to use that head start and write my programming in BASIC.

    Here is what I want to do. I have a physical pushbutton switch. I want to use a microprocessor to give me one of two conditions at output. Let's call the pushbutton switch input I1. Let's call the two output pins A and B. I want A to be high and B to be low on startup. I want to have the outputs switch states with each push of the pushbutton. That is, push once and A goes low and B goes high. Push it again and A goes high and B goes low. Lather, rinse, repeat. After about a hundred milliseconds or so, I want both A and B to go low and wait for the next push.

    First of all, I need to debounce the switch. Then I have to know how much current output pins A and B will give me to drive my H-bridge motor controller. Analog (transistor) design is pretty trivial for me, so if I know how many mils the pins will give me I can pretty well determine what sort of interface is necessary.

    Seems to me that I need a pretty minimal device, certainly not the 40 pin monster that comes with the MEL board. 8 pins would be nice if there is a way of doing that.

    Can ANYBODY point me to a stone bonehead simple way for me to get this first project underway? I would truly appreciate it.

    Thanks ... Jim

  • mpgmike
    replied
    I did actually mean the PIC12F1501 was introduced in the year 2011. Periodically ME Labs updates the PBP software to fix any bugs reported since the last update as well as add the newer PICs to the list. You mentioned having an older version of PBP which is why the release year of the 12F1501 was mentioned.

    In addition to the vast information available in the archives of this forum (do a search for things you don't understand), there is also a UK PIC Basic forum:

    http://www.picbasic.co.uk/forum/forum.php

    Good luck.

    Leave a comment:


  • jweir43
    replied
    Originally posted by richard View Post
    you know i had completely forgotten about cmos , must be getting old and stuck in low volts mcu world [don't think i have used one [cmos chip] this century]
    i was really just thinking of mcu/microprocessior logic.



    what 4.2 version ? i have not seen one past 3.1xxx please explain
    Mea Culpa . Advancing senility and such. The U2 programmer was v4.2. The Compiler manual was v2.4.

    I don't think I've used less than ten thousand cmos chips (in all of my college classes and products) this century. They are damn near bulletproof, and with students handling them, they had better be.

    Jim

    Leave a comment:


  • richard
    replied
    you know i had completely forgotten about cmos , must be getting old and stuck in low volts mcu world [don't think i have used one [cmos chip] this century]
    i was really just thinking of mcu/microprocessior logic.

    believe the manual you are quoting is the 3.x version of the manual. There was never a pdf version of the 4.2 version of a manual to my knowledge


    what 4.2 version ? i have not seen one past 3.1xxx please explain
    Last edited by richard; 05-05-2019, 08:45 PM.

    Leave a comment:


  • jweir43
    replied
    Originally posted by richard View Post
    what is a mcu http://bfy.tw/NWhN

    the manual has a good live bookmark and the pdf find function is as good as any index
    an "ide" is described in the manual if thats inadequate google is your friend google "what is an ide"

    I believe the manual you are quoting is the 3.x version of the manual. There was never a pdf version of the 4.2 version of a manual to my knowledge. I already said that the 3.x version of the manual is excellent and that the index is outstanding.

    if you use a hbridge ic like L298N or lm293d all possible A B input conditions are safe and cause no damage. a circuit design that can self destruct is not a good one

    If you are fighting little tiny spaces for an h-bridge PLUS the driver/microcontroller PLUS the power supply parts then these two L and LM parts will not fit and you wind up rolling your own with discretes. If I can''t construct a driver that makes A and B both high illegal then I don't deserve to be called a circuit design engineer.

    to my knowledge there has never been a logic family that operated above 5v , the trend is to go lower . many mcu chips now are capable of 1.8v operation 3.3v is common
    Try 4000 series CMOS that will work anywhere between 3 and 18 volts, which is why I like them when I have something like a 12 volt vehicle battery supply to work from. It has been 40 years since I worked with DTL, but as I recall there was a variant of it that worked up to 10 volts. RTL was designed for 3.6 volts but as I recall we used some tricks to goose it up to use it with a 9 volt battery.

    JIm

    Leave a comment:


  • richard
    replied
    what is a mcu http://bfy.tw/NWhN

    the manual has a good live bookmark and the pdf find function is as good as any index
    an "ide" is described in the manual if thats inadequate google is your friend google "what is an ide"

    if you use a hbridge ic like L298N or lm293d all possible A B input conditions are safe and cause no damage. a circuit design that can self destruct is not a good one

    to my knowledge there has never been a logic family that operated above 5v , the trend is to go lower . many mcu chips now are capable of 1.8v operation 3.3v is common
    Attached Files

    Leave a comment:


  • jweir43
    replied
    5 May 3:15 PST

    Edited after downloading the 3.1 manual. The new manual is everything I had hoped for. It explains in some detail how the entire process works and defines what some of the abbrvtns mean in plain language. I'll give this a fight and see what happens. THanks again, Jim




    Thanks, Mike, I really appreciate the help. It isn't the program itself that is the problem. Programming R us. At least in BASIC. I haven't mastered C++ yet, but that isn't even necessary. And yes, I've read the PBP manual, but let me give you a couple of examples.
    • Page 5. "Select the PICmicro MCU from the IDE's drop down list." What's an MCU (no definition prior or any indication or index to refer to)? What's an IDE (same comment).
    • "Make sure the FILES and BUFFERS are set to at least 50 in your CONFIG.SYS file." What CONFIG.SYS file, where do I find it, and why do I need 50, or 100, or 2?
    • Page 7. "If you are using the EPIC programmer ... If you are using the melabs Serial Programmer ... " I'm using the MELABS U2 programmer and there are no instructions for it.
    • Most of the instructions are given as ancient DOS commands, and nothing about Windows, much less any changes that need to be made for a 64 bit machine.
    • I could give you several hundred examples, but these will do for starters.
    • A REAL Table of Contents and a REAL Index page(s) would help tremendously, but they are the most difficult part of writing manuals, which is one of the things I do for my company. We've got a a procedure, the design engineer writes the instruction manual and then the device AND the manual are given to the person that has absolutely no knowledge of the product. If that person can use the manual and the product without any further help, we put the product on the market. Any stumbling blocks call for a manual rewrite.
    Now, I mean no offense, but you tell me that "a PIC 12F1501 is a 2011 device"... . The data sheet for this device is 292 pages, but not one mention of a 2011 anything (other than the copyright date), so I'm happy that it is a 2011, but that doesn't mean anything to me.

    So I go onto the Microchip website to see if there are any devices that run from +12 or so and not a whisper of anything more than 5 volt and lower devices. I'm just guessing that 5 volts is the standard and everybody knows that. I don't. Again, undocumented information.

    As to TOGGLE, that isn't going to work too well, and there are IF, THEN, ELSE to cover the problem. The problem is that with an H-bridge, both A & B low shuts the motor off. A high and B low, the motor turns in one direction, A low and B high turns the motor in another direction, and A & B both high blow out two transistors faster than you can say "DAMN". I have to avoid two highs positively, and there are ways of forcing that in the software.

    i'm just hoping that the manual that is supposed to come with the 3.0 product upgrade is itself an upgrade and not the confusing babble that the 2005 v2.0 manual is.

    Feel free to share any documentation that may guide me in this cotton pic'n thang. 'preciate the help.

    THanks,

    Jim


    Last edited by jweir43; 05-05-2019, 03:17 PM.

    Leave a comment:


  • mpgmike
    replied
    Wow! Where to start? First, it sounds like an 8-pin PIC will serve you well. You mentioned the need for 1 timer ("about a hundred milliseconds or so"). The PIC12F1501 is a 2011 device, so it should work with your current software. It has Timers 0, 1, and 2. It has something called Interrupt on Change (IOC) that would allow you to handle button pushes as an Interrupt Handler.

    To get started, I suggest reading through the PBP User's Manual. I know that's not the short-cut you were hoping for, but if you really want to start tackling this PBP Basic PIC thing, it is an excellent start. With any PIC you will need to tackle the OSCCON, TRISx, and ANSELx Registers (in the Data Sheet). Near the top of your code use the DEFINE OSC statement. I suggest 4 MHz for your project. You can Alias your PORT pins with:
    Code:
    A VAR PORTA.2 ;PORTA.2 needs to be set-up as an OUTPUT in the TRISA Register ("0").
    B VAR PORTA.1 ;Same as above
    Button VAR PORTA.0 ;PORTA.0 needs to be set-up as an INPUT in the TRISA Register ("1")
    As for your specific stated request, pay special attention to the "TOGGLE" and "PAUSE" commands , as well as the IF/THEN Clause as that would be about all you need in your Main loop.
    Code:
    IF Button = 1 THEN
      TOGGLE A
      TOGGLE B
    ENDIF
    The PAUSE command could allow you to add:
    Code:
    PAUSE 100
    LOW A
    LOW B
    GOTO Main ;or whatever your Main loop Label is called
    Hope this gets you started in the right direction.

    Leave a comment:

Working...
X