 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > TriBladeProp PCB: Uses 3 Propeller ICs for a Single Board Computer (SBC) | Forum Quick Jump
|
 |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/15/2009 11:47 PM (GMT -8) |   | | Packing instructions when travelling: Toothbrush, toothpaste, shaver, triblade... | | Back to Top | | |
   |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/16/2009 2:33 AM (GMT -8) |   | Much rejoicing!!!
Cluso, re that post about 6 back, those files work perfectly with 1 stop bit. I don't know how you did it but, YIPPEE!
Tested with Wordstar - all perfect. Tested with xmodem - all perfect.
Right, now I guess we need to package that up into a working zip and tidy up all those mods I made along the way. Any chance you could pls re-release this with a few simple mods?
* No need to include my name in the file now this works. * My baud rate was 38400 but I think most people would prefer 115k so change that. * Do we go 13,10? Or (here is an idea), add a simple subroutine PUB/PRI CRLF and just call it after each line, and you just modify that one PUB if you only want a 13? * Change that signon message re the serial settings to 1 stop bit. (it is kind of useful in case someone accidentally turned hardware flow control on or something, at least by searching the source code they would get a clue) * I got sick of typing 'yes' every time it booted to enable the sd card. I always wanted the sd card. So I disabled that message. Is that ok? * do a quick search for the term N8VEM for all the instances I added traps for N8VEM I/O calls. Maybe add these to comments in the revision list. * When I moved over to Kye's code I had to comment out lots of the TV.hex calls. Now there is the PUB PrintHex(value) at the end of the program, maybe uncomment them all so it calls that pub instead. Find with a search for tv.hex. * in 'out_constat ' I print out the port number rather than the byte. Useful to see what is going on. There seem to be some ^C (&H03) characters going out from time to time, eg just before the A> prompt. Not sure what is creating those. Eventually maybe find what is sending those, or comment out the line printing it (though maybe not yet as it still could be useful)
Hopefully the next series of mods will be done in a bit more structured way (ie, memo to self - make more comments along the way!) | | Back to Top | | |
  |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/16/2009 5:58 AM (GMT -8) |   | Yes, I have about 8 folders now with different versions. Very confusing. Some of the things you sent were added and some were not. The key with Kye's code was to greatly simplify the way bytes were captured and this in turn uncovered the bug talking to CP/M.
Anyway, the good news is that it now seems impossible to break. Stuff just seems to work. So, let's just go with that last code you posted.
What next? The faster sd access (is the current one 100khz?). Or the 8mb drives (maybe heater can help with that 8mb code). All very exciting! | | Back to Top | | |
   |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/16/2009 3:15 PM (GMT -8) |   | | Yes, Cluso rushed off and got a whole lot of things working yesterday. Not sure how he does it! I'll plug in the serial engine code tonight and give it a test run. | | Back to Top | | |
 |  Cluso99 We live onboard

       Date Joined Apr 2008 Total Posts : 2276 | Posted 8/16/2009 8:20 PM (GMT -8) |   | James: It was a 5 second mod to add the call names like Kye's. You are reading way too much complexity into all this
Granted that Kye's code let you look for the actual problem.
Kye: Thanks for your code - it helped solve the real bug of dropping characters.
I think there is a bug in the rxavail call.
PUB rxavail '' 3 Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ '' │ Returns the number of characters in the receiver buffer. │ '' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
return ((inputHead - inputTail) & $FF)
Should be...
PUB rxavail '' 3??? Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ '' │ Returns the number of characters in the receiver buffer. │ '' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
if inputHead >= inputTail
return ((inputHead - inputTail) & $FF)
else
return ((inputHead + $FF - inputTail)) & $FF)
Is it necessary to know the number of received characters in the buffer? If not, then this may be simpler..
PUB rxavail : truefalse
'' Check if byte(s) available '' returns true (-1) if bytes available
truefalse := rx_tail <> rx_head
BTW can you use a constant to define the length of the buffers like I did with the recent posting of the modified FDX for James (also pasm needs to use the constant also)
CON bufsiz = 256 '16 'buffer size (16, 32, 64, 128, 256, 512) must be factor of 2, max is 512 bufmsk = bufsiz - 1 'buffer mask used for wrap-around ($00F, $01F, $03F, $07F, $0FF, $1FF)
VAR byte rx_buffer[bufsiz] 'transmit and receive buffers byte tx_buffer[bufsiz]
rx_tail := (rx_tail + 1) & bufmsk 'example of use Kye, we should probably continue this under your SerialEngine post as there may be input from others. I also have some other ideas for you.
Links to other interesting threads:
| | Back to Top | | |
 |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/17/2009 12:02 AM (GMT -8) |   | Ok, using Cluso's 'james' files for the moment: 1) I edited z.bat to this:
homespun024 zicog_demo009_rr092_james2 -b -d -i3 -w zicog_demo009_rr092_james2.binary pause
This speeds up the compilation process. Edit the spin in the Prop tool or notepad. Save the file. Run z.bat. Double click on the 'load eeprom' Shut down the prop tool. Run the terminal program.
2) One nifty thing about the zicog is debugging. I have DRIVE__I.DSK added to the list
#else FindDriveBase(0, string("DRIVE__A.DSK")) 'set the SD card drive base(s) CPM2.2 FindDriveBase(1, string("DRIVE__B.DSK")) 'set the SD card drive base(s) FindDriveBase(2, string("DRIVE__C.DSK")) 'set the SD card drive base(s) FindDriveBase(3, string("DRIVE__D.DSK")) 'set the SD card drive base(s) FindDriveBase(4, string("DRIVE__E.DSK")) 'set the SD card drive base(s) FindDriveBase(5, string("DRIVE__F.DSK")) 'set the SD card drive base(s) FindDriveBase(6, string("DRVCPM_2.DSK")) 'set the SD card drive base(s) CPM2.2 FindDriveBase(7, string("DRVCPM_3.DSK")) 'set the SD card drive base(s) CPM3 FindDriveBase(8, string("DRIVE__I.DSK")) 'set the SD card drive base(s) 8MB #endif
Then add some debugging capture to the ports that don't exist yet (two new lines near the bottom to print the port and the byte)
'Handle Z80 IO port reads case io_port srport: 'Altair front panel switches register in_srport simhport: 'SIMH control port in_simhport constat: 'Console status port. in_constat condata: 'Console data port in_condata statin: 'Altair disk status port in_statin secpos: 'Altair disk sector position port in_secpos dskread: 'Altair disk read port in_dskread n8vem_uart_test: ' test port $6D in_test_n8vem ' is a byte ready returns 0 for no byte, 1 for a byte n8vem_uart_in: ' ask for input from port $68 in_uart_n8vem ' get the byte #ifdef hdskenable hdskport: in_hdskport 'SIMH style hard disk port #endif other: UART.transmitCharacters(string("Read from unimplemented I/O Port &H")) printhex(io_port) UART.transmitCharacters(string(" with byte &H")) printhex(io_data) UART.transmitCharacters(string(13,10)) io_data := 0 io_command := 0
and
PRI on_output 'Handle Z80 IO port writes case io_port ledport: 'An 8 bit parallel output with LEDs attached out_ledport simhport: 'SIMH control port out_simhport condata: 'Console data port out_condata constat: 'Console status port out_constat punstat: out_punstat 'Punch control port selout: 'Altair disk controller select port out_selout dskcon: 'Altair disk function port out_dskcon dskwrit: 'Altair disk write port out_dskwrit n8vem_uart_out: ' &H68 out_n8vem_byte #ifdef hdskenable hdskport: out_hdskport 'SIMH style hard disk port #endif other: UART.transmitCharacters(string("Write to unimplemented I/O Port &H")) printhex(io_port) ' print the port number for debugging UART.transmitCharacters(string(" with byte &H")) printhex(io_data) UART.transmitCharacters(string(13,10)) io_command := 0 'Set flag ready for next io
And now try to get into drive I. It prints out the following:
Write to unimplemented I/O Port &HFD with byte &H02 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H06 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H39 Write to unimplemented I/O Port &HFD with byte &HF7 Read from unimplemented I/O Port &HFD with byte &HF7 Write to unimplemented I/O Port &HFD with byte &H02 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H01 Write to unimplemented I/O Port &HFD with byte &H06 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H39 Write to unimplemented I/O Port &HFD with byte &HF7 Read from unimplemented I/O Port &HFD with byte &HF7 Write to unimplemented I/O Port &HFD with byte &H02 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H02 Write to unimplemented I/O Port &HFD with byte &H06 Write to unimplemented I/O Port &HFD with byte &H00 Write to unimplemented I/O Port &HFD with byte &H39 Write to unimplemented I/O Port &HFD with byte &HF7 Read from unimplemented I/O Port &HFD with byte &HF7 Write to unimplemented I/O Port &HFD with byte &H02
etc
Then tried uncommenting this line #define hdskenable 'Uncomment for hard disk support and added this line
PRI in_hdskport_read | r 'Handle read from hdskport during a disk read command 'This read triggers the actual disk sector transfere 'and must return an error code. 'N.B. sectors are mapped to blocks 1 to 1 UART.transmitCharacters(string("hdisk read "))
and it then gets to hdisk read.
But further down
PRI in_hdskport_write 'Handle read from hdskport during a disk write command 'This read triggers the actual disk sector transfere 'and must return an error code. 'N.B. sectors are mapped to blocks 1 to 1 if hdsk_check_dts 'Check drive, track and sector are sane io_data := $FF 'Return error if not return #ifdef TriBladeProp '??? #else
Not sure what the '??? means, at this point I'm stuck. Any help would be most appreciated.Post Edited (Dr_Acula) : 8/17/2009 8:15:47 AM GMT | | Back to Top | | |
        |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/17/2009 2:33 AM (GMT -8) |   | I tried creating a blank 32mb file (=8mb drive) which makes DRIVE__Z.CPM in the vb6 program and then renamed it DRIVE__B.DSK but it still comes up as less than a mb.
Attached is the little DIRX program as this gives the space used and the space left and the directory. Sort of a combination of stat and dir
Then I read heaters comment. Does that mean drives A-H are 1mb and I, J, K L are 8mb each?
I see a parameter in the spin code that limits the number of drives to 8 - is that relevant?
'The following taken from SIMH Altair simulator CBIOSX.MAC ndisks = 8 ' total number of Altair disks
The N8VEM parameter blocks seem different - not sure if this will be relevant or not but these are the parameter blocks for the 448k ram disk 1mb rom disk, 8mb hard disk and a 1mb hard disk. But perhaps stick with the simh ones
DPBLK0: ; DISK PARAMETER BLOCK (ROMDISK 32KB WITH 16 2K TRACKS, 22K usable) SPT_0: .DW 16 ; 16 SECTORS OF 128 BYTES PER 2K TRACK BSH_0: .DB 3 ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK) BLM_0: .DB 7 ; PART OF THE ALLOCATION BLOCK SIZE MATH EXM_0: .DB 0 ; DEFINES SIZE OF EXTENT (DIRECTORY INFO) DSM_0: .DW 31 ; BLOCKSIZE [1024] * NUMBER OF BLOCKS + 1 = DRIVE SIZE DRM_0: .DW 31 ; NUMBER OF DIRECTORY ENTRIES AL0_0: .DB 10000000 ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY AL1_0: .DB 00000000 ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED CKS_0: .DW 0 ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE] OFF_0: .DW 5 ; FIRST 5 TRACKS TRACKS RESERVED (10K FOR SYSTEM) ; SYSTEM IS ROM LOADER, CCP, BDOS, CBIOS, AND MONITOR ; ; IMPORTANT NOTE: TRACKS $00 - $04 OF 2K BYTES ; EACH ARE MARKED WITH THE OFF_0 SET TO 5 AS ; SYSTEM TRACKS. USABLE ROM DRIVE SPACE ; STARTING AFTER THE FIFTH TRACK (IE, TRACK $05) ; MOST LIKELY FIX TO THIS IS PLACING A DUMMY ; FIRST 10K ROM CONTAINS THE ROM LOADER, MONITOR, ; CCP, BDOS, BIOS, ETC (5 TRACKS * 2K EACH)
DPBLK1: ; DISK PARAMETER BLOCK (RAMDISK 512K, 448K usable) SPT_1: .DW 256 ; 256 SECTORS OF 128 BYTES PER 32K TRACK BSH_1: .DB 4 ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK) BLM_1: .DB 15 ; PART OF THE ALLOCATION BLOCK SIZE MATH EXM_1: .DB 1 ; DEFINES SIZE OF EXTENT (DIRECTORY INFO) DSM_1: .DW 225 ; BLOCKSIZE [2048] * NUMBER OF BLOCKS + 1 = DRIVE SIZE DRM_1: .DW 255 ; NUMBER OF DIRECTORY ENTRIES AL0_1: .DB 11110000 ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY AL1_1: .DB 00000000 ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED CKS_1: .DW 0 ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE] OFF_1: .DW 1 ; 1 TRACK RESERVED [FIRST 32K OF RAM]
DPBLK2: ; DISK PARAMETER BLOCK (IDE HARD DISK 8MB) SPT_2: .DW 256 ; 256 SECTORS OF 128 BYTES PER 32K TRACK BSH_2: .DB 5 ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK) BLM_2: .DB 31 ; PART OF THE ALLOCATION BLOCK SIZE MATH EXM_2: .DB 1 ; DEFINES SIZE OF EXTENT (DIRECTORY INFO) DSM_2: .DW 2017 ; BLOCKSIZE [4096] * NUMBER OF BLOCKS + 1 = DRIVE SIZE ; HD PARTITION 2 IS 16128 SECTORS LONG ; AT 512 BYTES EACH WHICH IS ; 2016 BLOCKS AT 4096 BYTES A PIECE. DRM_2: .DW 511 ; NUMBER OF DIRECTORY ENTRIES AL0_2: .DB 11110000 ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY AL1_2: .DB 00000000 ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED CKS_2: .DW 0 ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE] OFF_2: .DW 1 ; 1 TRACK (32K) RESERVED FOR SYSTEM
DPBLK3: ; DISK PARAMETER BLOCK (IDE HARD DISK 8MB) SPT_3: .DW 256 ; 256 SECTORS OF 128 BYTES PER 32K TRACK BSH_3: .DB 5 ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK) BLM_3: .DB 31 ; PART OF THE ALLOCATION BLOCK SIZE MATH EXM_3: .DB 1 ; DEFINES SIZE OF EXTENT (DIRECTORY INFO) DSM_3: .DW 2017 ; BLOCKSIZE [4096] * NUMBER OF BLOCKS + 1 = DRIVE SIZE ; HD PARTITION 3 IS 16128 SECTORS LONG ; AT 512 BYTES EACH WHICH IS ; 2016 BLOCKS AT 4096 BYTES A PIECE. DRM_3: .DW 511 ; NUMBER OF DIRECTORY ENTRIES AL0_3: .DB 11110000 ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY AL1_3: .DB 00000000 ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED CKS_3: .DW 0 ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE] OFF_3: .DW 1 ; 1 TRACK (32K) RESERVED FOR SYSTEM
DPBLK4: ; DISK PARAMETER BLOCK (IDE HARD DISK 1024K) SPT_4: .DW 256 ; 256 SECTORS OF 128 BYTES PER 32K TRACK BSH_4: .DB 4 ; BLOCK SHIFT FACTOR (SIZE OF ALLOCATION BLOCK) BLM_4: .DB 15 ; PART OF THE ALLOCATION BLOCK SIZE MATH EXM_4: .DB 0 ; DEFINES SIZE OF EXTENT (DIRECTORY INFO) DSM_4: .DW 497 ; BLOCKSIZE [2048] * NUMBER OF BLOCKS + 1 = DRIVE SIZE ; HD PARTITION 4 IS 4032 SECTORS LONG ; AT 512 BYTES EACH WHICH IS ; 1008 BLOCKS AT 2048 BYTES A PIECE. ; NOT USING ALL OF THE AVAILABLE SECTORS SINCE THIS ; DRIVE IS INTENDED TO EMULATE A ROM DRIVE AND COPIED ; INTO A ROM IN THE FUTURE. DRM_4: .DW 255 ; NUMBER OF DIRECTORY ENTRIES AL0_4: .DB 11110000 ; BIT MAP OF SPACE ALLOCATED TO DIRECTORY AL1_4: .DB 00000000 ; DIRECTORY CAN HAVE UP TO 16 BLOCKS ALLOCATED CKS_4: .DW 0 ; SIZE OF DIRECTORY CHECK [0 IF NON REMOVEABLE] OFF_4: .DW 1 ; 1 TRACK RESERVED [FIRST 32K OF PARTITION]
This is my altair simh 'super cp/m computer' that I use for testing. Seems the same one as for the zicog. Drive I is correctly reporting 8mb with dirx. Just need to find the block parameters and port that over to the zicog??
d tracks[0-7] 254 attach dsk cpm2.dsk attach dsk1 basic.dsk attach dsk2 games.dsk attach dsk3 sbasic.dsk attach dsk4 supercalc.dsk attach dsk5 tools.dsk attach dsk6 wordstar.dsk attach hdsk i.dsk set cpu 64k set cpu noitrap set cpu z80 set cpu altairrom set cpu nonbanked reset cpu set sio ansi set sio nosleep boot dsk bye
and a printout of it running:
C:\N8VEM\AltairSIMH>altairz80 all
Altair 8800 (Z80) simulator V3.7-3 build 1016 (scp created Apr 20 2008 at 13:01: 09 with gcc 4.2.3)
64K CP/M Version 2.2 (SIMH ALTAIR 8800, BIOS V1.25, 2 HD, 15-Jan-07)
A>dirx Name Ext Bytes Name Ext Bytes Name Ext Bytes Name Ext Bytes ASM COM 8K ! EXZ80DOCCOM 12K ! SID COM 8K ! UNLOAD COM 2K BOOT COM 2K ! FORMAT COM 2K ! SPEED COM 2K ! USQ COM 2K BOOTGEN COM 2K ! HALT COM 2K ! STAT COM 6K ! W COM 4K CCPZ TXT 40K ! HDIR COM 2K ! SUBMIT COM 2K ! WS COM 8K COPY COM 2K ! L80 COM 12K ! SUPERSUBCOM 4K ! WS OVR 52K CPU COM 2K ! LOAD COM 2K ! SURVEY COM 2K ! WSMSGS OVR 14K DDT COM 6K ! M80 COM 20K ! SYSCOPY COM 2K ! XFORMAT COM 4K DDTZ COM 10K ! MBASIC COM 24K ! SYSCPM2 SUB 2K ! XSUB COM 2K DIRX COM 4K ! PACMAN95COM 18K ! SYSCPM2ZSUB 2K ! ZASM SUB 2K DUMP COM 2K ! PIP COM 8K ! TIMER COM 2K ! ZSID COM 10K ED COM 8K ! R COM 4K ! TS SUB 2K ! ZTRAN4 COM 4K EX8080 COM 12K ! RSETSIMHCOM 2K ! UNCR COM 8K EXZ80ALLCOM 12K ! SHOWSEC COM 4K ! UNERA COM 2K 50 File(s), occupying 370K of 984K total capacity 198 directory entries and 614K bytes remain on A: A>i: I>dirx Name Ext Bytes Name Ext Bytes Name Ext Bytes Name Ext Bytes CP409DOCARK 68K ! K1KERM11LBR 16K ! ZORK1 COM 12K ! ZORK2 DAT 92K CP411HEXARK 156K ! LU COM 20K ! ZORK1 DAT 84K ! ZORK3 COM 12K CP411SRCARK 436K ! UNARC COM 8K ! ZORK2 COM 12K ! ZORK3 DAT 92K 12 File(s), occupying 1008K of 8136K total capacity 987 directory entries and 7128K bytes remain on I: I>
File Attachment : DIRX.zip 2KB (application/zip)This file has been downloaded 18 time(s). | | Back to Top | | |
  |  Cluso99 We live onboard

       Date Joined Apr 2008 Total Posts : 2276 | Posted 8/17/2009 4:03 AM (GMT -8) |   | | James: Here is v094. Could you please check it before I post at the top of this thread.(it is untested)
You will need to uncomment the #define CPU_Z80 line in ZiCog009_rr090 (bst would not otherwise zip the project).
I have added #define addLF which outputs a LF following CR in the FDX object (new mode).
If all is ok, please uncomment the 4 lines from ZiCog009_demo_rr094 before the #endif as shown (careful of indents)
PRI WriteSRAMblock | i, r, mask, in
r := tbp2.start check_error(r)
#ifdef diskboot 'clears ram $0000-$EFFF, loads $FF00-$FFFF, loads sram disk above 'remember we are reading 8KB blocks, so clear the seven blocks and 8KB-128B of eighth block if blockno < 8 'TV.dec(blockno) if blockno == 7 repeat i from 0 to count-1 -(256) 'clear below $FF00 buff[i] := 0 'clear the buffer else repeat i from 0 to count-1 buff[i] := 0 'clear the buffer if blockno == 0 buff[0] := $C3 'force jmp to $FF00 (faster) buff[1] := $00 buff[2] := $FF #endif
This should improve the boot speed - causes a direct jump to the disk boot code $FF00
Links to other interesting threads:
| | Back to Top | | |
 |  Dr_Acula Registered Member

       Date Joined Dec 2008 Total Posts : 606 | Posted 8/17/2009 4:47 AM (GMT -8) |   | Close but getting a hang after this (doesn't give the A> prompt)
ZiCog v0.009 on the TriBladeProp v0.09x 8 bit, parity=None, 1 stop bit, Flow control=None
Starting disks... A:DRIVE__A.DSK B:DRIVE__B.DSK C:DRIVE__C.DSK D:DRIVE__D.DSK E:DRIVE__E.DSK F:DRIVE__F.DSK G:DRVCPM_2.DSK H:DRVCPM_3.DSK Loading SRAM... ................................................................................ ................................................Loaded Starting TriBladeProp driver ... Passed, please wait... Starting Z80 emulation... Passed, please wait...
64K CP/M Version 2.2 (SIMH ALTAIR 8800, BIOS V1.25, 2 HD, 15-Jan-07)
Unknown console status write with byte &H03
More experiments, random key presses eventually brings up the A> prompt but none of the characters are echoed.
More more experiments, going back to the serial object v002, that gets to the A prompt but the characters on the keyboard are coming back as different characters eg i came back as a u.
What changed from this version (see attached)Post Edited (Dr_Acula) : 8/17/2009 1:08:41 PM GMT
File Attachment : James_17Aug.zip 1.89Mb (application/zip)This file has been downloaded 20 time(s). | | Back to Top | | |
  |  Kye Kwabena Agyeman

       Date Joined Feb 2008 Total Posts : 619 | Posted 8/17/2009 5:53 AM (GMT -8) |   | Ah, not quite cluso. The whole reseaon I used 256 byte buffers is to exploit the fact that a while using a byte head and tail pointer they have automatic wrap arround.
return ((inputHead - inputTail) & $FF)
Is actually the simpliest way to calculate amount of stuff in the FIFO buffer. Great ain't it? It's also more usefull than just know if there is stuff or isn't stuff because it allows you to know the amount in the buffer.
...
Well, unless anyone has any results on my driver working now or not I'll be moving on to other things.
Cluso99 said...James: It was a 5 second mod to add the call names like Kye's. You are reading way too much complexity into all this
Granted that Kye's code let you look for the actual problem.
Kye: Thanks for your code - it helped solve the real bug of dropping characters.
I think there is a bug in the rxavail call.
PUB rxavail '' 3 Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ '' │ Returns the number of characters in the receiver buffer. │ '' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
return ((inputHead - inputTail) & $FF)
Should be...
PUB rxavail '' 3??? Stack Longs
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ '' │ Returns the number of characters in the receiver buffer. │ '' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
if inputHead >= inputTail
return ((inputHead - inputTail) & $FF)
else
return ((inputHead + $FF - inputTail)) & $FF)
Is it necessary to know the number of received characters in the buffer? If not, then this may be simpler..
PUB rxavail : truefalse
'' Check if byte(s) available '' returns true (-1) if bytes available
truefalse := rx_tail <> rx_head
BTW can you use a constant to define the length of the buffers like I did with the recent posting of the modified FDX for James (also pasm needs to use the constant also)
CON bufsiz = 256 '16 'buffer size (16, 32, 64, 128, 256, 512) must be factor of 2, max is 512 bufmsk = bufsiz - 1 'buffer mask used for wrap-around ($00F, $01F, $03F, $07F, $0FF, $1FF)
VAR byte rx_buffer[bufsiz] 'transmit and receive buffers byte tx_buffer[bufsiz]
rx_tail := (rx_tail + 1) & bufmsk 'example of use Kye, we should probably continue this under your SerialEngine post as there may be input from others. I also have some other ideas for you.
Nyamekye, | | Back to Top | | |
 | 848 posts in this thread. Viewing Page : | | Forum Information | Currently it is Friday, November 20, 2009 10:32 PM (GMT -8) There are a total of 393,734 posts in 55,521 threads. In the last 3 days there were 82 new threads and 702 reply posts. View Active Threads
| | Who's Online | This forum has 17687 registered members. Please welcome our newest member, mark09. 65 Guest(s), 6 Registered Member(s) are currently online. Details JRetSapDoog, Chris Savage (Parallax), mpark, Kye, Sal Ammoniac, micromang |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|