Shiftout 6 changed nothing, so will hook up scope in logic analyzer mode and report.
Shiftout 6 changed nothing, so will hook up scope in logic analyzer mode and report.
Hooked scope to pins.
There is series of pulses on SCLK and RST gets high and low as specified.
However, there is no activity on serial input/output lines.
To check the wiring, I wrote this simple code:
And it works fine - I can see square pulses with scope on each pin, so there are no wiring issues.Code:krd: high sclk high tc high rst high fc pauseus 500 low sclk low tc low rst low fc pauseus 500 goto krd
Any ideas?
One issue might be the fact that you have LCD datapins overlapping at least one of the pins that you're using with SHIFTIN/SHIFTOUT.
This code does not match comment: TRISC=%00000000 'set half C for in/out.
Also, note that my suggestion was to try mode 6 on SHIFTIN - not SHIFTOUT. Not that it would make any difference untill SHIFTOUT is outputting data.
not to mention. a 32bit address attempt ?
Reader: 'Font reading outline
LOW RST ' Ready for transfer
Shiftout TC, SCLK, 5, [$03,$100,$00,$0] ' Send write command, set start offset
For I=0 to 255 'read 8 bytes of data
Shiftin FC, SCLK, 5, [x]
LCDOUT $fE, $C0, DEC I,32, DEC X
Pause 200
next5.75 SHIFTOUT
SHIFTOUT DataPin, ClockPin, Mode, [Var{\Bits}...]
Synchronously shift out Var on ClockPin and DataPin. ClockPin and DataPin may be a constant, 0-15, or a variable that contains a number 0-15 (e.g. B0) or a pin name (e.g. PORTA.0).
SHIFTOUT is a software-based command and does not require that the target device have synchronous serial capability. The ClockPin and DataPin parameters may be set to any digital I/O pins, and may be different in different commands within the same program.
\Bits optionally specifies the number of bits to be shifted out. If it is not specified, 8 bits are shifted out, independent of the variable type. The Bits shifted out are always the low order bits, regardless of the Mode used, LSB or MSB. Up to 32 Bits can be shifted out of a single (long) variable. If more than 32 Bits are required, multiple variables or constants may be included between the square brackets.
Warning I'm not a teacher
OK I moved these ports to C0 and C1.
SCLK VAR PORTB.5 'CLOCK
TC VAR PORTC.1 'TO CHIP - WRITE
FC VAR PORTC.0 'FROM CHIP - READ
RST VAR PORTB.4 'RESET
Set all ports to output, except FC, which is set as input.
And I don't get, what's wrong with $100 ?
I'm sending 3 bytes, that's 24 bits.
It still does not works.
I removed all LCD code
I mapped output to different port - still can't capture anything with scope.
And there are no issues with hardware - setting these pins high-low works perfectly.
So it seems like shiftout not working?
Yes, you're sending 3 bytes (four atually if you count the command byte ($03)) but what Richard is saying is that $100 does not fit within a byte and according to the manual it will then get truncated to 8bits so in effect your shiftout statement send 3,0,0,0. Are you SURE you don't see a short pulse on the FC-pin? TrySet the scope to trig on the falling edge of RST.Code:DoIt: LOW RST SHIFTOUT TC, SCLK, 5, [$AA,$AA,$AA,$AA] HIGH RST Pause 2 Goto DoIt
how big is the biggest number that can be represented in a byte ?And I don't get, what's wrong with $100 ?
an attempt to read from address 0x1000000 a non valid 25 bit address, except that shiftout will send address of 0x00 since the 8 bit default not over writtenCode:Shiftout TC, SCLK, 5, [$03,$100,$00,$0] ' Send write command, set start offset
maybe [3,1,0,0] or [3,100,0,0] or [3\8,$100\16,0\8] or [3,$100\16,0]
Last edited by richard; - 10th November 2021 at 06:55.
Warning I'm not a teacher
Bookmarks