PDA

View Full Version : Just received my new PIC-LCD3310



cncmachineguy
- 6th April 2011, 20:41
Ok, hoping for some help here. I just received a PIC-LCD3310 form Sparkfun. Very nice LITTLE unit. Documentation is a little on the short side though. I plugged in the USB, and much to my surprise it does come with a small demo preprogrammed.

Where to go from here? Does it have a USB bootloader built in? If so, how to gain access? If not does anyone know which one works well with this? It would seem to me this would be the best way to use this. free myself from a programmer.

Any tips will be gratefully appreciated!! You will receive bounds of good karma from me, which along with $1.50 you can get some coffee :)

ScaleRobotics
- 6th April 2011, 22:57
Oh Oh, I need some karma for my coffee.

Here is Microchip's bootloader firmware for Olixex's PIC_LCD3310 board. I think I modified it to work with the joystick button. But it is set to the downward joystick. So to go to USB bootloader, press down direction on the joystick (not button press) while you apply usb power. Then use the attached microchip exe file for bootloader. Of course, you will need a pickit2 programmer, or something, to program it the first time.

http://www.olimex.com/dev/images/PIC/PIC-LCD3310-2.jpghttp://www.olimex.com/dev/images/PIC/PIC-LCD3310-3.jpg

Also included in the hope of more karma is an include file for working with the lcd display. It was made from a bunch of posts in this thread.: http://www.picbasic.co.uk/forum/showthread.php?t=327&p=73456#post73456 Without it, the LCD is a (*replace word for really difficult here*) to program.

But using the include file makes it pretty easy to work with.


@ PrintStr 0,0, "If I write more than one line, it will scroll to the next one, and next."
5325

cncmachineguy
- 7th April 2011, 03:13
Thanks a million Karma!! I found a little success. I connected the ole pickit2 and first uploaded the demo file. then programed the BL you Walter provided. The PC software said it connected so I tried programming with one of Walters files from the linked thread. I was hoping to have a screen that said something. But I got nothing. So back to the pickit and reprogrammed the demo. Well that worked again, so I must assume The program I tried to run just wasn't going to work. I must admit, I didn't really do much, here is the code as I tried it.


DEFINE OSC 48
DEFINE BOOTLOADER_USED =1 '{- I added this line
include "modedefs.bas"
include "LCD_3310v32.inc" '{- I modified this for the inc in the zip
start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"

end '{added cuz it seemed right



Seems like I also tried to use it without the bootloader, of course without the define for it. Still no joy

cncmachineguy
- 7th April 2011, 03:58
Ok I can blink the LED's


DEFINE OSC 20 ' this makes the pauses be correct time
'DEFINE LOADER_USED 1
include "modedefs.bas"
include "LCD_3310v32.inc"
start:

@ PrintStr 0,0, "I love being"
@ PrintStr 0,1, "able to print "
@ PrintStr 0,2, "so easily!"
low porte.2
pause 1000
low porte.3
pause 1000
high porte.2
pause 1000
high porte.3
pause 1000
goto start
end

but only if I program from MPLAB with no BL. and no LCD message :(

ScaleRobotics
- 7th April 2011, 04:33
Sorry, I will have to check into that other file. I need to look at the differences more to see what's going on. But this should get you going (with caps only). Use the attached include.5327



DEFINE LOADER_USED 1
DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader
OSCTUNE.6 = 1 'turn on PLL
DEFINE OSC 48
include "modedefs.bas"
include "LCD_3310.inc"

TRISD = 0
PORTD.0 = 1 'turn on g sensor
PORTD.1 = 0 'select scale for g sensor
PORTD.2 = 0 'select scale for g sensor


TRISA = %00000111 'set porta.0, 1, and 2 as inputs
TRISB = 0
TRISC = 0
CM1CON = 7
CM2CON = 7
TRISC = 0
TRISE = 0
ADCON0 = %00000001
ADCON1 = %00000010

@ PrintStr 0,0, "OK, I LOVE JUST BEING ABLE TO PRINT ON THE LCD SCREEN. BLINKING AN LED IS ALSO NICE."
END

cncmachineguy
- 7th April 2011, 04:54
Walter thank you so much. The BL is working and the printstr is working. As a side not, when it wasn't working, I could just hit the joystick down and it would connect. Now that it works, I DO have to actually unplug the USB and do it as you said too.

Also it seems to be running at 20 Mhz. my blinks are ~twice as long as they should be with OSC 48. When I change it to OSC 20, the pause commands seem to be 1 sec as expected.

But again, THANKS a million. I can go to bed now happy knowing this works so far :)

EDIT: Maybe nothing is wrong with the include, maybe I just needed to also add


DEFINE RESET_ORG 1000h

I will try this tomorrow

ScaleRobotics
- 7th April 2011, 12:09
Also it seems to be running at 20 Mhz. my blinks are ~twice as long as they should be with OSC 48. When I change it to OSC 20, the pause commands seem to be 1 sec as expected.


Hey Bert, add this line to the top of your code. It works whether or not you are using the bootloader.


OSCTUNE.6 = 1 'SET PLL TO ON


EDIT: Maybe nothing is wrong with the include, maybe I just needed to also add


DEFINE RESET_ORG 1000h

There is an issue with that LCD_3310v32.incfile, just not sure what yet....So for now, just use the LCD_3310.