I believe Darrel Taylor was using a 12F1822. Doesn't that have the same "bit core" as my 12F629?
According to the Microchip datasheet on the 12F1822,
"This family of devices contains an enhanced mid-range 8-bit CPU core"
I believe Darrel Taylor was using a 12F1822. Doesn't that have the same "bit core" as my 12F629?
According to the Microchip datasheet on the 12F1822,
"This family of devices contains an enhanced mid-range 8-bit CPU core"
The PIC numbering system was getting me confused so I spoke to an engineer at Microchip and this is what I was told...
The 12 in the 12F629 means it is an 8 pin chip. (I didn't ask why 12 means 8 or why they just didn't just call it an 8Fxxx)
The 6 after the F means that it has a 14 bit memory core, since anything other (? # > 5) has a 14 bit memory core.
A 12F5xx chip would be an 8 pin chip with a 12 bit memory core...
So it does not seem to a 12-bit core problem but rather an overall memory problem.
The 12F629 has 1k x 14 memory (there's that 14 bit core again), where as
the 12F1822 has 2K 14 memory.
I ordered some 12F1822s to see if I can get Darrel's program working.
Here is the thread in which I believe Darrel was using a 12F1822.
Post #3
http://support.melabs.com/threads/98...F8574-20x4-LCD
Hmmm, unfortunately, I just figured out that my Silver version of PBP3.0 doesn't support the 12F1822...
a pic12f1xxx is an enhanced midrange device . they have twice the stack capacity of a 12f6xx device , apart from more memory etc ....
Thanks to everyone that helped out.
I have gotten a modified version of Darrel's code to run on a 12F683 which has 2K of memory.
I am using an LCD 1602 and I don't see any Jumping Jacks.
Code:; Filename : 632-I2C-LCD for 12F683.pbp ; Author : Darrel Taylor ; Created : Mon Feb 24 2014 ; : May 27, 2015 adapted for the 12F683 ; Processor : PIC12F683 ; Compiler : PicBasic Pro 3.0.7.x or higher ; Description : Uses PCF8574 Port expander to interface with HD44780 LCD ; ;----[Oscillator Setup]--------------------------------------------------------- define OSC 20 define I2C_SLOW 1 ;----[Aliases]------------------------------------------------------------------ SDA VAR GPIO.0 ; I2C Data pin SCL VAR GPIO.1 ; I2C Clock Pin ;----[Initialize Hardware]------------------------------------------------------ ANSEL = 0 ; Make Analog inputs digital ';----[Setup LCD using PCF8574 Port Expander]------------------------------------ LCD_Addr CON $40 ; A0, A1, A2 grounded true con 1 false con 0 INCLUDE "LCD_PCF8574.pbp" ; Init LCD using I2C and PCF8574 ;----[Variables]---------------------------------------------------------------- LoopCount VAR BYTE CustChar VAR BYTE ;----[Program Start]------------------------------------------------------------ Backlight = 0 ; Turn on LCD Backlight LoopCount = 0 ARRAYWRITE LCD_Buff,[" LCD PCF8574"] : LCD_WriteBuff ;----[Custom Characters]-(Jumping Jacks)---------------------------------------- ARRAYWRITE LCD_Buff,[$FE,$40,$00,$04,$0A,$04,$0E,$15,$0A,$11]:LCD_WriteBuff ' #0 ARRAYWRITE LCD_Buff,[$FE,$48,$00,$04,$0A,$04,$1F,$04,$0A,$0A]:LCD_WriteBuff ' #1 ARRAYWRITE LCD_Buff,[$FE,$50,$04,$0A,$15,$0E,$04,$0A,$0A,$00]:LCD_WriteBuff ' #2 ;----[Main Program Loop]-------------------------------------------------------- Main: ARRAYWRITE LCD_Buff,[$FE,$C0,"Count = ",DEC LoopCount," "] : LCD_WriteBuff PAUSE 200 LoopCount = LoopCount + 1 CustChar = LoopCount//3 ; Jumping Jacks Sequence ARRAYWRITE LCD_Buff,[$FE,$9D,CustChar] : LCD_WriteBuff GOTO Main
Commented out the lines...
ARRAYWRITE LCD_Buff,[" LCD PCF8574"] : LCD_WriteBuff
and
ARRAYWRITE LCD_Buff,[$FE,$C0,"Count = ",DEC LoopCount," "] : LCD_WriteBuff
Changed the $9D to a $C0 in
ARRAYWRITE LCD_Buff,[$FE,$C0,CustChar] : LCD_WriteBuff ' $C0 was $9D
and now the little guy is doing Jumping Jacks in the lower left hand corner.
Thanks again!
I am trying to make this code work with a 16F629A and all I get is a blinking back light with the modified code below.I am probably missing something simple?
Thanks,
; Filename : Test_LCD_PCF8574.pbp
; Author : Darrel Taylor
; Created : Mon Feb 24 2014
; Processor : 16F629A
; Compiler : PicBasic Pro 3.0.6.x or higher
; Description : Uses PCF8574 Port expander to interface with HD44780 LCD
;
;----[16f629A Hardware Configuration]-------------------------------------------
#config
__config _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_ON & _BODEN_OFF
#endconfig
;----[Aliases]------------------------------------------------------------------
SDA var porta.7
SCL var porta.6
;----[Initialize Hardware]------------------------------------------------------
CMCON = 7 'CHANGES PORTA TO DIGITAL
;----[Setup LCD using PCF8574 Port Expander]------------------------------------
LCD_Addr CON $7E
INCLUDE "LCD_PCF8574.pbp" ; Include LCD module for PCF8574
;----[Variables]----------------------------------------------------------------
LoopCount VAR BYTE
CustChar VAR BYTE
;----[Program Start]------------------------------------------------------------
Backlight = 0 ; Turn on LCD Backlight
ARRAYWRITE LCD_Buff,[" LCD PCF8574"] : LCD_WriteBuff
LoopCount= 0
;----[Custom Characters]-(Jumping Jacks)----------------------------------------
ARRAYWRITE LCD_Buff,[$FE,$40,$00,$04,$0A,$04,$0E,$15,$0A,$11]:LCD_WriteBuff ' #0
ARRAYWRITE LCD_Buff,[$FE,$48,$00,$04,$0A,$04,$1F,$04,$0A,$0A]:LCD_WriteBuff ' #1
ARRAYWRITE LCD_Buff,[$FE,$50,$04,$0A,$15,$0E,$04,$0A,$0A,$00]:LCD_WriteBuff ' #2
;----[Main Program Loop]--------------------------------------------------------
Main:
ARRAYWRITE LCD_Buff,[$FE,$C0,"Count = ",DEC LoopCount," "] : LCD_WriteBuff
PAUSE 200
LoopCount = LoopCount + 1
CustChar = LoopCount//3 ; Jumping Jacks Sequence
ARRAYWRITE LCD_Buff,[$FE,$C0,CustChar] : LCD_WriteBuff
GOTO Main
Bookmarks