Overtone Labs

CUI32 & StickOS flash drive logger won't work

I'm trying to use the CUI32 as a simple logger to flash without success. In the simple 'test' program (below), every 1 second, the led connected to AN15 should flash and the random number printed to the flash drive. and repeated for 100 cycles.

The flash drive works on a PC OK. It has an in built LED that flashes when data is being transferred. The sequence I've been trying is: a) connect CUI32 to PC as USB device via Hyperterm b) write/save the program (below) c) set usbhost mode to ON d) set autorun mode to ON e) , f) remove power g) and set switch on CUI32 to USB host h) connect the flash drive I) turn on power

But - nothing happens - no activity on the flash drive and no flashing LED on AN15. Yet, if I remove the flash drive, the program starts to run (I can see the LED flash every second).

Must be doing something wrong but what?

Your help would be most appreciated. Many thanks.

PS I am using a standard motherboard USB header and the USBID line is connected (and is 0 volts when the program is running with the flash drive connected - is that OK?)

Regards Steve

Welcome to StickOS for Microchip PIC32MX4-F512H CUI32 v1.92c!
Copyright (c) 2008-2010; all rights reserved.
http://www.cpustick.com
support@cpustick.com
(checksum 0xb5ad)
> list
1000 dim led as pin an15 for digital output
1010 dim x
1011 x = 100
1012 configure timer 1 for 1 s
1020 while x>0 do
1040   on timer 1 do gosub op
1060   x = x-1
1080 endwhile
2000 halt
3000 sub op
3100   print x, "  --  ", random
3200   led = !led
3250   x = x+1
3300 endsub
end
> usbhost
off
> usbhost on
> autorun on
>

Views: 46

Reply to This

Replies to This Discussion

Doh! - Fixed up the program so it works like it was supposed to, but still no luck with getting data to the flash drive.

Still hoping someone can help!!

Regards

 

1000 dim led as pin an15 for digital output
1010 dim x
1011 x = 10
1012 configure timer 1 for 1 s
1013 on timer 1 do gosub op
2000 halt
3000 sub op
3100   print x, "  --  ", random
3200   led = !led
3250   x = x-1
3260   if x==0 then
3270     print "End of test"
3280     end
3290   endif
3300 endsub

Reply to Discussion

RSS

© 2014   Created by Dan Overholt.

Badges  |  Report an Issue  |  Terms of Service