tecnition_ted
New Member
Thank you Hippy, I'll try it later today and let you know the result.
That's not a great idea as using 'start1' and 'start2' will unintentionally cause the 08M2 to operate in multi-tasking mode which will likely cause quite a few problems.separated read program into Start1: and the OEL program into Start2:
If both are I2C devices then you will need to issue a HI2CSETUP command before accessing each.the commands sent by i2c to the BQ chip are stopping the information going to the OEL.
The I2CSLAVE command is an older, deprecated, equivalent of HI2CSETUP I2CMASTER.Why did setting up the master again work to change which slave it was looking at???? I was hoping you could just change the slave address then read it but if you try this then it does nothing on the OEL.
;new code serial LCD
low c.0 ; Initialize LCD output
pause 500 ; Wait for LCD to initialize
serout c.0, n2400, ( 254, $80 ) ; First line of display
serout c.0, n2400, ( " " ) ; Display "Temperature"
serout c.0, n2400, ( 254, $80 ) ; First line of display
serout c.0, n2400, ( "Temperature" ) ; Display "Temperature"
serout c.0, n2400, ( 254, $C0 ) ; Second line of display
serout c.0, n2400, ( " " ) ; Display the temperature
serout c.0, n2400, ( 254, $C0 ) ; Second line of display
serout c.0, n2400, ( "mmmmm" ) ; Display the temperature
;i2c code (not complete)
symbol counter = w0
symbol subcounter = b2
symbol fontlookup = b3
symbol pixels = b4
symbol displaybank = b5
symbol Volt = w4
symbol SOC = w5
symbol timetillemptymins = w6
symbol bTmp = w7
; save Font codes in EEPROM
Yes, that was my "guess" at the issue, but perhaps we need the OP to confirm he is using an 08M2 (since he appended his original question to an "old" thread).On an 08M2 the C.0 pin is the Download Serial Out. ...
Interesting post and a pretty good first attempt.I got a very cheap I2C display (<£3) from eBay, intending to use it with an 08M2 but couldn't find much information about it. After a few hours research and some experimenting, I managed to get the display working and thought it might be helpful to share the results.
I started with the excellent information in this thread, which is for a different display but with much in common: http://www.picaxeforum.co.uk/archive/index.php/t-23134.html I also got inspiration for the font lookup from this thread: http://www.picaxeforum.co.uk/entry.php?30-Notes-behind-Magic-Morse
This is the display I purchased: http://www.ebay.co.uk/itm/162337263365?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT
Although it says its 128 * 64, the display is actually 128 * 32 but the display memory holds 128 * 64. As each byte is written to the display memory it appears on screen so the display builds as it is sent. To avoid this, you can point the display to start at a specific memory location and as there is exactly enough memory for 2 screens of data you can write the message to the unused block and then point the display to it for instant update.
I needed to design a font to use with the display so I used excel to play around with different options. I settled on an 8 * 8 block for each character as this fitted very well with the display dimensions, giving four rows of sixteen characters. This is the spreadsheet I used:
https://www.dropbox.com/s/vw8mgrwu5hhi9dj/OLED Font.xls?dl=0
It converts the pixels into the eeprom commands needed to load the font into the 08M2. I only needed numbers and upper case characters (the programme will display any lower case characters as upper case). It would be straightforward to add any other characters that may be needed.
To send a message to the display you poke the required characters to memory locations 28 to 91 and then the programme looks up the font data and sends it to the display. When all the data has been sent, the display is pointed to the start of the latest message in display memory.
The code to drive the display is shown below. In this example the main programme just loads a message to memory locations 28 - 91, calls the sendtodisplay subroutine and then loops. As it only uses 413 bytes there is plenty of room for other code which could create its own messages.
This is my first attempt at Picaxe programming, so any pointers to improve the way I've gone about it would be greatly appreciated and I hope it is of some use!Code:symbol counter = w0 symbol subcounter = b2 symbol fontlookup = b3 symbol pixels = b4 symbol displaybank = b5 ; save Font codes in EEPROM eeprom 0,(124,130,130,130,124) ; 0 (ASCII 48) eeprom 5,(136,132,254,128,128) ; 1 eeprom 10,(196,162,162,146,140) ; 2 eeprom 15,(68,130,146,146,108) ; 3 eeprom 20,(48,40,36,254,32) ; 4 eeprom 25,(110,138,138,138,114) ; 5 eeprom 30,(124,146,146,146,100) ; 6 eeprom 35,(2,2,2,2,254) ; 7 eeprom 40,(108,146,146,146,108) ; 8 eeprom 45,(30,18,18,18,254) ; 9 (ASCII 57) eeprom 50,(254,18,18,18,254) ; A (ASCII 65) eeprom 55,(254,146,146,146,108) ; B eeprom 60,(254,130,130,130,130) ; C eeprom 65,(254,130,130,68,56) ; D eeprom 70,(254,146,146,146,130) ; E eeprom 75,(254,18,18,18,2) ; F eeprom 80,(254,130,130,146,242) ; G eeprom 85,(254,16,16,16,254) ; H eeprom 90,(130,130,254,130,130) ; I eeprom 95,(226,130,254,2,2) ; J eeprom 100,(254,16,40,68,130) ; K eeprom 105,(254,128,128,128,128) ; L eeprom 110,(254,2,254,2,254) ; M eeprom 115,(254,4,56,64,254) ; N eeprom 120,(254,130,130,130,254) ; O eeprom 125,(254,18,18,18,12) ; P eeprom 130,(124,130,162,66,188) ; Q eeprom 135,(254,18,50,82,140) ; R eeprom 140,(222,146,146,146,246) ; S eeprom 145,(2,2,254,2,2) ; T eeprom 150,(126,128,128,128,126) ; U eeprom 155,(30,96,128,96,30) ; V eeprom 160,(254,128,254,128,254) ; W eeprom 165,(198,40,16,40,198) ; X eeprom 170,(6,8,240,8,6) ; Y eeprom 175,(194,162,146,138,134) ; Z (ASCII 90) initialise: ; initialise i2c for display (ID 0x78) and then send power up instructions hi2csetup i2cmaster,%01111000,i2cfast,i2cbyte hi2cout 0x80,(0xAE,0x00,0x00,0xB0,0x20,0x00,0xD5,0x80,0xA8,0x1F,0xD3,0x00,0x8D, _ 0x14,0xA1,0x00,0xC8,0xDA,0x02,0x81,0xCF,0xD9,0xF1, 0xDB,0x30,0xA4,0xA6) gosub sendtodisplay ; send 4 blank lines to clear display let displaybank = 0 ; flag rows 0-3 for display hi2cout 0x80,(0xAF) ; turn display on main: ; Insert your programme code here and then poke 28-91 with message to be displayed poke 28," ","T","H","I","S"," ","I","S"," ","A"," ","T","E","S","T"," ";data to send to display (4 * 16) poke 44,"O","F"," ","T","H","E"," ","O","U","T","P","U","T"," ","T","O" poke 60,"T","H","E"," ","O","L","E","D"," ","D","I","S","P","L","A","Y" poke 76,"F","R","O","M"," ","A","N"," ","0","8","M","2"," ","P","I","C" displaybank = 1 - displaybank ; toggle lines to display gosub sendtodisplay ; load message to display memory and point display at it ; Insert any further code you require here goto main sendtodisplay: ; sends characters in memory locations 28-91 to the display for counter = 28 to 91 PEEK counter, fontlookup ; load character to output select case fontlookup case 48 to 57 ; 0-9 fontlookup = fontlookup - 48 * 5 case 65 to 90 ; A-Z fontlookup = fontlookup -65 * 5 + 50 case 97 to 122 ; a-z output as A-Z fontlookup = fontlookup - 97 * 5 + 50 else fontlookup = 244 ; all other characters will display a blank endselect hi2cout 0x40,(0) ; one blank column for subcounter = 0 to 4 read fontlookup, pixels hi2cout 0x40,(pixels) ; followed by 5 columns per character fontlookup = fontlookup + 1 next subcounter hi2cout 0x40,(0,0) ; two blank columns next counter ; this completes the 8x8 character output If displaybank = 0 then hi2cout 0x80,(0x40) ; point display to lines 0-3 of display memory else hi2cout 0x80,(0x60) ; point display to lines 4-7 of display memory Endif return
That's very odd. If it works by itself it should also work with code added after it. The AXE133 should have been initialised and written to exactly the same.The code works on its own on the same 20m2 the oel is attached to if the oel code is removed but when added to the top of the code it docent work or even clear the built in picaxe .com logo
;new code serial LCD
low c.0 ; Initialize LCD output
pause 500 ; Wait for LCD to initialize
serout c.0, n2400, ( 254, $80 ) ; First line of display
serout c.0, n2400, ( " " ) ; Display "Temperature"
serout c.0, n2400, ( 254, $80 ) ; First line of display
serout c.0, n2400, ( "Temperature" ) ; Display "Temperature"
serout c.0, n2400, ( 254, $C0 ) ; Second line of display
serout c.0, n2400, ( " " ) ; Display the temperature
serout c.0, n2400, ( 254, $C0 ) ; Second line of display
serout c.0, n2400, ( "mmmmm" ) ; Display the temperature
pause 60000 ;added delay to see if information is displayed
symbol counter = w0
symbol subcounter = b2
symbol fontlookup = b3
symbol pixels = b4
symbol displaybank = b5
symbol Volt = w4
symbol SOC = w5
symbol timetillemptymins = w6
symbol bTmp = w7
; save Font codes in EEPROM
eeprom 0,(124,130,130,130,124) ; 0 (ASCII 48)
eeprom 5,(136,132,254,128,128) ; 1
eeprom 10,(196,162,162,146,140) ; 2
eeprom 15,(68,130,146,146,108) ; 3
eeprom 20,(48,40,36,254,32) ; 4
eeprom 25,(110,138,138,138,114) ; 5
eeprom 30,(124,146,146,146,100) ; 6
eeprom 35,(2,2,2,2,254) ; 7
eeprom 40,(108,146,146,146,108) ; 8
eeprom 45,(30,18,18,18,254) ; 9 (ASCII 57)
eeprom 50,(254,18,18,18,254) ; A (ASCII 65)
eeprom 55,(254,146,146,146,108) ; B
eeprom 60,(254,130,130,130,130) ; C
eeprom 65,(254,130,130,68,56) ; D
eeprom 70,(254,146,146,146,130) ; E
eeprom 75,(254,18,18,18,2) ; F
eeprom 80,(254,130,130,146,242) ; G
eeprom 85,(254,16,16,16,254) ; H
eeprom 90,(130,130,254,130,130) ; I
eeprom 95,(226,130,254,2,2) ; J
eeprom 100,(254,16,40,68,130) ; K
eeprom 105,(254,128,128,128,128) ; L
eeprom 110,(254,2,254,2,254) ; M
eeprom 115,(254,4,56,64,254) ; N
eeprom 120,(254,130,130,130,254) ; O
eeprom 125,(254,18,18,18,12) ; P
eeprom 130,(124,130,162,66,188) ; Q
eeprom 135,(254,18,50,82,140) ; R
eeprom 140,(222,146,146,146,246) ; S
eeprom 145,(2,2,254,2,2) ; T
eeprom 150,(126,128,128,128,126) ; U
eeprom 155,(30,96,128,96,30) ; V
eeprom 160,(254,128,254,128,254) ; W
eeprom 165,(198,40,16,40,198) ; X
eeprom 170,(6,8,240,8,6) ; Y
eeprom 175,(194,162,146,138,134) ; Z (ASCII 90)
initialise:
; initialise i2c for display (ID 0x78) and then send power up instructions
hi2csetup i2cmaster,$78,i2cfast,i2cbyte
hi2cout 0x80,(0xAE,0x00,0x00,0xB0,0x20,0x00,0xD5,0x80,0xA8,0x1F,0xD3,0x00,0x8D, _
0x14,0xA1,0x00,0xC8,0xDA,0x02,0x81,0xCF,0xD9,0xF1, 0xDB,0x30,0xA4,0xA6)
gosub sendtodisplay ; send 4 blank lines to clear display
let displaybank = 0 ; flag rows 0-3 for display
hi2cout 0x80,(0xAF) ; turn display on
main:
i2cslave 0xAA, i2cfast, i2cbyte
readi2c 0x08,(b8) ; Read volt from eeprom
readi2c 0x09,(b9) ; Read volt from eeprom
pause 10
readi2c 0x2c,(b10) ; Read SOC from eeprom
readi2c 0x2d,(b11) ; Read SOC from eeprom
pause 10
readi2c 0x16,(b12) ; Read time till empty mins from eeprom
readi2c 0x17,(b13) ; Read time till empty mins eeprom
debug ; Show result
hi2csetup i2cmaster,$78,i2cfast,i2cbyte;
; Insert your programme code here and then poke 28-91 with message to be displayed
;data to send to display (4 * 16)
poke 28,"T","i","m","e"," ","l","e","f","t"," "
bTmp = timetillemptymins / 1000 // 10 + "0" : Poke 38, bTmp
bTmp = timetillemptymins / 100 // 10 + "0" : Poke 39, bTmp
bTmp = timetillemptymins / 10 // 10 + "0" : Poke 40, bTmp
bTmp = timetillemptymins // 10 + "0" : Poke 41, bTmp
poke 42," "," "
poke 44," "," ","V","o","l","t"," " ;
bTmp = Volt / 1000 // 10 + "0" : Poke 51, bTmp
bTmp = Volt / 100 // 10 + "0" : Poke 52, bTmp
bTmp = Volt / 10 // 10 + "0" : Poke 53, bTmp
bTmp = Volt // 10 + "0" : Poke 54, bTmp
poke 55," "," "," "," "," "
poke 60," "," ","S","o","c"," "," "
bTmp = SOC / 1000 // 10 + "0" : Poke 67, bTmp
bTmp = SOC / 100 // 10 + "0" : Poke 68, bTmp
bTmp = SOC / 10 // 10 + "0" : Poke 69, bTmp
bTmp = SOC // 10 + "0" : Poke 70, bTmp
poke 71," "," "," "," "," "
poke 76," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "
displaybank = 1 - displaybank ; toggle lines to display
gosub sendtodisplay ; load message to display memory and point display at it
; Insert any further code you require here
goto main
sendtodisplay: ; sends characters in memory locations 28-91 to the display
for counter = 28 to 91
PEEK counter, fontlookup ; load character to output
select case fontlookup
case 48 to 57 ; 0-9
fontlookup = fontlookup - 48 * 5
case 65 to 90 ; A-Z
fontlookup = fontlookup -65 * 5 + 50
case 97 to 122 ; a-z output as A-Z
fontlookup = fontlookup - 97 * 5 + 50
else
fontlookup = 244 ; all other characters will display a blank
endselect
hi2cout 0x40,(0) ; one blank column
for subcounter = 0 to 4
read fontlookup, pixels
hi2cout 0x40,(pixels) ; followed by 5 columns per character
fontlookup = fontlookup + 1
next subcounter
hi2cout 0x40,(0,0) ; two blank columns
next counter ; this completes the 8x8 character output
If displaybank = 0 then
hi2cout 0x80,(0x40) ; point display to lines 0-3 of display memory
else hi2cout 0x80,(0x60) ; point display to lines 4-7 of display memory
Endif
return
0x17 isn't a valid I2C Device Address for a PICAXE. The PICAXE uses 8-bit Device Addresses with the least significant bit as zero.I am trying to read SM bus and when I change the read address to 0x17 I get an error but if I change it one number up or down all is ok?
;low c.0 ; Initialise LCD output
;pause 500 ; Wait for LCD to initialise
;serout c.0, n2400, ( 254, $80 ) ; First line of display
;serout c.0, n2400, ( " " ) ; Display "Temperature"
;serout c.0, n2400, ( 254, $80 ) ; First line of display
;serout c.0, n2400, ( "Temperature" ) ; Display "Temperature"
;serout c.0, n2400, ( 254, $C0 ) ; Second line of display
;serout c.0, n2400, ( " " ) ; Display the temperature
;serout c.0, n2400, ( 254, $C0 ) ; Second line of display
;serout c.0, n2400, ( "mmmmm" ) ; Display the temperature
symbol counter = w0
symbol subcounter = b2
symbol fontlookup = b3
symbol pixels = b4
symbol displaybank = b5
symbol Volt = w4
symbol SOC = w5
symbol timetillemptymins = w6
symbol bTmp = w7
; save Font codes in EEPROM
eeprom 0,(124,130,130,130,124) ; 0 (ASCII 48)
eeprom 5,(136,132,254,128,128) ; 1
eeprom 10,(196,162,162,146,140) ; 2
eeprom 15,(68,130,146,146,108) ; 3
eeprom 20,(48,40,36,254,32) ; 4
eeprom 25,(110,138,138,138,114) ; 5
eeprom 30,(124,146,146,146,100) ; 6
eeprom 35,(2,2,2,2,254) ; 7
eeprom 40,(108,146,146,146,108) ; 8
eeprom 45,(30,18,18,18,254) ; 9 (ASCII 57)
eeprom 50,(254,18,18,18,254) ; A (ASCII 65)
eeprom 55,(254,146,146,146,108) ; B
eeprom 60,(254,130,130,130,130) ; C
eeprom 65,(254,130,130,68,56) ; D
eeprom 70,(254,146,146,146,130) ; E
eeprom 75,(254,18,18,18,2) ; F
eeprom 80,(254,130,130,146,242) ; G
eeprom 85,(254,16,16,16,254) ; H
eeprom 90,(130,130,254,130,130) ; I
eeprom 95,(226,130,254,2,2) ; J
eeprom 100,(254,16,40,68,130) ; K
eeprom 105,(254,128,128,128,128) ; L
eeprom 110,(254,2,254,2,254) ; M
eeprom 115,(254,4,56,64,254) ; N
eeprom 120,(254,130,130,130,254) ; O
eeprom 125,(254,18,18,18,12) ; P
eeprom 130,(124,130,162,66,188) ; Q
eeprom 135,(254,18,50,82,140) ; R
eeprom 140,(222,146,146,146,246) ; S
eeprom 145,(2,2,254,2,2) ; T
eeprom 150,(126,128,128,128,126) ; U
eeprom 155,(30,96,128,96,30) ; V
eeprom 160,(254,128,254,128,254) ; W
eeprom 165,(198,40,16,40,198) ; X
eeprom 170,(6,8,240,8,6) ; Y
eeprom 175,(194,162,146,138,134) ; Z (ASCII 90)
initialise:
; initialise i2c for display (ID 0x78) and then send power up instructions
hi2csetup i2cmaster,$78,i2cfast,i2cbyte
hi2cout 0x80,(0xAE,0x00,0x00,0xB0,0x20,0x00,0xD5,0x80,0xA8,0x1F,0xD3,0x00,0x8D, _
0x14,0xA1,0x00,0xC8,0xDA,0x02,0x81,0xCF,0xD9,0xF1, 0xDB,0x30,0xA4,0xA6)
gosub sendtodisplay ; send 4 blank lines to clear display
let displaybank = 0 ; flag rows 0-3 for display
hi2cout 0x80,(0xAF) ; turn display on
main:
i2cslave 0x16, i2cslow, i2cbyte
readi2c 0x08,(b8) ; Read volt from eeprom
readi2c 0x09,(b9) ; Read volt from eeprom
readi2c 0x0F,(b10) ; Read SOC from eeprom
readi2c 0x10,(b11) ; Read SOC from eeprom
readi2c 0x06,(b12) ; Read time till empty mins from eeprom
readi2c 0x17,(b13) ; Read time till empty mins eeprom
debug ; Show result
hi2csetup i2cmaster,$78,i2cfast,i2cbyte;
; Insert your programme code here and then poke 28-91 with message to be displayed
;data to send to display (4 * 16)
poke 28,"T","i","m","e"," ","l","e","f","t"," "
bTmp = timetillemptymins / 1000 // 10 + "0" : Poke 38, bTmp
bTmp = timetillemptymins / 100 // 10 + "0" : Poke 39, bTmp
bTmp = timetillemptymins / 10 // 10 + "0" : Poke 40, bTmp
bTmp = timetillemptymins // 10 + "0" : Poke 41, bTmp
poke 42," "," "
poke 44," "," ","V","o","l","t"," " ;
bTmp = Volt / 1000 // 10 + "0" : Poke 51, bTmp
bTmp = Volt / 100 // 10 + "0" : Poke 52, bTmp
bTmp = Volt / 10 // 10 + "0" : Poke 53, bTmp
bTmp = Volt // 10 + "0" : Poke 54, bTmp
poke 55," "," "," "," "," "
poke 60," "," ","S","o","c"," "," "
bTmp = SOC / 1000 // 10 + "0" : Poke 67, bTmp
bTmp = SOC / 100 // 10 + "0" : Poke 68, bTmp
bTmp = SOC / 10 // 10 + "0" : Poke 69, bTmp
bTmp = SOC // 10 + "0" : Poke 70, bTmp
poke 71," "," "," "," "," "
poke 76," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "
displaybank = 1 - displaybank ; toggle lines to display
gosub sendtodisplay ; load message to display memory and point display at it
; Insert any further code you require here
goto main
sendtodisplay: ; sends characters in memory locations 28-91 to the display
for counter = 28 to 91
PEEK counter, fontlookup ; load character to output
select case fontlookup
case 48 to 57 ; 0-9
fontlookup = fontlookup - 48 * 5
case 65 to 90 ; A-Z
fontlookup = fontlookup -65 * 5 + 50
case 97 to 122 ; a-z output as A-Z
fontlookup = fontlookup - 97 * 5 + 50
else
fontlookup = 244 ; all other characters will display a blank
endselect
hi2cout 0x40,(0) ; one blank column
for subcounter = 0 to 4
read fontlookup, pixels
hi2cout 0x40,(pixels) ; followed by 5 columns per character
fontlookup = fontlookup + 1
next subcounter
hi2cout 0x40,(0,0) ; two blank columns
next counter ; this completes the 8x8 character output
If displaybank = 0 then
hi2cout 0x80,(0x40) ; point display to lines 0-3 of display memory
else hi2cout 0x80,(0x60) ; point display to lines 4-7 of display memory
Endif
return
It is probably best to keep to this thread for now.Should this moved to another posting as although it is connected to the above code it is more about reading SM bus?
That's very odd because, if the AXE133 code works when there's no I2C code following it, it should also work when that I2C code is present with a PAUSE 60000 between the two. The AXE133 should be initialised, then the initial display should be shown for a full minute, not just a half second.When the delay was added the display remained on picaxe.com screen nothing changed for half a second then the i2c program resumed as normal
Thanks. I'll take a look at that.here is the link to the data sheet http://www.ti.com/lit/ds/symlink/bq40z50-r1.pdf
#Picaxe 20M2
#Terminal 4800
#No_Data
Do
Pause 3000
SerTxd( CR, LF )
HI2cSetup I2CMASTER, 0x16, I2CSLOW, I2CBYTE
HI2cIn 0x20,(b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21)
SerTxd("Manufacturer=") : b0=21 : Gosub ShowText
HI2cIn 0x21,(b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21)
SerTxd("Device=") : b0=21: Gosub ShowText
HI2cIn 0x22,(b1,b2,b3,b4,b5)
SerTxd("Chemistry=") : b0=5: Gosub ShowText
; Day + Month*32 + (Year–1980)*512
HI2cIn 0x18,(b1,b0)
w1 = w0 & 31
w2 = w0 / 32 & 15
w3 = w0 / 512 + 1980
SerTxd("Date=",#w3,"-",#w2,"-",#w1)
w0 = b0 * 256 + b1
w1 = w0 & 31
w2 = w0 / 32 & 15
w3 = w0 / 512 + 1980
SerTxd(" or ",#w3,"-",#w2,"-",#w1, CR, LF)
Loop
ShowText:
bPtr = 1
Do
b27 = @bPtrInc
If b27 >= 0x20 And b27 <= 0x7E Then
SerTxd( b27 )
Else
SerTxd( "<", #b27, ">" )
End If
Loop Until bPtr > b0
SerTxd( CR, LF )
Return
Page 6 shows the internal pull-down resistors on the "SMBus" as 1 Mohms, so not likely to significantly affect the normal I2C pullup impedances and voltages.For a start, Page 35 - "The SMBus clock and data lines have internal pulldown.
HI2cIn 0x20,(b0)
Select Case b0
Case 1 : HI2cIn 0x20,(b0,b1)
Case 2 : HI2cIn 0x20,(b0,b1,b2)
That's very odd because, if the AXE133 code works when there's no I2C code following it, it should also work when that I2C code is present with a PAUSE 60000 between the two. The AXE133 should be initialised, then the initial display should be shown for a full minute, not just a half second.tecnition_ted said:
When the delay was added the display remained on picaxe.com screen nothing changed for half a second then the i2c program resumed as normal
#Picaxe 20M2
#Terminal 4800
#No_Data
Do
Pause 3000
SerTxd("Scanning...",CR,LF)
For b7 = 0x10 To 0xEE Step 2
HI2cSetup I2CMASTER, b7, I2CSLOW, I2CBYTE
HI2cIn 0x18,(b1,b0)
If w0 <> $FFFF Then
b1 = b7 / 16 + "0" : If b1 > "9" Then : b1 = b1 + 7 : End If
b0 = b7 & 15 + "0" : If b0 > "9" Then : b0 = b0 + 7 : End If
SerTxd( "Found Device Address 0x", b1, b0, CR, LF )
End If
Next
Loop
Not really; it is a complete mystery.Any ideas about the serial screen not operating? bit of a mystery