I found a 1.8" color display for $5.19 shipped from Hong Kong!
http://www.ebay.com/itm/141109430611...84.m1439.l2649
You talk to it via SPI which is fairly simple to do in Basic. Here's the init code for Fast Master mode;
'Set SPI pin directions
dir PORTC.5 out
dir PORTC.4 in
dir PORTC.3 out
'Set SPI Mode to master, with fast clock
Set SSPCON1.SSPEN Off 'Turn off SPI (Prevents any weird glitches during setup)
Set SSPSTAT.SMP Off 'Set clock pulse settings
Set SSPSTAT.CKE Off 'Data write on rising (idle > active) clock (CPHA = 1)
Set SSPCON1.CKP Off 'Clock idle low (CPOL = 0)
Set SSPCON1.SSPM3 Off 'Select master mode and fast clock
Set SSPCON1.SSPM2 Off
Set SSPCON1.SSPM1 Off
Set SSPCON1.SSPM0 Off
Set SSPCON1.SSPEN On 'Enable SPI
Then a simple subroutine will send a byte of data;
' SendToScreen (OutData, InData) Simultaneously send and receive a SPI byte
Sub SendToScreen (In ScreenData, Out ScreenData)
'Clear WCOL
Set SSPCON1.WCOL Off
'Put byte to send into buffer
'Will start transfer
SSPBUF = SPITxData
'Read buffer
'Same for master and slave
Wait While SSPSTAT.BF = Off
SPIRxData = SSPBUF
Set SSPSTAT.BF Off
End Sub
We just have to figure out what to send! I imagine a graphical setup where
you can adjust the pulse widths and spacing on the screen as line drawings...
I'm trying to juggle the pins around and allow for the future to have 2 pairs of receiver pulses and 2 Ground Balance pulses
as well as the analog inputs to possible sample the demodulated data.
We need 5 pins for the initial pulses (TX, Damping, First, Second and Gnd Bal) and 3 more for future expansion (First2, Second2 and Gnd Bal2). So we'll use Port D for all 8 pulses.
The SPI for the LCD needs most of Port C.
We'll use A0 - 2 for Analog inputs for 3 channels and E0 - 3 for the other 3.
A0 =First
A1 = Second
A2 = Gnd Bal
E0 = First2
E1 = Second2
E2 = Gnd Bal2
And we still have all of Port B for fun stuff like LED's and Rotary Encoders!
http://www.ebay.com/itm/141109430611...84.m1439.l2649
You talk to it via SPI which is fairly simple to do in Basic. Here's the init code for Fast Master mode;
'Set SPI pin directions
dir PORTC.5 out
dir PORTC.4 in
dir PORTC.3 out
'Set SPI Mode to master, with fast clock
Set SSPCON1.SSPEN Off 'Turn off SPI (Prevents any weird glitches during setup)
Set SSPSTAT.SMP Off 'Set clock pulse settings
Set SSPSTAT.CKE Off 'Data write on rising (idle > active) clock (CPHA = 1)
Set SSPCON1.CKP Off 'Clock idle low (CPOL = 0)
Set SSPCON1.SSPM3 Off 'Select master mode and fast clock
Set SSPCON1.SSPM2 Off
Set SSPCON1.SSPM1 Off
Set SSPCON1.SSPM0 Off
Set SSPCON1.SSPEN On 'Enable SPI
Then a simple subroutine will send a byte of data;
' SendToScreen (OutData, InData) Simultaneously send and receive a SPI byte
Sub SendToScreen (In ScreenData, Out ScreenData)
'Clear WCOL
Set SSPCON1.WCOL Off
'Put byte to send into buffer
'Will start transfer
SSPBUF = SPITxData
'Read buffer
'Same for master and slave
Wait While SSPSTAT.BF = Off
SPIRxData = SSPBUF
Set SSPSTAT.BF Off
End Sub
We just have to figure out what to send! I imagine a graphical setup where
you can adjust the pulse widths and spacing on the screen as line drawings...
I'm trying to juggle the pins around and allow for the future to have 2 pairs of receiver pulses and 2 Ground Balance pulses
as well as the analog inputs to possible sample the demodulated data.
We need 5 pins for the initial pulses (TX, Damping, First, Second and Gnd Bal) and 3 more for future expansion (First2, Second2 and Gnd Bal2). So we'll use Port D for all 8 pulses.
The SPI for the LCD needs most of Port C.
We'll use A0 - 2 for Analog inputs for 3 channels and E0 - 3 for the other 3.
A0 =First
A1 = Second
A2 = Gnd Bal
E0 = First2
E1 = Second2
E2 = Gnd Bal2
And we still have all of Port B for fun stuff like LED's and Rotary Encoders!
Comment