Posted: Sat Jan 23, 2016 8:44 am Post subject: Simulating Buffered Serial Out
Hi guys,
I'm trying to simulate buffered serial output and it's not working. What am I missing?
I start with the provided sample rs232bufferout.bas.
Added the line $SIM
Compile F7. Simulate F2
And it executes down to line 31 Print "Test"
Then stops. Hangs.
If I comment out the line "Config Serialout = Buffered , Size = 20 " so it is not buffered then it works.
What am I getting wrong?
Code:
'----------------------------------------------------------------------------------------- 'name : rs232bufferout.bas 'copyright : (c) 1995-2005, MCS Electronics 'purpose : demonstrates how to use a serial output buffer 'micro : Mega48 'suited for demo : yes 'commercial addon needed : no '----------------------------------------------------------------------------------------- '$sim '<------THIS IS NEW $regfile="m48def.dat"' specify the used micro $crystal=8000000' used crystal frequency $baud=19200' use baud rate $hwstack=40' default use 32 for the hardware stack $swstack=40' default use 10 for the SW stack $framesize=40' default use 40 for the frame space
'setup to use a serial output buffer 'and reserve 20 bytes for the buffer Config Serialout =Buffered , Size=20'<---Comment to make it work
'It is important since UDRE interrupt is used that you enable the interrupts EnableInterrupts Print"Hello world" Print"test1" Do Wait1 'notice that using the UDRE interrupt will slown down execution of waiting loops like waitms Print"test" Loop End
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum