PDA

View Full Version : Starting over with PICBasic Pro 3



tracecom
- 4th March 2013, 00:09
Last year, I made a little progess with PICs, but not much. Now, I am trying again and remember why I gave up: total confusion.

I have a working 16F84A on a homemade breadboard assembly. I have a 16 x 2 LCD to which I have connected a Modern Device serial backpack.

I have MPLAB version 8.89 installed, and a PICKit 2. I have PBP3 Gold installed.

Would someone please give me some Hello World code that runs, and a connection scheme? I think if I can just get one thing working, I can move on from there.

Thanks.

Acetronics2
- 4th March 2013, 07:17
May be you could find a starting point here C:\PBP3\EXAMPLES\General PBP\LCD Yesss ... it's an "adress" inside YOUR computer !

... the following step being using the "SEROUT" command in your holy manual ...

surprising ?

Alain

tracecom
- 4th March 2013, 12:45
If I hadn't already read the manual and tried (unsuccessfully) everything in it that seemed remotely possible, I wouldn't have asked for someone to "please give me some Hello World code that runs, and a connection scheme." I would be grateful to anyone here who would do that.

To those who aren't so inclined, I regret that I wasted your time reading my post. However, I don't need to be made to feel any more ignorant than I already feel.

Thanks.

HenrikOlsson
- 4th March 2013, 18:59
Hi,
The first thing you need to do is get a simple LED blinking at a frequency you determine. Once you've got that going you know that the PIC is running and that it's running at the correct frequency.
Here's a schematic for the 16F628 that I did for another thread the other day, it would look very similar for the 16F84 but you need to double check and possibly "convert" the pin-numbers so that they match.
6861

If you need more help then please post a schematic and/or photo of your setup and the code you're using.

Once you've got the LED blinking you can move on to the LCD. If you need more help with that part then same thing applies, post schematics and code, link to documentation on the serial backpack etc would be usefull as well. Perhaps it's designed to driven at proper RS232 levels and not at logic level....?

/Henrik.

Ioannis
- 5th March 2013, 08:47
Do you have communication between F84 and Pickit2?

Ioannis

tracecom
- 5th March 2013, 23:53
For the benefit of anyone who might land on this thread in the future, here's some code that works.

'************************************************* ***************
'* Name : Serial LCD.pbp *
'* Author : tracecom *
'* Notice : *
'* : *
'* Date : 3/5/2013 *
'* Version : 1.0 *
'* Notes : PIC16F84A *
'* : Modern Device LCD117 Serial Adapter & 2x16 LCD. *
'************************************************* ***************

Include "modedefs.bas"
serout 0,T2400,["?BFF"] ' Set LCD backlight to maximum brightness.
PAUSE 200 ' Pause to allow LCD EEPROM to program.
SEROUT 0,T2400,["?G216"]' Configure the LCD geometry: 2x16.
PAUSE 200 ' Pause to allow LCD EEPROM to program.

main:
pause 1000 ' Wait for the LCD to startup.
serout 0,T2400,["?f"] ' Clear the screen.
pause 1000 ' Wait one second.
serout 0,T2400,["Wherever you go,"] ' Send the string "Wherever you go,".
serout 0,T2400,["?m"] ' Move the cursor to the second line.
serout 0,T2400,[" there you are."] ' Send the string " there you are."
pause 1000 ' Wait one second.
goto main ' Do it again.


ETA: I do get an error message from the PICkit2: Verification of configuration failed.
But the LCD works.