Your code looks OK with the exception , I think, that it is PORTB.2 that goes to the MAX232.
If I am wrong on that try the Serial Communicator built into MCS.
Your code looks OK with the exception , I think, that it is PORTB.2 that goes to the MAX232.
If I am wrong on that try the Serial Communicator built into MCS.
Dave
Always wear safety glasses while programming.
Thank you and inquiring minds would like to know why B.2?
Isn't Port B.2 the TX-in for the Max 232 on a 16F628A or am I looking for a specific type of port?
Thanks, Ed
Last edited by Ramius; - 1st May 2011 at 21:22.
B.2 is the TX and B.1 is the RX from the 628.
Just a matter of looking at it as out from the PIC and in to the MAX.
Are you up and running now?
Dave
Always wear safety glasses while programming.
Hi, no sadly I am not able to get it to work. I am using Microcode Studio plus, MPLAB IDE, and a Picstart Plus programmer. Somewhere within these three I have made the wrong choices and being perfectly honest, not knowing what options to chose. I think it will probably take a phone call to/from someone to go through the setups. Thanks though, Ed
Sorry that I could not help.
But a call to MeLabs and a talk with Darrell should fix you up.
Let us know how it goes.
Dave
Always wear safety glasses while programming.
I don't think the 628a is capable of writing to its own memory. So I don't think it is possible for you to use a bootloader for that chip. So what happens if you take this out of your code?
Define LOADER_USED 1
Also, you could try out the sample hex file code on MeLabs website (but it is made for the 4 Mhz crystal that comes with the hardware), just to make sure the hardware is working as you thought. http://melabs.com/doclist.htm#X3
When you define the osc, you must use capitals! DEFINE OSC 20. PBP is proably defaulting to 4 mhz.
Also, the MeLabs example program for that hardware uses PortB.2, like Dave mentioned. Here is their example:
Code:Include "modedefs.bas" ' Mode definitions for Serout loop: Serout PORTB.2,T2400,["Hello",10,13] ' Display "Hello", next line Pause 500 ' Wait .5 second Serout PORTB.2,T2400,["World",10,13,10,13] ' Display "World", skip a line Pause 500 ' Wait .5 second Goto loop ' Do it forever End
Last edited by ScaleRobotics; - 2nd May 2011 at 14:55. Reason: added hex file idea
Hi Ed,
Ok so I gotta ask, is anything working, have you verified the code got in the PIC? Did you preprogram it with the bootloader? Did you get any errors when loading any of the code / bootloader ? What is going on inside my mind right now is I am seeing you define OSC 20, and I am wondering what config fuse got programmed into the chip, HS, XT, or other . . . Will a boot loaded program even run at 20 ? I don't know, as I have NEVER used a bootloader. Those are my thoughts.
HTH
JS
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Hi All!
Turned out that a 10 MHz resonator was installed! Thanks to all!
Sincerely, Ed
Bookmarks