Menu

SHIFTIN/SHIFTOUT

Help
2006-10-20
2013-05-30
  • Nobody/Anonymous

    Hello... first of all, thanks for all of the hard work on GCBasic... it looks as though this could be a great alternative to picbasic(pro)

    I was wondering if there is a SHIFTIN/SHIFTOUT equivalent in GCBasic... I'm trying to tie my project to a MAX7219 7segdriver and a DS1302 RTC.

    It appears as though I might be able to alter the existing PS2 code to include a chip-enable, but so far I have not been able to make this work.

    Any help you could provide would be greatly appreciated.

    Regards,

    Jason

     
    • Hugh Considine

      Hugh Considine - 2006-10-21

      The USART module that is built in to many PICs may make life easier here. Have a look at the datasheet for the PIC you are using, and see if this helps at all.

      The PS2 code only has read implemented at the moment. Adding chip enable to it should be a matter of adding a set command at the start and end of the PS2ReadByte subroutine to control a chip enable pin.

      Have you looked at using SPI? GCBASIC has support for the built in SPI module that is on many PIC chips. SPI uses 3 wires - send data, receive data and clock. With a few diodes, it should be possible to connect the data lines of your devices to the PIC send and receive pins.

      I shall write some ShiftIn/ShiftOut routines for the next version of GCBASIC. I'll post them here as soon as possible.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.