embedded - DEBUGIN burst speed effecting SPI on BASIC Stamp -


i have application on parallax basic stamp board reads text commands , executes test cases based on commands. 1 test case sends data via spi bus , reads spi bus failing, depending upon burst rate of debugin text.

the stamp board connected pc (quad core 2+ ghz), through serial port @ 19200 baud.

when use basic stamp terminal or hyper terminal send commands stamp board, test passes. when send same commands via c# application, test fails. primary difference burst rate @ text sent stamp board.

humans send text slower computers (the application). when using hyper terminal, 1 character sent @ 19200 baud. application sending 8 characters @ 19200 baud no pauses between characters.

i'm looking explanation how debugin statement (input through serial port) affects shiftin or shiftout commands, or if knows how resolve issue.

unfortunately, baud rate of debugin command cannot changed. alternative have custom version (including conversion of text numbers) using serial port command @ slower speed (which uses valuable space, there little of on project).

if posting stackechange wrong forum, please migrate , post reason migrated.

it sounds microcontroller end not set job of servicing both uart , spi peripherals, , rapid arrival of subsequent characters on uart either causing spi not serviced, or perhaps causing characters on uart missed.

the robust solution understand problem , fix in architecture of micro controller code. example, may need use interrupts , have interrupt service routines move characters between longer software-managed fifos , 1- or 2- deep fifo in peripheral hardware.

a possibly workable riskier solution have c# application insert delays between characters sending, take advantage of apparent working of human-speed typing. variation on theme have embedded device echo characters, , have c# program wait echo of each character before sends next (you'll need escape character clear embedded command buffer , start on if c# program decides declare embedded device timed out , start over)

another idea shorten data has sent. human readable command languages embedded systems great, because you've noticed can play them using terminal application. however, if embedded system extremely constrained, using packed binary or hex format can make easier parse. extreme of single-character commands pauses in between execution simplest case of (and if use alphanumerics, being able use terminal program)


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -