+ Reply to Thread
Page 4 of 20 FirstFirst 1234567814 ... LastLast
Results 121 to 160 of 772
  1. #121
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Quote Originally Posted by Kenjones1935 View Post
    That's the word I have been looking for.

    Is there a mechanism in PBP for setting break points.

    Once that is done, is there an easy way using PICkit 2 Programmer to read the contents of a particular register?

    Ken
    The easiest way is to have your project do serial out using the debug statements. With your PicKit you can read the output using the uart tool. Using if then statements, you can set it to give you different information. I use this in trouble shooting a lot.

  2. #122
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Unhappy Serious hardware problem with PICkit2

    My PICkit 2 PORTB outputs do not consistently pull up the coils in the DPDT relays enough to activate them.

    The 16F887 outputs measure 2.8v to 3v when driving a coil. I did not find mention of this potential problem in the PICkit2 Manual.. Any ideas anyone?

    Is there another Microchip kit that has some output drivers?

    Ken

  3. #123
    Join Date
    May 2007
    Posts
    604

    Default

    According to the data sheet, the output high voltage is VDD-0.7 (4.3V with 5V supply) when sourcing 3mA. The absolute max. current sourced/sunk by any I/O pin is 25mA. What does your relay require to activate?

  4. #124
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Unhappy You've got it.

    My ZETTLER AZ8222-2C-5DSE spec says:
    Nominal Coil VDC 5 volts
    Coil Resistance 125 ohms
    Must Operate VDC 3.8 volts.

    3.8/125 = 30ma

    One relay works out of six when driven by a PORTB output.

    NUTS!

    Ken

  5. #125
    Join Date
    May 2007
    Posts
    604

    Default

    The current being drawn by the relays is pulling down the voltage to <3V. You need to use a driver (or low VceSat transistor or logic level MOSFET).

  6. #126
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default

    Keep in mind also that even though each port pin is rated at 25mA maximum, the maximum TOTAL rated current into Vdd or out of Vss is only 95mA.

    So even if your relays only draw 20mA, which is within the limits of each port, you could only run 4 of them at once without exceeding the TOTAL current draw through Vdd, because of the 95mA limit.

    Like RMTEO said... some nice logic level MOSFETS on the low side of your relay coil is what you need now...


    steve

  7. #127
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default I agree about the driver

    Does MICROCHIP make an auxiliary board that contains drivers for the PICkit 2 device? I am not capable of soldering onto that PICkit printed circuit board. I already have a good sized non-solder proto board carrying the four DPDT switches, two proximity sensors and a voltage regulator. I am trying to get this whole thing onto a 1/10 scale radio control car.

    The guy from whom this idea came used a PICAXE.

    Ken

  8. #128
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Question MOSFET suggestion please....

    There are more logic level MOSFET's than Carter has Liver Pills (an expression that easily shows my age).

    What I want to do must be very standard.

    Suggestions?

    Ken

  9. #129
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    http://www.fairchildsemi.com/ds/FD%2FFDD8424H.pdf
    I find these handy. Mouser has them.
    Dave
    Always wear safety glasses while programming.

  10. #130
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default

    Just to confuse the issue a tad more, one of the other options would be to use a buffer/driver IC like this:
    http://focus.ti.com/lit/ds/symlink/sn7407.pdf
    Digikey has 'em for under $2, and it gives you up to 6 outputs if you like. MAX current is 40mA.

    I did a quick search for nice little MOSFETS in a small through-hole style package (like to-92) and I've gotta say it's pretty depressing. 98% of the stuff out there these days is SMD.

    Dave, those little dual MOSFETS are cute. But I'll bet Ken would like something in through-hole...


    steve

  11. #131
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Smile SN7407 sounded familiar so....

    I grabbed my "TTL Integrated Circuits Catalog From Texas Instruments" dated 1 August 1969 and found specs on the SN7400, SN7401, SN7402, SN7403, SN7404, SN7405, and SN7410!!

    This SN7407 thingie must be one of those newfangled inventions. No wonder I did not recognize it

    Thank you all!!

  12. #132
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Cool

    Heh, you've got me beat for "vintage databooks".

    I've got some National Semiconductor "TTL" and " Analog" data books that go back to '74, and a Signetics data book from '76, but nothing that goes back to the 60's...

    Hey, It's 2010 and that means the NE/SE555 is celebrating it's 40th birthday!

    Am I the only one that finds that amazing? 40 years in production for an IC type..

    According to Wikipedia:
    "As of 2003, it is estimated that 1 billion units are manufactured every year." Wow!
    Sometimes technology doesn't change that much, it just gets... smaller.
    Oooh look, now available in a TSSOP8 package.
    http://www.st.com/stonline/products/...4077/ts555.pdf

    You're doing great Ken, and I'm looking forward to seeing photos of your car in action because I know you're going to get there. You're clearly a geek at heart with experiance behind you ...
    You just need some fresher data books to work from.

    You're doing great. Carry on.


    steve

  13. #133
    Join Date
    Oct 2004
    Posts
    448

    Default

    Quote Originally Posted by Byte_Butcher View Post

    Hey, It's 2010 and that means the NE/SE555 is celebrating it's 40th birthday!
    Sends you on a nostalgic trip, doesnt it?

    My dad used to work in the avionics department of our national carrier, and I remember he showed it to me as an example of cutting edge technology.

    Of course, I could only appreciate the significance after he showed me the equivalent transistorised module it replaced.

    "What will they think of next..."

    Regards,

    Anand

  14. #134
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Vintage development boards

    Ok, this pretty off topic, but since we are going down memory lane...

    I still have my first development board, a 6950 Intercept Jr from Intersil (later bought out by Harris I think). Actually, it's not too shabby for 1976. Battery powered, 12 button input that allowed assembly programming via push buttons, 4 digit address, and 4 digit memory display. Though it is about 1 square foot in size, and the extra $145.00 for 1024 words of ram is a little steep. But I guess I was a slow learner, because the promise of "teaches you the basics of microprocessors, random access memories, read only memories, and input and output interfacing in less than 8 hours", took a little more time for me.

    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 13th February 2010 at 19:58.

  15. #135
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Question I am being confused by Microchip PBP and MPLAS

    Where do I find how to interpret the following .asm code? It is a piece of the wall_racers.asm file which was created when I compiled wall_racers.bas. If I am going to figure out exactly what my code is doing I need to be able to parse it. How do I do that?

    ; C:\PK2LES~1\44PIND~1\WALL_R~1.PBP 00132 if rangeright < desiredtrack and oldrangeright < rangeright then
    CMPLT?WCB _rangeright, _desiredtrack, T1
    CMPLT?WWB _oldrangeright, _rangeright, T2
    LAND?BBW T1, T2, T2
    CMPF?WL T2, L00005

    I looked in all the Microchip documents I have for "CMPLT" and "WCB".
    Where are these defined?

    Also how, using PICkit 2 Programmer do I read contents of RAM addresses 40, 42 and 44??

    Ken

  16. #136
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    Let me see wall_racers.bas and I will try to tell you what it does.

    The basic code will be much easier to read.... One of the reasons basic is used???
    Dave
    Always wear safety glasses while programming.

  17. #137
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default I really don't want to learn these details

    My problem is that the code is not doing what I think it should be doing.

    I have put LED blinkers at the beginnings of all subroutines. That way I can tell the path the code is taking. You understand, I have not been able to get MPLAB IDE to work at all. That is the tool with the debugging features. I am using PICkit 2 Programmer and my own ingenuity.

    It looks like some arithmetic on the PULSIN results is not working correctly. I do not know how to read the VAR which stores the pulse size in units of 10 usec. I would like to see exactly what the PIC thinks it got, but that means reading RAM. I would like to put a break point in the code and read certain addresses at that point, but I have not been at all successful with that technique.

    I planned, but did not get to it, to enter a Microchip FAQ forum to see what they all say about these two Microchip software products working together.

    I'm tired. It is bed time. Thanks. Maybe things will be more clear in the morning.

    Ken

  18. #138
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Quote Originally Posted by mackrackit View Post
    Let me see wall_racers.bas and I will try to tell you what it does.

    The basic code will be much easier to read.... One of the reasons basic is used???
    Here is the link: http://letsmakerobots.com/node/928

    It's in Picaxe basic. Not sure how compatible that is... never tried any picaxe here. Picaxe appears to be built for 4mhz or 8mhz depending on the product.

    Ken, beyond any possible incompatibilities with the code, are you sure you are running at the proper speed? That would throw your measurements off as well. Since PBP defaults to 4mhz, try 8mhz and see if it is any better, if not probably a code incompatibility, or a config setting that is already set to something for the Picaxe, and you need to try to duplicate.

    Again, I have no experience with a picaxe, and had to do a search to find out what it was. Anyone have some Picaxe insight?

  19. #139
    Join Date
    May 2007
    Posts
    604

    Default

    See here PICAXE

  20. #140
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    I should have said to Ken, "Lets see your version of wall_racers, because you would have had to re-write it for PBP"

    So....

    Ken, post your code!!!
    Dave
    Always wear safety glasses while programming.

  21. #141
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default Post my code..

    I need to clean it up a bit.

    Yes, I did modify the original PICAXE basic to comply with our PCP rules. There were a couple of specification differences and there were a couple of typo's. My code compiles fine and runs OKAY. The flashing LED's tell me alot.

    Last week I focused my attention on making the DC motor and Servo work. I am now anxiously awaiting the arrival of ten SN7407N (all for $5.00! plus shipping)

    Now my focus has been on the arithmetic the code applies to echo pulse responses from the SRF05's. I am trying to reconcile what the code does with the SRF05 spec which reads:

    The SRF04 provides an echo pulse proportional to distance. If the width of the pulse is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148 will give the distance in inches. uS/58=cm or uS/148=inches.
    My last post was just looking for information. Is there no way to read RAM from the PICkit? Is there no way to put a break point in the real code?

    I'm going to try to better understand MPLAB IDE. It has a debugger mode.

    Thanks, Ken

    Thanks

  22. #142
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Unhappy Are PBP and PICkit2 Debug Express compatible?

    I have been trying to activate PICkit2 Debugger per instructions in Chapter 4 of the PICkit 2 User's GUIDE DS51553E

    I could not activate the project using 16F887Demo.asm per the User's Guide because my copy of that file is empty. Strange.

    I could not activate the project using wall_racers.asm. Each time I hit "Build all" it considered for a few moments then in RED LETTERS said BUILD FAILED. No explanation. No comments. No helpful information.

    I succeeded in activating a debug project using blink.asm from C:\PBP\PK2 Lessons\44 Pin Demo Board\02Blink.

    I have not the faintest idea what I have learned with this exercise. I know from the listing file which RAM locations I wish to read. I think I could figure out where to place the break point if I could get the debugger to accept the wall_racer.asm code.

    Ken

    Ken

  23. #143
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    I could not activate the project using wall_racers.asm. Each time I hit "Build all" it considered for a few moments then in RED LETTERS said BUILD FAILED. No explanation. No comments. No helpful information.
    Rename "wall_racers.bas" to something with 8 characters or less then start over with compiling and building.

    MPLAB does not like long file names.

    Try "racer.bas"
    Dave
    Always wear safety glasses while programming.

  24. #144
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Unhappy One more detail down

    Thanks macracket. Shortening the name made MPLAB happier. It actually tried to build my PBP code, but was very unsuccessful. Understand this is exactly the code that can be built, downloaded and run by PICkit 2 debugger software.

    MPLAB is not happy with the formate of the .asm code created by PBP. Below is a small snip of a huge list of complaints.

    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 235 : Illegal opcode (_blinkloop45)
    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 238 : Illegal opcode (_rangefront)
    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 241 : Illegal opcode (_blinkloop67)
    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 244 : Illegal opcode (_turnon)
    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 247 : Illegal opcode (_steerto)
    Warning[207] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 250 : Found label after column 1. (GOTO?L)
    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 250 : Illegal opcode (_main)
    Warning[207] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 253 : Found label after column 1. (LABEL?L)
    Error[122] C:\PK2 LESSONS\44PIN DEMO BOARD\RACERS\RACERS.ASM 253 : Illegal opcode (L00001)
    It would appear that PBP folks don't use MPLAB. True?

    Ken

  25. #145
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    MPLAB is used by PBP folks often. I use it about 25% of the time. MCS about 25% and gEdit(Linux) the remainder.

    Have you picked the correct PIC in MPLAB?

    Post your code and I will check it out here if you want.
    Dave
    Always wear safety glasses while programming.

  26. #146
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default Maybe if I were to write in C instead..

    If I write in the C language provided by Microchip would the MPLAB ICD work better? I do wish I could see what is going on....

    Ken

  27. #147
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default My code is 371 lines long

    macracket,

    Is it OKAY to post 371 lines of code on these forums? It is the copy that compiles, builds and works. However, it has comments, reminders and unnecessarys.


    Maybe I should email my code to you.

    Ken

  28. #148
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    Rename the file as a txt and attach it to the thread.
    Dave
    Always wear safety glasses while programming.

  29. #149
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default

    Quote Originally Posted by Kenjones1935 View Post
    If I write in the C language provided by Microchip would the MPLAB ICD work better? I do wish I could see what is going on....

    Ken
    An easy way to see "what's up" in absence of ICD is a simple 16x2 serial LCD module. Just connect it to an unused pin on your PIC and use "SEROUT" to send the values of assorted variables and stuff to right your display. Very easy, very handy...


    steve

  30. #150
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default Attached is my racer.bas code

    Here is the file that I have been compiling with MicroEngineering MicroCode Studio PICBasic Pro compiler, building with MPASM and programming with PICkit 2 successfully.

    The assembly language result from this MicroCode Studio compile is not acceptable to the Microchip PICkit 2 Debug Express MPLAB IDE.

    It says in RED "BUILD FAILED"

    OH! I see now. It is complaining about PBPPIC14.LIB lines 607, 623, 640, 643, 649 etc.

    These are all "if" statements that look like this:
    7785 if ($ > 800h)
    541 if ($ == (Label))
    552 if (((Label) & 800h) == 0)
    559 if (((Label) & 1000h) == 0)
    705 if ((Label) > $)
    722 if (((Label) & 1800h) == 0)
    725 if (((Label) & 800h) == 0)
    731 if (((Label) & 1000h) == 0)
    607 if ((Label) < 1)
    623 if ((Label) > $)
    640 if (((Label) & 1800h) == 0)
    643 if (((Label) & 800h) == 0)
    649 if (((Label) & 1000h) == 0)
    677 if ($ == (Label))
    689 if ((Label) < 1)


    Hundreds of:

    Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F887 "racers.asm" /l"racers.lst" /e"racers.err" /o"racers.o" /d__DEBUG=1
    Error[151] C:\PBP\PBPPIC14.LIB 7785 : Operand contains unresolvable labels or is too complex
    Error[151] C:\PBP\PBPPIC14.LIB 607 : Operand contains unresolvable labels or is too complex
    Error[151] C:\PBP\PBPPIC14.LIB 623 : Operand contains unresolvable labels or is too complex
    Error[151] C:\PBP\PBPPIC14.LIB 640 : Operand contains unresolvable labels or is too complex
    Error[151] C:\PBP\PBPPIC14.LIB 643 : Operand contains unresolvable labels or is too complex
    Followed by:

    Error[151] C:\PBP\PBPPIC14.LIB 559 : Operand contains unresolvable labels or is too complex
    ----------------------------------------------------------------------
    Debug build of project `C:\Pk2 Lessons\44Pin Demo Board\racers\racers.mcp' failed.
    Language tool versions: MPASMWIN.exe v5.35, mplink.exe v4.35
    Preprocessor symbol `__DEBUG' is defined.
    Tue Feb 16 20:56:41 2010
    ----------------------------------------------------------------------
    BUILD FAILED
    It appears that all I need to do is to figure out why this .lib file is incompatible with MPLAB IDE....

    Hmmmm....

    Ken
    Attached Files Attached Files

  31. #151
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default It appears the solution is easy.

    All I have to do is replace all the instances of '(Label)' with 'Label' in PBPPIC14.LIB

    But how did it get that way in the first place?

    Ken

  32. #152
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    I changed this line
    Code:
    loop while rangefront > frontfreetostopreverse and rangeright > outertrack and b0 < 20
    TO
    Code:
    while rangefront > frontfreetostopreverse and rangeright > outertrack and b0 < 20
    WEND
    Because I am still using PBP 2.50

    I compiled in MCS then created a project in MPLAB using the ASM from MCS work as the source.

    No problems here.


    Just wondering if you are selecting the correct PIC???

    Attached Images Attached Images   
    Dave
    Always wear safety glasses while programming.

  33. #153
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    Quote Originally Posted by Kenjones1935 View Post
    All I have to do is replace all the instances of '(Label)' with 'Label' in PBPPIC14.LIB

    But how did it get that way in the first place?

    Ken
    '(Label)'
    Is correct !!!
    Dave
    Always wear safety glasses while programming.

  34. #154
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default Still no go with debugger...

    macracket:

    I changed the do loop to a WHILE WEND loop. It compiled fine, but still would not assemble in the MPLAB Debugger. Same problem with the PICPBP14.LIB "if" statements. How can the .LIB files be at fault? Very strange. Sounds like some kind of compatibility problem.

    Attached is my Device Select 16F887 Window. It looks a little more flexible than yours, but basically the same

    Attached Images Attached Images  

  35. #155

    Default HDD spindle motor controller

    Hi all

    Thought this might be of some interest, the code is in C and there is no schematic , was just thing of 4 well synchronized hard drive spindle motors a an RC chasis , would be quite a fast car.

    Seems like a nice project though!
    http://bradthx.blogspot.com/2010/02/...le-motors.html

    Kind regards
    Dennis

  36. #156
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    Ken,

    Just to be sure we are all doing the same thing...

    1-- Write and compile the code using MCS.
    2-- Generating the ASM file with MCS set for MPASAM use.
    3-- Open a project in MPLAB.
    4-- Use the ASM file generated by MCS as the source for the MPLAB project.
    5-- Everything is in the same project directory.
    Dave
    Always wear safety glasses while programming.

  37. #157
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default Maybe we are not doing the same thing...

    1-- Write and compile the code using MCS.
    Compile PIC BASIC PRO code using
    MicroCode Studio version 3.0.0.5
    PICBASICPRO 2.6.0

    2-- Generating the ASM file with MCS set for MPASAM use
    Using MPASM per the following picture:


    3-- Open a project in MPLAB.

    Open the project in MPLAB IDE 8.43.00.00
    MPDebugger 3.10

    4-- Use the ASM file generated by MCS as the source for the MPLAB project.
    5-- Everything is in the same project directory.
    Attached Images Attached Images  

  38. #158
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,926

    Default

    Looks like the only difference is you are using the latest software, I am still using PBP2.50 and MPLAB v8.00.

    So I am at a loss now.
    Dave
    Always wear safety glasses while programming.

  39. #159
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default Waiting for the parts.

    Progress has been slow. It will be more fun when the SN7407's show up and I can make the car move.

    Ken

  40. #160
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default The SN7407's have not arrived - yet

    It's been more than a week. They were supposed to have been shipped via USPS. The vendor is not answering its email. Does not look good.

    Meanwhile I might as well get back to the REAL project. I have not decided on the least intrusive means to generate PWM. Using the toy level car all I have is bang/bang control. Full speed forward, full speed backward, stopped. Full turn left, Full turn right, straight ahead.

    With PWM control I have CONTROL. Thing is, I do not know whether I really need this complication. Probably not. But I do need for the microprocessor to be doing things while the car is moving. PAUSE does not cut it.

    Gotta put back on my thinking cap.

    Ken

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 81
    Last Post: - 9th June 2010, 10:37
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 8
    Last Post: - 12th August 2006, 21:03
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

Members who have read this thread : 8

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts