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
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
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:cool:
Thank you all!!
1 Attachment(s)
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.
http://www.picbasic.co.uk/forum/atta...1&d=1266089174
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
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
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
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
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
1 Attachment(s)
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:
Quote:
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:
Quote:
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:
Quote:
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
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
1 Attachment(s)
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
http://www.picbasic.co.uk/forum/atta...1&d=1266426473
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
1 Attachment(s)
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:
http://www.picbasic.co.uk/forum/atta...1&d=1266545112
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.
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