mike
mssp is pretty easy
SSP1CON1=0x21 ;$22,21,20 all work @32mhz 20 is fastest
SSP1STAT=0x40
sdo and sck pins set to dig o/p
to transfer data
PIR1.3=0
SSP1BUF = data
WHILE (!PIR1.3) ;
tried your code on 16f1847 ,its not working
mike
mssp is pretty easy
SSP1CON1=0x21 ;$22,21,20 all work @32mhz 20 is fastest
SSP1STAT=0x40
sdo and sck pins set to dig o/p
to transfer data
PIR1.3=0
SSP1BUF = data
WHILE (!PIR1.3) ;
tried your code on 16f1847 ,its not working
Warning I'm not a teacher
It seems XC8 is placing my program code on top of my font table in the 0700h area of memory. More detective work (sigh)...
Thanks for the MSSP/SPI info, Richard. I will get to that after tracking down the current problem...
Mike
<added>
If you get a chance, add the "ovrld" param' to the following line and tell me if that fixes the problem, please?
Code:PSECT myFonts, class=CODE, abs, ovrld, space=0, delta=2 ^^^^^
Last edited by Mike, K8LH; - 26th May 2018 at 14:55.
ovrld,
does not fix it
even local too
there is more wrong than just that , the putwreg function is getting called six times for the wrchar
and only 5 times for the entire putstr call
its a total bitch to debug with all that inline asm , the debugger just
goes stupid
putcmd looks fine on the logic analyser , it all goes pear shaped from then on
Warning I'm not a teacher
Sorry, Richard (and gang). A bug at the very top of the putchar() routine was messing up the font table address. And yes, I know assembler is a PITA... I wish I could get a gratis copy of PBP...
Corrected version attached (375 words total). I still need to dig out my old Nokia 5110 display and test this on real hardware. I also have a tiny 128x32 I2C OLED display and a tiny 128x64 SPI OLED display to play with sometime soon.
Cheerful regards, Mike
Nokia_Main.c.txt
putstr still not working
I think it should look like this, but it only works for the first call
so I get "Re and then garbage
Code:void putstr(const char *str) // put 'ROM' strings { // while(*str) wrchar(*str++); } //
Warning I'm not a teacher
more oddly
strcpy(buff,"eady");
putstr(buff);
works with my modified routine
putstr("eady");
crashes the show
Warning I'm not a teacher
fixed it, compiler optimised ascii var outCode:void wrchar(char d) // { volatile char ascii=d;
Warning I'm not a teacher
Yes, your putstr() routine is better...
While debugging I've found XC8 is using the same memory location for local variables in both the wrchar() and putstr() functions. The wrchar@ascii variable is using 70h and the putstr@str pointer is using 70h and 71h. Is this a result of my heavy use of assembly code? That is, XC8 doesn't realize those local variables need to be unique? How do I get XC8 to use unique memory locations for those local variables?
make them static
Warning I'm not a teacher
Bookmarks